1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
|
public void createControl(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(null);
composite.setFont(parent.getFont());
//PlatformUI.getWorkbench().getHelpSystem().setHelp(topLevel,IIDEHelpContextIds.NEW_FILE_WIZARD_PAGE);
//1 row
Label label = new Label(composite, SWT.WRAP);
label.setText(" Name :");
label.setFont(this.getFont());
label.setBounds(0, 0, 120, 20);
fileNameField = new Text(composite, SWT.SINGLE | SWT.BORDER);
fileNameField.addModifyListener(validator);
fileNameField.setFont(this.getFont());
fileNameField.setBounds(140, 0, 300, 20);
if (null != containerFullPath) {
String fileName = getUniqueFileName(
containerFullPath, DEFAULT_FILENAME);
fileNameField.setText(fileName);
}
Group group = new Group(composite, SWT.SHADOW_ETCHED_IN);
group.setText("Type");
Label labelBox = new Label(group,SWT.WRAP);
labelBox.setText("Box ");
labelBox.setBounds(140, 30, 30, 20);
boxBtn = new Button(group, SWT.RADIO);
boxBtn.setBounds(180, 30, 30, 20);
Listener listenerBox = new Listener() {
public void handleEvent(Event event) {
if (event.widget == boxBtn) {
canFinish = true;
}
}
};
boxBtn.addListener(SWT.Selection, listenerBox);
Label labelCell = new Label(group,SWT.WRAP);
labelCell.setText("Cell ");
labelCell.setBounds(240, 30, 30, 20);
cellBtn = new Button(group, SWT.RADIO);
cellBtn.setBounds(280, 30, 30, 20);
Listener listenerCell = new Listener() {
public void handleEvent(Event event) {
if (event.widget == cellBtn) {
canFinish = true;
}
}
};
cellBtn.addListener(SWT.Selection, listenerCell);
Label labelColumn = new Label(group,SWT.WRAP);
labelColumn.setText("Column ");
labelColumn.setBounds(340, 30, 40, 20);
columnBtn = new Button(group, SWT.RADIO);
columnBtn.setBounds(390, 30, 30, 20);
Listener listenerColumn = new Listener() {
public void handleEvent(Event event) {
if (event.widget == columnBtn) {
canFinish = true;
}
}
};
columnBtn.addListener(SWT.Selection, listenerColumn);
Label labelLayer = new Label(group,SWT.WRAP);
labelLayer.setText("Layer ");
labelLayer.setBounds(140, 60, 30,20);
layerBtn = new Button(group, SWT.RADIO);
layerBtn.setBounds(180, 60, 30,20);
Listener listenerLayer = new Listener() {
public void handleEvent(Event event) {
if (event.widget == layerBtn) {
canFinish = true;
}
}
};
layerBtn.addListener(SWT.Selection, listenerLayer);
Label labelTab = new Label(group,SWT.WRAP);
labelTab.setText("Tab ");
labelTab.setBounds(240, 60, 30, 20);
tabBtn = new Button(group, SWT.RADIO);
tabBtn.setBounds(280, 60, 30, 20);
Listener listenerTab = new Listener() {
public void handleEvent(Event event) {
if (event.widget == tabBtn) {
canFinish = true;
}
}
};
tabBtn.addListener(SWT.Selection, listenerTab);
Label labelSelectBOM = new Label(composite,SWT.WRAP);
labelSelectBOM.setText("Domain Object :");
labelSelectBOM.setBounds(0, 180, 120, 20);
bomField = new Text(composite, SWT.SINGLE | SWT.BORDER);
bomField.setBounds(140, 180, 200, 20);
final Button btnSelectBOM = new Button(composite, SWT.NONE);
btnSelectBOM.setText("Browse...");
btnSelectBOM.setBounds(350, 180, 90, 20);
Listener listener = new Listener() {
public void handleEvent(Event event) {
if (event.widget == btnSelectBOM) {
selectedPath = DomainObjectUtils.selectDomainObject(new Shell(), containerFullPath);
bomField.setText(selectedPath.getText());
NewWidgetWizard nmw = (NewWidgetWizard) getWizard();
setPageComplete(true);
nmw.setSelectedPath(selectedPath);
}
}
};
btnSelectBOM.addListener(SWT.Selection, listener);
setControl(composite);
} |
Partager