| 1 |
/******************************************************************************* |
|---|
| 2 |
* Copyright (c) 2000, 2003 IBM Corporation and others. |
|---|
| 3 |
* All rights reserved. This program and the accompanying materials |
|---|
| 4 |
* are made available under the terms of the Common Public License v1.0 |
|---|
| 5 |
* which accompanies this distribution, and is available at |
|---|
| 6 |
* http://www.eclipse.org/legal/cpl-v10.html |
|---|
| 7 |
* |
|---|
| 8 |
* Contributors: |
|---|
| 9 |
* IBM Corporation - initial API and implementation |
|---|
| 10 |
*******************************************************************************/ |
|---|
| 11 |
module controlexample.customcontrolexample; |
|---|
| 12 |
|
|---|
| 13 |
private { |
|---|
| 14 |
import swt.all; |
|---|
| 15 |
import controlexample.tab; |
|---|
| 16 |
import controlexample.controlexample; |
|---|
| 17 |
import controlexample.ccombotab; |
|---|
| 18 |
import controlexample.ctabfoldertab; |
|---|
| 19 |
import controlexample.clabeltab; |
|---|
| 20 |
import controlexample.sashformtab; |
|---|
| 21 |
import controlexample.styledtexttab; |
|---|
| 22 |
import controlexample.tabletreetab; |
|---|
| 23 |
} |
|---|
| 24 |
|
|---|
| 25 |
public class CustomControlExample : ControlExample { |
|---|
| 26 |
|
|---|
| 27 |
/** |
|---|
| 28 |
* Creates an instance_ren of a CustomControlExample embedded |
|---|
| 29 |
* inside the supplied parent Composite. |
|---|
| 30 |
* |
|---|
| 31 |
* @param parent the container of the example |
|---|
| 32 |
*/ |
|---|
| 33 |
public this(Composite parent) { |
|---|
| 34 |
super (parent); |
|---|
| 35 |
} |
|---|
| 36 |
|
|---|
| 37 |
/** |
|---|
| 38 |
* Answers the set of example Tabs |
|---|
| 39 |
*/ |
|---|
| 40 |
Tab[] createTabs() { |
|---|
| 41 |
Tab [] result; |
|---|
| 42 |
|
|---|
| 43 |
result ~= new CComboTab (this); |
|---|
| 44 |
result ~= new CLabelTab (this); |
|---|
| 45 |
result ~= new CTabFolderTab (this); |
|---|
| 46 |
result ~= new SashFormTab (this); |
|---|
| 47 |
// result ~= new StyledTextTab (this); |
|---|
| 48 |
result ~= new TableTreeTab (this); |
|---|
| 49 |
return result; |
|---|
| 50 |
} |
|---|
| 51 |
|
|---|
| 52 |
} |
|---|
| 53 |
|
|---|
| 54 |
static void run(){ |
|---|
| 55 |
Display display = new Display(); |
|---|
| 56 |
Shell shell = new Shell(display); |
|---|
| 57 |
shell.setLayout(new FillLayout()); |
|---|
| 58 |
CustomControlExample instance_ren = new CustomControlExample(shell); |
|---|
| 59 |
shell.setText(CustomControlExample.getResourceString("custom.window.title")); |
|---|
| 60 |
CustomControlExample.setShellSize(display, shell); |
|---|
| 61 |
shell.open(); |
|---|
| 62 |
while (! shell.isDisposed()) { |
|---|
| 63 |
if (! display.readAndDispatch()) display.sleep(); |
|---|
| 64 |
} |
|---|
| 65 |
instance_ren.dispose(); |
|---|
| 66 |
} |
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
/** |
|---|
| 70 |
* Invokes as a standalone program. |
|---|
| 71 |
*/ |
|---|
| 72 |
//public void main(String[] args) { |
|---|
| 73 |
// try{ run(); |
|---|
| 74 |
// }catch(Exception e){ |
|---|
| 75 |
// Util.trace(e.toString()); |
|---|
| 76 |
// } |
|---|
| 77 |
//} |
|---|