|
Lines 88-114
Link Here
|
| 88 |
} |
88 |
} |
| 89 |
|
89 |
|
| 90 |
protected Composite createTopLevelComposite(Composite parent) { |
90 |
protected Composite createTopLevelComposite(Composite parent) { |
| 91 |
Composite modulesGroup = new Composite(parent, SWT.NONE); |
|
|
| 92 |
GridLayout layout = new GridLayout(); |
| 93 |
modulesGroup.setLayout(layout); |
| 94 |
setInfopopID(IJ2EEUIContextIds.NEW_EAR_ADD_MODULES_PAGE); |
91 |
setInfopopID(IJ2EEUIContextIds.NEW_EAR_ADD_MODULES_PAGE); |
| 95 |
GridData gridData = new GridData(GridData.FILL_HORIZONTAL); |
|
|
| 96 |
modulesGroup.setLayoutData(gridData); |
| 97 |
createModuleProjectOptions(modulesGroup); |
| 98 |
createButtonsGroup(modulesGroup); |
| 99 |
|
92 |
|
| 100 |
final Composite composite = new Composite(modulesGroup, SWT.NONE); |
93 |
Composite composite = new Composite(parent, SWT.NONE); |
| 101 |
composite.setLayout(new GridLayout(1, false)); |
94 |
composite.setLayout(new GridLayout()); |
| 102 |
|
95 |
composite.setLayoutData(gdhfill()); |
| 103 |
this.contentDirLabel = new Label(composite, SWT.NONE); |
96 |
|
| 104 |
this.contentDirLabel.setText(Resources.contentDirLabel); |
97 |
createModuleProjectOptions(composite); |
| 105 |
this.contentDirLabel.setLayoutData(gdhfill()); |
98 |
createContentDirGroup(composite); |
| 106 |
|
99 |
|
| 107 |
this.contentDir = new Text(composite, SWT.BORDER); |
|
|
| 108 |
this.contentDir.setLayoutData(gdhfill()); |
| 109 |
synchHelper.synchText(contentDir, CONTENT_DIR, null); |
| 110 |
Dialog.applyDialogFont(parent); |
100 |
Dialog.applyDialogFont(parent); |
| 111 |
return modulesGroup; |
101 |
return composite; |
| 112 |
} |
102 |
} |
| 113 |
|
103 |
|
| 114 |
protected int getJ2EEVersion() { |
104 |
protected int getJ2EEVersion() { |
|
Lines 117-130
Link Here
|
| 117 |
} |
107 |
} |
| 118 |
|
108 |
|
| 119 |
/** |
109 |
/** |
| 120 |
* @param modulesGroup |
110 |
* @param parent |
| 121 |
*/ |
111 |
*/ |
| 122 |
private void createModuleProjectOptions(Composite modulesGroup) { |
112 |
private void createModuleProjectOptions(Composite parent) { |
| 123 |
moduleProjectsLabel = new Label(modulesGroup, SWT.NONE); |
113 |
Composite composite = new Composite(parent, SWT.NONE); |
|
|
114 |
composite.setLayout(new GridLayout(2, false)); |
| 115 |
composite.setLayoutData(new GridData(GridData.FILL_BOTH)); |
| 116 |
|
| 117 |
moduleProjectsLabel = new Label(composite, SWT.NONE); |
| 124 |
moduleProjectsLabel.setText(J2EEUIMessages.getResourceString(J2EEUIMessages.J2EE_MODULE_DEPENDENCIES_LABEL)); |
118 |
moduleProjectsLabel.setText(J2EEUIMessages.getResourceString(J2EEUIMessages.J2EE_MODULE_DEPENDENCIES_LABEL)); |
| 125 |
moduleProjectsLabel.setLayoutData(gdhfill()); |
119 |
GridData gd = gdhfill(); |
|
|
120 |
gd.horizontalSpan = 2; |
| 121 |
moduleProjectsLabel.setLayoutData(gd); |
| 126 |
|
122 |
|
| 127 |
moduleProjectsViewer = CheckboxTableViewer.newCheckList(modulesGroup, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); |
123 |
moduleProjectsViewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); |
| 128 |
GridData gData = new GridData(GridData.FILL_BOTH); |
124 |
GridData gData = new GridData(GridData.FILL_BOTH); |
| 129 |
gData.widthHint = 200; |
125 |
gData.widthHint = 200; |
| 130 |
gData.heightHint = 80; |
126 |
gData.heightHint = 80; |
|
Lines 148-153
Link Here
|
| 148 |
moduleProjectsViewer.getTable().setHeaderVisible(false); |
144 |
moduleProjectsViewer.getTable().setHeaderVisible(false); |
| 149 |
moduleProjectsViewer.getTable().setLinesVisible(false); |
145 |
moduleProjectsViewer.getTable().setLinesVisible(false); |
| 150 |
moduleProjectsViewer.setSorter(null); |
146 |
moduleProjectsViewer.setSorter(null); |
|
|
147 |
|
| 148 |
createButtonsGroup(composite); |
| 151 |
} |
149 |
} |
| 152 |
|
150 |
|
| 153 |
/** |
151 |
/** |
|
Lines 214-243
Link Here
|
| 214 |
} |
212 |
} |
| 215 |
|
213 |
|
| 216 |
|
214 |
|
| 217 |
protected void createButtonsGroup(org.eclipse.swt.widgets.Composite parent) { |
215 |
protected void createButtonsGroup(Composite parent) { |
| 218 |
Composite buttonGroup = new Composite(parent, SWT.NONE); |
216 |
Composite buttonGroup = new Composite(parent, SWT.NONE); |
| 219 |
GridLayout layout = new GridLayout(); |
217 |
buttonGroup.setLayout(new GridLayout()); |
| 220 |
layout.numColumns = 4; |
218 |
buttonGroup.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); |
| 221 |
buttonGroup.setLayout(layout); |
219 |
|
| 222 |
buttonGroup.setLayoutData(new GridData(GridData.FILL_BOTH)); |
|
|
| 223 |
selectAllButton = new Button(buttonGroup, SWT.PUSH); |
220 |
selectAllButton = new Button(buttonGroup, SWT.PUSH); |
| 224 |
selectAllButton.setText(J2EEUIMessages.getResourceString(J2EEUIMessages.APP_PROJECT_MODULES_PG_SELECT)); |
221 |
selectAllButton.setText(J2EEUIMessages.getResourceString(J2EEUIMessages.APP_PROJECT_MODULES_PG_SELECT)); |
| 225 |
selectAllButton.addListener(SWT.Selection, this); |
222 |
selectAllButton.addListener(SWT.Selection, this); |
| 226 |
GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); |
223 |
selectAllButton.setLayoutData(gdhfill()); |
| 227 |
gd.widthHint = SWT.DEFAULT; |
224 |
|
| 228 |
selectAllButton.setLayoutData(gd); |
|
|
| 229 |
deselectAllButton = new Button(buttonGroup, SWT.PUSH); |
225 |
deselectAllButton = new Button(buttonGroup, SWT.PUSH); |
| 230 |
deselectAllButton.setText(J2EEUIMessages.getResourceString(J2EEUIMessages.APP_PROJECT_MODULES_PG_DESELECT)); |
226 |
deselectAllButton.setText(J2EEUIMessages.getResourceString(J2EEUIMessages.APP_PROJECT_MODULES_PG_DESELECT)); |
| 231 |
deselectAllButton.addListener(SWT.Selection, this); |
227 |
deselectAllButton.addListener(SWT.Selection, this); |
| 232 |
gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); |
228 |
deselectAllButton.setLayoutData(gdhfill()); |
| 233 |
gd.widthHint = SWT.DEFAULT; |
229 |
|
| 234 |
deselectAllButton.setLayoutData(gd); |
230 |
new Label(buttonGroup, SWT.NONE); // pad |
|
|
231 |
|
| 235 |
newModuleButton = new Button(buttonGroup, SWT.PUSH); |
232 |
newModuleButton = new Button(buttonGroup, SWT.PUSH); |
| 236 |
newModuleButton.setText(J2EEUIMessages.getResourceString(J2EEUIMessages.APP_PROJECT_MODULES_PG_NEW)); |
233 |
newModuleButton.setText(J2EEUIMessages.getResourceString(J2EEUIMessages.APP_PROJECT_MODULES_PG_NEW)); |
| 237 |
newModuleButton.addListener(SWT.Selection, this); |
234 |
newModuleButton.addListener(SWT.Selection, this); |
| 238 |
gd = new GridData(GridData.GRAB_HORIZONTAL); |
235 |
newModuleButton.setLayoutData(gdhfill()); |
| 239 |
gd.minimumWidth = SWT.DEFAULT; |
236 |
} |
| 240 |
newModuleButton.setLayoutData(gd); |
237 |
|
|
|
238 |
private void createContentDirGroup(Composite modulesGroup) { |
| 239 |
final Composite composite = new Composite(modulesGroup, SWT.NONE); |
| 240 |
composite.setLayout(new GridLayout(2, false)); |
| 241 |
composite.setLayoutData(gdhfill()); |
| 242 |
|
| 243 |
this.contentDirLabel = new Label(composite, SWT.NONE); |
| 244 |
this.contentDirLabel.setText(Resources.contentDirLabel); |
| 245 |
this.contentDirLabel.setLayoutData(new GridData()); |
| 246 |
|
| 247 |
this.contentDir = new Text(composite, SWT.BORDER); |
| 248 |
this.contentDir.setLayoutData(gdhfill()); |
| 249 |
|
| 250 |
synchHelper.synchText(contentDir, CONTENT_DIR, null); |
| 241 |
} |
251 |
} |
| 242 |
|
252 |
|
| 243 |
/** |
253 |
/** |