|
Lines 39-44
Link Here
|
| 39 |
private Button closeSelected; |
39 |
private Button closeSelected; |
| 40 |
private Button selectClean; |
40 |
private Button selectClean; |
| 41 |
private Button invertSelection; |
41 |
private Button invertSelection; |
|
|
42 |
private Button allSelection; |
| 42 |
|
43 |
|
| 43 |
private boolean showAllPersp = false; |
44 |
private boolean showAllPersp = false; |
| 44 |
private int sortColumn; |
45 |
private int sortColumn; |
|
Lines 110-122
Link Here
|
| 110 |
* @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite) |
111 |
* @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite) |
| 111 |
*/ |
112 |
*/ |
| 112 |
protected void createButtonsForButtonBar(Composite parent) { |
113 |
protected void createButtonsForButtonBar(Composite parent) { |
| 113 |
super.createButtonsForButtonBar(parent); |
114 |
// Typically we would use the parent's createButtonsForButtonBar. |
| 114 |
|
115 |
// However, we only want a Cancel button and not an OK button. The |
| 115 |
Button button = getButton(IDialogConstants.OK_ID); |
116 |
// OK button will be used later (in createDialogArea) to activate |
| 116 |
if (button != null) |
117 |
// the selected editor. |
| 117 |
button.setText(WorkbenchMessages.getString("WorkbenchEditorsDialog.activate")); //$NON-NLS-1$ |
118 |
createButton( |
| 118 |
|
119 |
parent, |
| 119 |
button = getButton(IDialogConstants.CANCEL_ID); |
120 |
IDialogConstants.CANCEL_ID, |
|
|
121 |
IDialogConstants.CANCEL_LABEL, |
| 122 |
false); |
| 123 |
Button button = getButton(IDialogConstants.CANCEL_ID); |
| 120 |
if (button != null) |
124 |
if (button != null) |
| 121 |
button.setText(WorkbenchMessages.getString("WorkbenchEditorsDialog.close")); //$NON-NLS-1$ |
125 |
button.setText(WorkbenchMessages.getString("WorkbenchEditorsDialog.close")); //$NON-NLS-1$ |
| 122 |
|
126 |
|
|
Lines 189-221
Link Here
|
| 189 |
tc.setResizable(true); |
193 |
tc.setResizable(true); |
| 190 |
tc.setText(WorkbenchMessages.getString("WorkbenchEditorsDialog.path")); //$NON-NLS-1$ |
194 |
tc.setText(WorkbenchMessages.getString("WorkbenchEditorsDialog.path")); //$NON-NLS-1$ |
| 191 |
tc.addSelectionListener(headerListener); |
195 |
tc.addSelectionListener(headerListener); |
| 192 |
//A composite for save editors and close editors buttons |
196 |
|
|
|
197 |
// A composite for selection option buttons |
| 193 |
Composite selectionButtons = new Composite(dialogArea,SWT.NULL); |
198 |
Composite selectionButtons = new Composite(dialogArea,SWT.NULL); |
|
|
199 |
Label compLabel = new Label(selectionButtons,SWT.NULL); |
| 200 |
compLabel.setFont(font); |
| 194 |
GridLayout layout = new GridLayout(); |
201 |
GridLayout layout = new GridLayout(); |
| 195 |
layout.numColumns = 4; |
202 |
layout.numColumns = 4; |
| 196 |
selectionButtons.setLayout(layout); |
203 |
selectionButtons.setLayout(layout); |
| 197 |
//Close editors button |
204 |
|
| 198 |
closeSelected = new Button(selectionButtons,SWT.PUSH); |
|
|
| 199 |
closeSelected.setText(WorkbenchMessages.getString("WorkbenchEditorsDialog.closeSelected")); //$NON-NLS-1$ |
| 200 |
closeSelected.addSelectionListener(new SelectionAdapter() { |
| 201 |
public void widgetSelected(SelectionEvent e) { |
| 202 |
closeItems(editorsTable.getSelection()); |
| 203 |
} |
| 204 |
}); |
| 205 |
closeSelected.setFont(font); |
| 206 |
setButtonLayoutData(closeSelected); |
| 207 |
|
| 208 |
//Save editors button |
| 209 |
saveSelected = new Button(selectionButtons,SWT.PUSH); |
| 210 |
saveSelected.setText(WorkbenchMessages.getString("WorkbenchEditorsDialog.saveSelected")); //$NON-NLS-1$ |
| 211 |
saveSelected.addSelectionListener(new SelectionAdapter() { |
| 212 |
public void widgetSelected(SelectionEvent e) { |
| 213 |
saveItems(editorsTable.getSelection(),null); |
| 214 |
} |
| 215 |
}); |
| 216 |
saveSelected.setFont(font); |
| 217 |
setButtonLayoutData(saveSelected); |
| 218 |
|
| 219 |
//Select clean editors button |
205 |
//Select clean editors button |
| 220 |
selectClean = new Button(selectionButtons,SWT.PUSH); |
206 |
selectClean = new Button(selectionButtons,SWT.PUSH); |
| 221 |
selectClean.setText(WorkbenchMessages.getString("WorkbenchEditorsDialog.selectClean")); //$NON-NLS-1$ |
207 |
selectClean.setText(WorkbenchMessages.getString("WorkbenchEditorsDialog.selectClean")); //$NON-NLS-1$ |
|
Lines 239-245
Link Here
|
| 239 |
}); |
225 |
}); |
| 240 |
invertSelection.setFont(font); |
226 |
invertSelection.setFont(font); |
| 241 |
setButtonLayoutData(invertSelection); |
227 |
setButtonLayoutData(invertSelection); |
|
|
228 |
|
| 229 |
//Select all button |
| 230 |
allSelection = new Button(selectionButtons,SWT.PUSH); |
| 231 |
allSelection.setText(WorkbenchMessages.getString("WorkbenchEditorsDialog.allSelection")); //$NON-NLS-1$ |
| 232 |
allSelection.addSelectionListener(new SelectionAdapter() { |
| 233 |
public void widgetSelected(SelectionEvent e) { |
| 234 |
editorsTable.setSelection(editorsTable.getItems()); |
| 235 |
updateButtons(); |
| 236 |
} |
| 237 |
}); |
| 238 |
allSelection.setFont(font); |
| 239 |
setButtonLayoutData(allSelection); |
| 240 |
|
| 241 |
// A composite for selected editor action buttons |
| 242 |
Composite actionButtons = new Composite(dialogArea,SWT.NULL); |
| 243 |
Label actLabel = new Label(actionButtons,SWT.NULL); |
| 244 |
actLabel.setFont(font); |
| 245 |
GridLayout actLayout = new GridLayout(); |
| 246 |
actLayout.numColumns = 4; |
| 247 |
actionButtons.setLayout(actLayout); |
| 248 |
|
| 249 |
// Activate selected editor button |
| 250 |
createButton( |
| 251 |
actionButtons, |
| 252 |
IDialogConstants.OK_ID, |
| 253 |
WorkbenchMessages.getString("WorkbenchEditorsDialog.activate"), |
| 254 |
true); |
| 242 |
|
255 |
|
|
|
256 |
//Close selected editors button |
| 257 |
closeSelected = new Button(actionButtons,SWT.PUSH); |
| 258 |
closeSelected.setText(WorkbenchMessages.getString("WorkbenchEditorsDialog.closeSelected")); //$NON-NLS-1$ |
| 259 |
closeSelected.addSelectionListener(new SelectionAdapter() { |
| 260 |
public void widgetSelected(SelectionEvent e) { |
| 261 |
closeItems(editorsTable.getSelection()); |
| 262 |
} |
| 263 |
}); |
| 264 |
closeSelected.setFont(font); |
| 265 |
setButtonLayoutData(closeSelected); |
| 266 |
|
| 267 |
//Save selected editors button |
| 268 |
saveSelected = new Button(actionButtons,SWT.PUSH); |
| 269 |
saveSelected.setText(WorkbenchMessages.getString("WorkbenchEditorsDialog.saveSelected")); //$NON-NLS-1$ |
| 270 |
saveSelected.addSelectionListener(new SelectionAdapter() { |
| 271 |
public void widgetSelected(SelectionEvent e) { |
| 272 |
saveItems(editorsTable.getSelection(),null); |
| 273 |
} |
| 274 |
}); |
| 275 |
saveSelected.setFont(font); |
| 276 |
setButtonLayoutData(saveSelected); |
| 277 |
|
| 243 |
//Show only active perspective button |
278 |
//Show only active perspective button |
| 244 |
final Button showAllPerspButton = new Button(dialogArea,SWT.CHECK); |
279 |
final Button showAllPerspButton = new Button(dialogArea,SWT.CHECK); |
| 245 |
showAllPerspButton.setText(WorkbenchMessages.getString("WorkbenchEditorsDialog.showAllPersp")); //$NON-NLS-1$ |
280 |
showAllPerspButton.setText(WorkbenchMessages.getString("WorkbenchEditorsDialog.showAllPersp")); //$NON-NLS-1$ |