|
Lines 15-20
Link Here
|
| 15 |
import org.eclipse.jface.action.IAction; |
15 |
import org.eclipse.jface.action.IAction; |
| 16 |
import org.eclipse.osgi.util.NLS; |
16 |
import org.eclipse.osgi.util.NLS; |
| 17 |
import org.eclipse.ui.ISharedImages; |
17 |
import org.eclipse.ui.ISharedImages; |
|
|
18 |
import org.eclipse.ui.IWorkbenchCommandConstants; |
| 18 |
import org.eclipse.ui.IWorkbenchWindow; |
19 |
import org.eclipse.ui.IWorkbenchWindow; |
| 19 |
import org.eclipse.ui.internal.CloseAllSavedAction; |
20 |
import org.eclipse.ui.internal.CloseAllSavedAction; |
| 20 |
import org.eclipse.ui.internal.IWorkbenchGraphicConstants; |
21 |
import org.eclipse.ui.internal.IWorkbenchGraphicConstants; |
|
Lines 86-92
Link Here
|
| 86 |
* Workbench action: Displays the About dialog. This action maintains its |
87 |
* Workbench action: Displays the About dialog. This action maintains its |
| 87 |
* enablement state. |
88 |
* enablement state. |
| 88 |
*/ |
89 |
*/ |
| 89 |
public static final ActionFactory ABOUT = new ActionFactory("about") { //$NON-NLS-1$ |
90 |
public static final ActionFactory ABOUT = new ActionFactory("about", //$NON-NLS-1$ |
|
|
91 |
IWorkbenchCommandConstants.HELP_ABOUT) { |
| 90 |
|
92 |
|
| 91 |
/* |
93 |
/* |
| 92 |
* (non-Javadoc) |
94 |
* (non-Javadoc) |
|
Lines 99-105
Link Here
|
| 99 |
} |
101 |
} |
| 100 |
|
102 |
|
| 101 |
WorkbenchCommandAction action = new WorkbenchCommandAction( |
103 |
WorkbenchCommandAction action = new WorkbenchCommandAction( |
| 102 |
"org.eclipse.ui.help.aboutAction", window); //$NON-NLS-1$ |
104 |
getCommandId(), window); |
| 103 |
|
105 |
|
| 104 |
action.setId(getId()); |
106 |
action.setId(getId()); |
| 105 |
IProduct product = Platform.getProduct(); |
107 |
IProduct product = Platform.getProduct(); |
|
Lines 126-132
Link Here
|
| 126 |
* editor. This action maintains its enablement state. |
128 |
* editor. This action maintains its enablement state. |
| 127 |
*/ |
129 |
*/ |
| 128 |
public static final ActionFactory ACTIVATE_EDITOR = new ActionFactory( |
130 |
public static final ActionFactory ACTIVATE_EDITOR = new ActionFactory( |
| 129 |
"activateEditor") {//$NON-NLS-1$ |
131 |
"activateEditor", IWorkbenchCommandConstants.WINDOW_ACTIVATEEDITOR) {//$NON-NLS-1$ |
| 130 |
|
132 |
|
| 131 |
/* (non-Javadoc) |
133 |
/* (non-Javadoc) |
| 132 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
134 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
|
Lines 136-142
Link Here
|
| 136 |
throw new IllegalArgumentException(); |
138 |
throw new IllegalArgumentException(); |
| 137 |
} |
139 |
} |
| 138 |
WorkbenchCommandAction action = new WorkbenchCommandAction( |
140 |
WorkbenchCommandAction action = new WorkbenchCommandAction( |
| 139 |
"org.eclipse.ui.window.activateEditor", window); //$NON-NLS-1$ |
141 |
getCommandId(), window); |
| 140 |
action.setId(getId()); |
142 |
action.setId(getId()); |
| 141 |
action.setText(WorkbenchMessages.ActivateEditorAction_text); |
143 |
action.setText(WorkbenchMessages.ActivateEditorAction_text); |
| 142 |
action |
144 |
action |
|
Lines 150-156
Link Here
|
| 150 |
* {@link RetargetAction} with id "back". This action maintains its |
152 |
* {@link RetargetAction} with id "back". This action maintains its |
| 151 |
* enablement state. |
153 |
* enablement state. |
| 152 |
*/ |
154 |
*/ |
| 153 |
public static final ActionFactory BACK = new ActionFactory("back") {//$NON-NLS-1$ |
155 |
public static final ActionFactory BACK = new ActionFactory("back", //$NON-NLS-1$ |
|
|
156 |
IWorkbenchCommandConstants.NAVIGATE_BACK) { |
| 154 |
/* (non-Javadoc) |
157 |
/* (non-Javadoc) |
| 155 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
158 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
| 156 |
*/ |
159 |
*/ |
|
Lines 161-167
Link Here
|
| 161 |
RetargetAction action = new LabelRetargetAction(getId(), WorkbenchMessages.Workbench_back); |
164 |
RetargetAction action = new LabelRetargetAction(getId(), WorkbenchMessages.Workbench_back); |
| 162 |
action.setToolTipText(WorkbenchMessages.Workbench_backToolTip); |
165 |
action.setToolTipText(WorkbenchMessages.Workbench_backToolTip); |
| 163 |
window.getPartService().addPartListener(action); |
166 |
window.getPartService().addPartListener(action); |
| 164 |
action.setActionDefinitionId("org.eclipse.ui.navigate.back"); //$NON-NLS-1$ |
167 |
action.setActionDefinitionId(getCommandId()); |
| 165 |
return action; |
168 |
return action; |
| 166 |
} |
169 |
} |
| 167 |
}; |
170 |
}; |
|
Lines 171-177
Link Here
|
| 171 |
* history. This action maintains its enablement state. |
174 |
* history. This action maintains its enablement state. |
| 172 |
*/ |
175 |
*/ |
| 173 |
public static final ActionFactory BACKWARD_HISTORY = new ActionFactory( |
176 |
public static final ActionFactory BACKWARD_HISTORY = new ActionFactory( |
| 174 |
"backardHistory") {//$NON-NLS-1$ |
177 |
"backardHistory", IWorkbenchCommandConstants.NAVIGATE_BACKWARDHISTORY) {//$NON-NLS-1$ |
| 175 |
/* (non-Javadoc) |
178 |
/* (non-Javadoc) |
| 176 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
179 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
| 177 |
*/ |
180 |
*/ |
|
Lines 189-195
Link Here
|
| 189 |
* Workbench action (id "close"): Close the active editor. This action |
192 |
* Workbench action (id "close"): Close the active editor. This action |
| 190 |
* maintains its enablement state. |
193 |
* maintains its enablement state. |
| 191 |
*/ |
194 |
*/ |
| 192 |
public static final ActionFactory CLOSE = new ActionFactory("close") {//$NON-NLS-1$ |
195 |
public static final ActionFactory CLOSE = new ActionFactory("close",//$NON-NLS-1$ |
|
|
196 |
IWorkbenchCommandConstants.FILE_CLOSE) { |
| 193 |
/* (non-Javadoc) |
197 |
/* (non-Javadoc) |
| 194 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
198 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
| 195 |
*/ |
199 |
*/ |
|
Lines 197-203
Link Here
|
| 197 |
if (window == null) { |
201 |
if (window == null) { |
| 198 |
throw new IllegalArgumentException(); |
202 |
throw new IllegalArgumentException(); |
| 199 |
} |
203 |
} |
| 200 |
WorkbenchCommandAction action=new WorkbenchCommandAction("org.eclipse.ui.file.close",window); //$NON-NLS-1$ |
204 |
WorkbenchCommandAction action = new WorkbenchCommandAction( |
|
|
205 |
getCommandId(), window); |
| 201 |
action.setId(getId()); |
206 |
action.setId(getId()); |
| 202 |
action.setText(WorkbenchMessages.CloseEditorAction_text); |
207 |
action.setText(WorkbenchMessages.CloseEditorAction_text); |
| 203 |
action.setToolTipText(WorkbenchMessages.CloseEditorAction_toolTip); |
208 |
action.setToolTipText(WorkbenchMessages.CloseEditorAction_toolTip); |
|
Lines 209-215
Link Here
|
| 209 |
* Workbench action (id "closeAll"): Close all open editors. This action |
214 |
* Workbench action (id "closeAll"): Close all open editors. This action |
| 210 |
* maintains its enablement state. |
215 |
* maintains its enablement state. |
| 211 |
*/ |
216 |
*/ |
| 212 |
public static final ActionFactory CLOSE_ALL = new ActionFactory("closeAll") {//$NON-NLS-1$ |
217 |
public static final ActionFactory CLOSE_ALL = new ActionFactory("closeAll",//$NON-NLS-1$ |
|
|
218 |
IWorkbenchCommandConstants.FILE_CLOSEALL) { |
| 213 |
/* (non-Javadoc) |
219 |
/* (non-Javadoc) |
| 214 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
220 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
| 215 |
*/ |
221 |
*/ |
|
Lines 217-223
Link Here
|
| 217 |
if (window == null) { |
223 |
if (window == null) { |
| 218 |
throw new IllegalArgumentException(); |
224 |
throw new IllegalArgumentException(); |
| 219 |
} |
225 |
} |
| 220 |
WorkbenchCommandAction action=new WorkbenchCommandAction("org.eclipse.ui.file.closeAll",window); //$NON-NLS-1$ |
226 |
WorkbenchCommandAction action = new WorkbenchCommandAction( |
|
|
227 |
getCommandId(), window); |
| 221 |
action.setId(getId()); |
228 |
action.setId(getId()); |
| 222 |
action.setText(WorkbenchMessages.CloseAllAction_text); |
229 |
action.setText(WorkbenchMessages.CloseAllAction_text); |
| 223 |
action.setToolTipText(WorkbenchMessages.CloseAllAction_toolTip); |
230 |
action.setToolTipText(WorkbenchMessages.CloseAllAction_toolTip); |
|
Lines 231-237
Link Here
|
| 231 |
* |
238 |
* |
| 232 |
* @since 3.2 |
239 |
* @since 3.2 |
| 233 |
*/ |
240 |
*/ |
| 234 |
public static final ActionFactory CLOSE_OTHERS = new ActionFactory("closeOthers") {//$NON-NLS-1$ |
241 |
public static final ActionFactory CLOSE_OTHERS = new ActionFactory("closeOthers",//$NON-NLS-1$ |
|
|
242 |
IWorkbenchCommandConstants.FILE_CLOSEOTHERS) { |
| 235 |
/* (non-Javadoc) |
243 |
/* (non-Javadoc) |
| 236 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
244 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
| 237 |
*/ |
245 |
*/ |
|
Lines 240-246
Link Here
|
| 240 |
throw new IllegalArgumentException(); |
248 |
throw new IllegalArgumentException(); |
| 241 |
} |
249 |
} |
| 242 |
WorkbenchCommandAction action = new WorkbenchCommandAction( |
250 |
WorkbenchCommandAction action = new WorkbenchCommandAction( |
| 243 |
"org.eclipse.ui.file.closeOthers", window); //$NON-NLS-1$ |
251 |
getCommandId(), window); |
| 244 |
action.setId(getId()); |
252 |
action.setId(getId()); |
| 245 |
action.setText(WorkbenchMessages.CloseOthersAction_text); |
253 |
action.setText(WorkbenchMessages.CloseOthersAction_text); |
| 246 |
action.setToolTipText(WorkbenchMessages.CloseOthersAction_toolTip); |
254 |
action.setToolTipText(WorkbenchMessages.CloseOthersAction_toolTip); |
|
Lines 253-259
Link Here
|
| 253 |
* This action maintains its enablement state. |
261 |
* This action maintains its enablement state. |
| 254 |
*/ |
262 |
*/ |
| 255 |
public static final ActionFactory CLOSE_ALL_PERSPECTIVES = new ActionFactory( |
263 |
public static final ActionFactory CLOSE_ALL_PERSPECTIVES = new ActionFactory( |
| 256 |
"closeAllPerspectives") {//$NON-NLS-1$ |
264 |
"closeAllPerspectives", IWorkbenchCommandConstants.WINDOW_CLOSEALLPERSPECTIVES) {//$NON-NLS-1$ |
| 257 |
/* (non-Javadoc) |
265 |
/* (non-Javadoc) |
| 258 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
266 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
| 259 |
*/ |
267 |
*/ |
|
Lines 261-268
Link Here
|
| 261 |
if (window == null) { |
269 |
if (window == null) { |
| 262 |
throw new IllegalArgumentException(); |
270 |
throw new IllegalArgumentException(); |
| 263 |
} |
271 |
} |
| 264 |
WorkbenchCommandAction action = new WorkbenchCommandAction |
272 |
WorkbenchCommandAction action = new WorkbenchCommandAction( |
| 265 |
("org.eclipse.ui.window.closeAllPerspectives", window); //$NON-NLS-1$ |
273 |
getCommandId(), window); |
| 266 |
|
274 |
|
| 267 |
action.setId(getId()); |
275 |
action.setId(getId()); |
| 268 |
action.setText(WorkbenchMessages.CloseAllPerspectivesAction_text); |
276 |
action.setText(WorkbenchMessages.CloseAllPerspectivesAction_text); |
|
Lines 297-303
Link Here
|
| 297 |
* perspective. This action maintains its enablement state. |
305 |
* perspective. This action maintains its enablement state. |
| 298 |
*/ |
306 |
*/ |
| 299 |
public static final ActionFactory CLOSE_PERSPECTIVE = new ActionFactory( |
307 |
public static final ActionFactory CLOSE_PERSPECTIVE = new ActionFactory( |
| 300 |
"closePerspective") {//$NON-NLS-1$ |
308 |
"closePerspective", IWorkbenchCommandConstants.WINDOW_CLOSEPERSPECTIVE) {//$NON-NLS-1$ |
| 301 |
/* |
309 |
/* |
| 302 |
* (non-Javadoc) |
310 |
* (non-Javadoc) |
| 303 |
* |
311 |
* |
|
Lines 308-314
Link Here
|
| 308 |
throw new IllegalArgumentException(); |
316 |
throw new IllegalArgumentException(); |
| 309 |
} |
317 |
} |
| 310 |
WorkbenchCommandAction action = new WorkbenchCommandAction( |
318 |
WorkbenchCommandAction action = new WorkbenchCommandAction( |
| 311 |
"org.eclipse.ui.window.closePerspective", window); //$NON-NLS-1$ |
319 |
getCommandId(), window); |
| 312 |
|
320 |
|
| 313 |
action.setId(getId()); |
321 |
action.setId(getId()); |
| 314 |
action.setText(WorkbenchMessages. |
322 |
action.setText(WorkbenchMessages. |
|
Lines 332-338
Link Here
|
| 332 |
* } |
340 |
* } |
| 333 |
* </pre> |
341 |
* </pre> |
| 334 |
*/ |
342 |
*/ |
| 335 |
public static final ActionFactory INTRO = new ActionFactory("intro") {//$NON-NLS-1$ |
343 |
public static final ActionFactory INTRO = new ActionFactory("intro", //$NON-NLS-1$ |
|
|
344 |
IWorkbenchCommandConstants.HELP_WELCOME) { |
| 336 |
/* (non-Javadoc) |
345 |
/* (non-Javadoc) |
| 337 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
346 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
| 338 |
*/ |
347 |
*/ |
|
Lines 351-357
Link Here
|
| 351 |
* {@link RetargetAction} with id "copy". This action maintains |
360 |
* {@link RetargetAction} with id "copy". This action maintains |
| 352 |
* its enablement state. |
361 |
* its enablement state. |
| 353 |
*/ |
362 |
*/ |
| 354 |
public static final ActionFactory COPY = new ActionFactory("copy") {//$NON-NLS-1$ |
363 |
public static final ActionFactory COPY = new ActionFactory("copy", //$NON-NLS-1$ |
|
|
364 |
IWorkbenchCommandConstants.EDIT_COPY) { |
| 355 |
|
365 |
|
| 356 |
/* (non-Javadoc) |
366 |
/* (non-Javadoc) |
| 357 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
367 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
|
Lines 363-369
Link Here
|
| 363 |
RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_copy); |
373 |
RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_copy); |
| 364 |
action.setToolTipText(WorkbenchMessages.Workbench_copyToolTip); |
374 |
action.setToolTipText(WorkbenchMessages.Workbench_copyToolTip); |
| 365 |
window.getPartService().addPartListener(action); |
375 |
window.getPartService().addPartListener(action); |
| 366 |
action.setActionDefinitionId("org.eclipse.ui.edit.copy"); //$NON-NLS-1$ |
376 |
action.setActionDefinitionId(getCommandId()); |
| 367 |
ISharedImages sharedImages = window.getWorkbench() |
377 |
ISharedImages sharedImages = window.getWorkbench() |
| 368 |
.getSharedImages(); |
378 |
.getSharedImages(); |
| 369 |
action.setImageDescriptor(sharedImages |
379 |
action.setImageDescriptor(sharedImages |
|
Lines 379-385
Link Here
|
| 379 |
* {@link RetargetAction} with id "cut". This action maintains |
389 |
* {@link RetargetAction} with id "cut". This action maintains |
| 380 |
* its enablement state. |
390 |
* its enablement state. |
| 381 |
*/ |
391 |
*/ |
| 382 |
public static final ActionFactory CUT = new ActionFactory("cut") {//$NON-NLS-1$ |
392 |
public static final ActionFactory CUT = new ActionFactory("cut", //$NON-NLS-1$ |
|
|
393 |
IWorkbenchCommandConstants.EDIT_CUT) { |
| 383 |
|
394 |
|
| 384 |
/* (non-Javadoc) |
395 |
/* (non-Javadoc) |
| 385 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
396 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
|
Lines 391-397
Link Here
|
| 391 |
RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_cut); |
402 |
RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_cut); |
| 392 |
action.setToolTipText(WorkbenchMessages.Workbench_cutToolTip); |
403 |
action.setToolTipText(WorkbenchMessages.Workbench_cutToolTip); |
| 393 |
window.getPartService().addPartListener(action); |
404 |
window.getPartService().addPartListener(action); |
| 394 |
action.setActionDefinitionId("org.eclipse.ui.edit.cut"); //$NON-NLS-1$ |
405 |
action.setActionDefinitionId(getCommandId()); |
| 395 |
ISharedImages sharedImages = window.getWorkbench() |
406 |
ISharedImages sharedImages = window.getWorkbench() |
| 396 |
.getSharedImages(); |
407 |
.getSharedImages(); |
| 397 |
action.setImageDescriptor(sharedImages |
408 |
action.setImageDescriptor(sharedImages |
|
Lines 407-413
Link Here
|
| 407 |
* {@link RetargetAction} with id "delete". This action maintains |
418 |
* {@link RetargetAction} with id "delete". This action maintains |
| 408 |
* its enablement state. |
419 |
* its enablement state. |
| 409 |
*/ |
420 |
*/ |
| 410 |
public static final ActionFactory DELETE = new ActionFactory("delete") {//$NON-NLS-1$ |
421 |
public static final ActionFactory DELETE = new ActionFactory("delete", //$NON-NLS-1$ |
|
|
422 |
IWorkbenchCommandConstants.EDIT_DELETE) { |
| 411 |
|
423 |
|
| 412 |
/* (non-Javadoc) |
424 |
/* (non-Javadoc) |
| 413 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
425 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
|
Lines 419-425
Link Here
|
| 419 |
RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_delete); |
431 |
RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_delete); |
| 420 |
action.setToolTipText(WorkbenchMessages.Workbench_deleteToolTip); |
432 |
action.setToolTipText(WorkbenchMessages.Workbench_deleteToolTip); |
| 421 |
window.getPartService().addPartListener(action); |
433 |
window.getPartService().addPartListener(action); |
| 422 |
action.setActionDefinitionId("org.eclipse.ui.edit.delete"); //$NON-NLS-1$ |
434 |
action.setActionDefinitionId(getCommandId()); |
| 423 |
action.enableAccelerator(false); |
435 |
action.enableAccelerator(false); |
| 424 |
window.getWorkbench().getHelpSystem().setHelp(action, |
436 |
window.getWorkbench().getHelpSystem().setHelp(action, |
| 425 |
IWorkbenchHelpContextIds.DELETE_RETARGET_ACTION); |
437 |
IWorkbenchHelpContextIds.DELETE_RETARGET_ACTION); |
|
Lines 439-445
Link Here
|
| 439 |
* action maintains its enablement state. |
451 |
* action maintains its enablement state. |
| 440 |
*/ |
452 |
*/ |
| 441 |
public static final ActionFactory EDIT_ACTION_SETS = new ActionFactory( |
453 |
public static final ActionFactory EDIT_ACTION_SETS = new ActionFactory( |
| 442 |
"editActionSets") {//$NON-NLS-1$ |
454 |
"editActionSets", IWorkbenchCommandConstants.WINDOW_CUSTOMIZEPERSPECTIVE) {//$NON-NLS-1$ |
| 443 |
|
455 |
|
| 444 |
/* (non-Javadoc) |
456 |
/* (non-Javadoc) |
| 445 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
457 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
|
Lines 448-454
Link Here
|
| 448 |
if (window == null) { |
460 |
if (window == null) { |
| 449 |
throw new IllegalArgumentException(); |
461 |
throw new IllegalArgumentException(); |
| 450 |
} |
462 |
} |
| 451 |
WorkbenchCommandAction action = new WorkbenchCommandAction("org.eclipse.ui.window.customizePerspective", window); //$NON-NLS-1$ |
463 |
WorkbenchCommandAction action = new WorkbenchCommandAction( |
|
|
464 |
getCommandId(), window); |
| 452 |
action.setId(getId()); |
465 |
action.setId(getId()); |
| 453 |
action.setText(WorkbenchMessages.EditActionSetsAction_text); |
466 |
action.setText(WorkbenchMessages.EditActionSetsAction_text); |
| 454 |
action.setToolTipText(WorkbenchMessages.EditActionSetsAction_toolTip); |
467 |
action.setToolTipText(WorkbenchMessages.EditActionSetsAction_toolTip); |
|
Lines 463-469
Link Here
|
| 463 |
* Workbench action (id "export"): Opens the export wizard. This action |
476 |
* Workbench action (id "export"): Opens the export wizard. This action |
| 464 |
* maintains its enablement state. |
477 |
* maintains its enablement state. |
| 465 |
*/ |
478 |
*/ |
| 466 |
public static final ActionFactory EXPORT = new ActionFactory("export") {//$NON-NLS-1$ |
479 |
public static final ActionFactory EXPORT = new ActionFactory("export", //$NON-NLS-1$ |
|
|
480 |
IWorkbenchCommandConstants.FILE_EXPORT) { |
| 467 |
|
481 |
|
| 468 |
/* (non-Javadoc) |
482 |
/* (non-Javadoc) |
| 469 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
483 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
|
Lines 473-479
Link Here
|
| 473 |
throw new IllegalArgumentException(); |
487 |
throw new IllegalArgumentException(); |
| 474 |
} |
488 |
} |
| 475 |
|
489 |
|
| 476 |
WorkbenchCommandAction action = new WorkbenchCommandAction("org.eclipse.ui.file.export", window); //$NON-NLS-1$ |
490 |
WorkbenchCommandAction action = new WorkbenchCommandAction( |
|
|
491 |
getCommandId(), window); |
| 477 |
action.setId(getId()); |
492 |
action.setId(getId()); |
| 478 |
action.setText(WorkbenchMessages.ExportResourcesAction_fileMenuText); |
493 |
action.setText(WorkbenchMessages.ExportResourcesAction_fileMenuText); |
| 479 |
action.setToolTipText(WorkbenchMessages.ExportResourcesAction_toolTip); |
494 |
action.setToolTipText(WorkbenchMessages.ExportResourcesAction_toolTip); |
|
Lines 491-497
Link Here
|
| 491 |
* {@link RetargetAction} with id "find". This action maintains |
506 |
* {@link RetargetAction} with id "find". This action maintains |
| 492 |
* its enablement state. |
507 |
* its enablement state. |
| 493 |
*/ |
508 |
*/ |
| 494 |
public static final ActionFactory FIND = new ActionFactory("find") {//$NON-NLS-1$ |
509 |
public static final ActionFactory FIND = new ActionFactory("find", //$NON-NLS-1$ |
|
|
510 |
IWorkbenchCommandConstants.EDIT_FINDANDREPLACE) { |
| 495 |
|
511 |
|
| 496 |
/* (non-Javadoc) |
512 |
/* (non-Javadoc) |
| 497 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
513 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
|
Lines 503-509
Link Here
|
| 503 |
RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_findReplace); |
519 |
RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_findReplace); |
| 504 |
action.setToolTipText(WorkbenchMessages.Workbench_findReplaceToolTip); |
520 |
action.setToolTipText(WorkbenchMessages.Workbench_findReplaceToolTip); |
| 505 |
window.getPartService().addPartListener(action); |
521 |
window.getPartService().addPartListener(action); |
| 506 |
action.setActionDefinitionId("org.eclipse.ui.edit.findReplace"); //$NON-NLS-1$ |
522 |
action.setActionDefinitionId(getCommandId()); |
| 507 |
// Find's images are commented out due to a conflict with Search. |
523 |
// Find's images are commented out due to a conflict with Search. |
| 508 |
// See bug 16412. |
524 |
// See bug 16412. |
| 509 |
// action.setImageDescriptor(WorkbenchImages.getImageDescriptor(IWorkbenchGraphicConstants.IMG_ETOOL_SEARCH_SRC)); |
525 |
// action.setImageDescriptor(WorkbenchImages.getImageDescriptor(IWorkbenchGraphicConstants.IMG_ETOOL_SEARCH_SRC)); |
|
Lines 517-523
Link Here
|
| 517 |
* {@link RetargetAction} with id "forward". This action |
533 |
* {@link RetargetAction} with id "forward". This action |
| 518 |
* maintains its enablement state. |
534 |
* maintains its enablement state. |
| 519 |
*/ |
535 |
*/ |
| 520 |
public static final ActionFactory FORWARD = new ActionFactory("forward") {//$NON-NLS-1$ |
536 |
public static final ActionFactory FORWARD = new ActionFactory("forward", //$NON-NLS-1$ |
|
|
537 |
IWorkbenchCommandConstants.NAVIGATE_FORWARD) { |
| 521 |
|
538 |
|
| 522 |
/* (non-Javadoc) |
539 |
/* (non-Javadoc) |
| 523 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
540 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
|
Lines 529-535
Link Here
|
| 529 |
RetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_forward); |
546 |
RetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_forward); |
| 530 |
action.setToolTipText(WorkbenchMessages.Workbench_forwardToolTip); |
547 |
action.setToolTipText(WorkbenchMessages.Workbench_forwardToolTip); |
| 531 |
window.getPartService().addPartListener(action); |
548 |
window.getPartService().addPartListener(action); |
| 532 |
action.setActionDefinitionId("org.eclipse.ui.navigate.forward"); //$NON-NLS-1$ |
549 |
action.setActionDefinitionId(getCommandId()); |
| 533 |
return action; |
550 |
return action; |
| 534 |
} |
551 |
} |
| 535 |
}; |
552 |
}; |
|
Lines 539-545
Link Here
|
| 539 |
* history. This action maintains its enablement state. |
556 |
* history. This action maintains its enablement state. |
| 540 |
*/ |
557 |
*/ |
| 541 |
public static final ActionFactory FORWARD_HISTORY = new ActionFactory( |
558 |
public static final ActionFactory FORWARD_HISTORY = new ActionFactory( |
| 542 |
"forwardHistory") {//$NON-NLS-1$ |
559 |
"forwardHistory", IWorkbenchCommandConstants.NAVIGATE_FORWARDHISTORY) {//$NON-NLS-1$ |
| 543 |
|
560 |
|
| 544 |
/* (non-Javadoc) |
561 |
/* (non-Javadoc) |
| 545 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
562 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
|
Lines 559-565
Link Here
|
| 559 |
* {@link RetargetAction} with id "goInto". This action maintains |
576 |
* {@link RetargetAction} with id "goInto". This action maintains |
| 560 |
* its enablement state. |
577 |
* its enablement state. |
| 561 |
*/ |
578 |
*/ |
| 562 |
public static final ActionFactory GO_INTO = new ActionFactory("goInto") {//$NON-NLS-1$ |
579 |
public static final ActionFactory GO_INTO = new ActionFactory("goInto", //$NON-NLS-1$ |
|
|
580 |
IWorkbenchCommandConstants.NAVIGATE_GOINTO) { |
| 563 |
|
581 |
|
| 564 |
/* (non-Javadoc) |
582 |
/* (non-Javadoc) |
| 565 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
583 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
|
Lines 571-577
Link Here
|
| 571 |
RetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_goInto); |
589 |
RetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_goInto); |
| 572 |
action.setToolTipText(WorkbenchMessages.Workbench_goIntoToolTip); |
590 |
action.setToolTipText(WorkbenchMessages.Workbench_goIntoToolTip); |
| 573 |
window.getPartService().addPartListener(action); |
591 |
window.getPartService().addPartListener(action); |
| 574 |
action.setActionDefinitionId("org.eclipse.ui.navigate.goInto"); //$NON-NLS-1$ |
592 |
action.setActionDefinitionId(getCommandId()); |
| 575 |
return action; |
593 |
return action; |
| 576 |
} |
594 |
} |
| 577 |
}; |
595 |
}; |
|
Lines 580-586
Link Here
|
| 580 |
* Workbench action (id "import"): Opens the import wizard. This action |
598 |
* Workbench action (id "import"): Opens the import wizard. This action |
| 581 |
* maintains its enablement state. |
599 |
* maintains its enablement state. |
| 582 |
*/ |
600 |
*/ |
| 583 |
public static final ActionFactory IMPORT = new ActionFactory("import") {//$NON-NLS-1$ |
601 |
public static final ActionFactory IMPORT = new ActionFactory("import", //$NON-NLS-1$ |
|
|
602 |
IWorkbenchCommandConstants.FILE_IMPORT) { |
| 584 |
|
603 |
|
| 585 |
/* (non-Javadoc) |
604 |
/* (non-Javadoc) |
| 586 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
605 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
|
Lines 590-596
Link Here
|
| 590 |
throw new IllegalArgumentException(); |
609 |
throw new IllegalArgumentException(); |
| 591 |
} |
610 |
} |
| 592 |
|
611 |
|
| 593 |
WorkbenchCommandAction action = new WorkbenchCommandAction("org.eclipse.ui.file.import", window); //$NON-NLS-1$ |
612 |
WorkbenchCommandAction action = new WorkbenchCommandAction( |
|
|
613 |
getCommandId(), window); |
| 594 |
action.setId(getId()); |
614 |
action.setId(getId()); |
| 595 |
action.setText(WorkbenchMessages.ImportResourcesAction_text); |
615 |
action.setText(WorkbenchMessages.ImportResourcesAction_text); |
| 596 |
action.setToolTipText(WorkbenchMessages.ImportResourcesAction_toolTip); |
616 |
action.setToolTipText(WorkbenchMessages.ImportResourcesAction_toolTip); |
|
Lines 627-633
Link Here
|
| 627 |
* Workbench action (id "maximize"): Maximize/restore the active part. This |
647 |
* Workbench action (id "maximize"): Maximize/restore the active part. This |
| 628 |
* action maintains its enablement state. |
648 |
* action maintains its enablement state. |
| 629 |
*/ |
649 |
*/ |
| 630 |
public static final ActionFactory MAXIMIZE = new ActionFactory("maximize") {//$NON-NLS-1$ |
650 |
public static final ActionFactory MAXIMIZE = new ActionFactory("maximize", //$NON-NLS-1$ |
|
|
651 |
IWorkbenchCommandConstants.WINDOW_MAXIMIZEACTIVEVIEWOREDITOR) { |
| 631 |
|
652 |
|
| 632 |
/* (non-Javadoc) |
653 |
/* (non-Javadoc) |
| 633 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
654 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
|
Lines 637-643
Link Here
|
| 637 |
throw new IllegalArgumentException(); |
658 |
throw new IllegalArgumentException(); |
| 638 |
} |
659 |
} |
| 639 |
WorkbenchCommandAction action = new WorkbenchCommandAction( |
660 |
WorkbenchCommandAction action = new WorkbenchCommandAction( |
| 640 |
"org.eclipse.ui.window.maximizePart", window); //$NON-NLS-1$ |
661 |
getCommandId(), window); |
| 641 |
action.setId(getId()); |
662 |
action.setId(getId()); |
| 642 |
action.setToolTipText(WorkbenchMessages.MaximizePartAction_toolTip); |
663 |
action.setToolTipText(WorkbenchMessages.MaximizePartAction_toolTip); |
| 643 |
window.getWorkbench().getHelpSystem().setHelp(action, |
664 |
window.getWorkbench().getHelpSystem().setHelp(action, |
|
Lines 653-659
Link Here
|
| 653 |
* |
674 |
* |
| 654 |
* @since 3.1 |
675 |
* @since 3.1 |
| 655 |
*/ |
676 |
*/ |
| 656 |
public static final ActionFactory MINIMIZE = new ActionFactory("minimize") {//$NON-NLS-1$ |
677 |
public static final ActionFactory MINIMIZE = new ActionFactory("minimize", //$NON-NLS-1$ |
|
|
678 |
IWorkbenchCommandConstants.WINDOW_MINIMIZEACTIVEVIEWOREDITOR) { |
| 657 |
|
679 |
|
| 658 |
/* (non-Javadoc) |
680 |
/* (non-Javadoc) |
| 659 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
681 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
|
Lines 663-669
Link Here
|
| 663 |
throw new IllegalArgumentException(); |
685 |
throw new IllegalArgumentException(); |
| 664 |
} |
686 |
} |
| 665 |
WorkbenchCommandAction action = new WorkbenchCommandAction( |
687 |
WorkbenchCommandAction action = new WorkbenchCommandAction( |
| 666 |
"org.eclipse.ui.window.minimizePart", window); //$NON-NLS-1$ |
688 |
getCommandId(), window); |
| 667 |
action.setId(getId()); |
689 |
action.setId(getId()); |
| 668 |
action.setToolTipText(WorkbenchMessages.MinimizePartAction_toolTip); |
690 |
action.setToolTipText(WorkbenchMessages.MinimizePartAction_toolTip); |
| 669 |
window.getWorkbench().getHelpSystem().setHelp(action, |
691 |
window.getWorkbench().getHelpSystem().setHelp(action, |
|
Lines 677-683
Link Here
|
| 677 |
* {@link RetargetAction} with id "move". This action maintains its |
699 |
* {@link RetargetAction} with id "move". This action maintains its |
| 678 |
* enablement state. |
700 |
* enablement state. |
| 679 |
*/ |
701 |
*/ |
| 680 |
public static final ActionFactory MOVE = new ActionFactory("move") {//$NON-NLS-1$ |
702 |
public static final ActionFactory MOVE = new ActionFactory("move", //$NON-NLS-1$ |
|
|
703 |
IWorkbenchCommandConstants.FILE_MOVE) { |
| 681 |
|
704 |
|
| 682 |
/* (non-Javadoc) |
705 |
/* (non-Javadoc) |
| 683 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
706 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
|
Lines 689-695
Link Here
|
| 689 |
RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_move); |
712 |
RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_move); |
| 690 |
action.setToolTipText(WorkbenchMessages.Workbench_moveToolTip); |
713 |
action.setToolTipText(WorkbenchMessages.Workbench_moveToolTip); |
| 691 |
window.getPartService().addPartListener(action); |
714 |
window.getPartService().addPartListener(action); |
| 692 |
action.setActionDefinitionId("org.eclipse.ui.edit.move"); //$NON-NLS-1$ |
715 |
action.setActionDefinitionId(getCommandId()); |
| 693 |
return action; |
716 |
return action; |
| 694 |
} |
717 |
} |
| 695 |
}; |
718 |
}; |
|
Lines 698-704
Link Here
|
| 698 |
* Workbench action (id "new"): Opens the new wizard dialog. This action maintains |
721 |
* Workbench action (id "new"): Opens the new wizard dialog. This action maintains |
| 699 |
* its enablement state. |
722 |
* its enablement state. |
| 700 |
*/ |
723 |
*/ |
| 701 |
public static final ActionFactory NEW = new ActionFactory("new") {//$NON-NLS-1$ |
724 |
public static final ActionFactory NEW = new ActionFactory("new", //$NON-NLS-1$ |
|
|
725 |
IWorkbenchCommandConstants.FILE_NEW) { |
| 702 |
|
726 |
|
| 703 |
/* (non-Javadoc) |
727 |
/* (non-Javadoc) |
| 704 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
728 |
* @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow) |
|
Lines 707-713
Link Here
|
| 707 |
if (window == null) { |
731 |
if (window == null) { |
| 708 |
throw new IllegalArgumentException(); |
732 |
throw new IllegalArgumentException(); |
| 709 |
} |
733 |
} |
| 710 |
WorkbenchCommandAction action = new WorkbenchCommandAction("org.eclipse.ui.newWizard", window); //$NON-NLS-1$ |
734 |
WorkbenchCommandAction action = new WorkbenchCommandAction( |
|
|
735 |
getCommandId(), window); |
| 711 |
action.setId(getId()); |
736 |
action.setId(getId()); |
| 712 |
ISharedImages images = window.getWorkbench().getSharedImages(); |
737 |
ISharedImages images = window.getWorkbench().getSharedImages(); |
| 713 |
action.setImageDescriptor(images |
738 |
action.setImageDescriptor(images |
|
Lines 1701-1706
Link Here
|
| 1701 |
* Id of actions created by this action factory. |
1726 |
* Id of actions created by this action factory. |
| 1702 |
*/ |
1727 |
*/ |
| 1703 |
private final String actionId; |
1728 |
private final String actionId; |
|
|
1729 |
|
| 1730 |
/** |
| 1731 |
* Optional ID for this action. |
| 1732 |
*/ |
| 1733 |
private final String commandId; |
| 1704 |
|
1734 |
|
| 1705 |
/** |
1735 |
/** |
| 1706 |
* Creates a new workbench action factory with the given id. |
1736 |
* Creates a new workbench action factory with the given id. |
|
Lines 1709-1715
Link Here
|
| 1709 |
* the id of actions created by this action factory |
1739 |
* the id of actions created by this action factory |
| 1710 |
*/ |
1740 |
*/ |
| 1711 |
protected ActionFactory(String actionId) { |
1741 |
protected ActionFactory(String actionId) { |
| 1712 |
this.actionId = actionId; |
1742 |
this(actionId, null); |
|
|
1743 |
} |
| 1744 |
|
| 1745 |
/** |
| 1746 |
* Create a new workbench action factory with the given IDs. |
| 1747 |
* |
| 1748 |
* @param actionId |
| 1749 |
* the id of actions created by this action factory |
| 1750 |
* @param commandId |
| 1751 |
* the matching command id |
| 1752 |
* @since 3.5 |
| 1753 |
*/ |
| 1754 |
protected ActionFactory(String actionId, String commandId) { |
| 1755 |
this.actionId = actionId; |
| 1756 |
this.commandId = commandId; |
| 1713 |
} |
1757 |
} |
| 1714 |
|
1758 |
|
| 1715 |
/** |
1759 |
/** |
|
Lines 1741-1744
Link Here
|
| 1741 |
return actionId; |
1785 |
return actionId; |
| 1742 |
} |
1786 |
} |
| 1743 |
|
1787 |
|
|
|
1788 |
/** |
| 1789 |
* Return the command id of this action factory. |
| 1790 |
* |
| 1791 |
* @return the command id of the action created by this action factory. May |
| 1792 |
* be <code>null</code>. |
| 1793 |
* @since 3.5 |
| 1794 |
*/ |
| 1795 |
public String getCommandId() { |
| 1796 |
return commandId; |
| 1797 |
} |
| 1744 |
} |
1798 |
} |