Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 95833 Details for
Bug 226732
[GlobalActions] WorkbenchActionBuilder should use CommandContributionItems
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Action Builder v01
actionBuilder-v01.txt (text/plain), 14.17 KB, created by
Paul Webster
on 2008-04-13 10:28:07 EDT
(
hide
)
Description:
Action Builder v01
Filename:
MIME Type:
Creator:
Paul Webster
Created:
2008-04-13 10:28:07 EDT
Size:
14.17 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.ide >Index: src/org/eclipse/ui/internal/ide/WorkbenchActionBuilder.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/WorkbenchActionBuilder.java,v >retrieving revision 1.108 >diff -u -r1.108 WorkbenchActionBuilder.java >--- src/org/eclipse/ui/internal/ide/WorkbenchActionBuilder.java 25 Mar 2008 14:46:05 -0000 1.108 >+++ src/org/eclipse/ui/internal/ide/WorkbenchActionBuilder.java 13 Apr 2008 14:26:54 -0000 >@@ -37,6 +37,7 @@ > import org.eclipse.swt.SWT; > import org.eclipse.swt.widgets.Shell; > import org.eclipse.ui.IPageListener; >+import org.eclipse.ui.ISharedImages; > import org.eclipse.ui.IWorkbenchActionConstants; > import org.eclipse.ui.IWorkbenchPage; > import org.eclipse.ui.IWorkbenchWindow; >@@ -50,12 +51,16 @@ > import org.eclipse.ui.ide.IDEActionFactory; > import org.eclipse.ui.ide.IIDEActionConstants; > import org.eclipse.ui.internal.IPreferenceConstants; >+import org.eclipse.ui.internal.IWorkbenchHelpContextIds; >+import org.eclipse.ui.internal.WorkbenchMessages; > import org.eclipse.ui.internal.WorkbenchPlugin; > import org.eclipse.ui.internal.ide.actions.BuildSetMenu; > import org.eclipse.ui.internal.ide.actions.BuildUtilities; > import org.eclipse.ui.internal.ide.actions.QuickMenuAction; > import org.eclipse.ui.internal.ide.actions.RetargetActionWithDefault; > import org.eclipse.ui.internal.provisional.application.IActionBarConfigurer2; >+import org.eclipse.ui.menus.CommandContributionItem; >+import org.eclipse.ui.menus.CommandContributionItemParameter; > import org.eclipse.ui.menus.IMenuService; > > /** >@@ -144,31 +149,32 @@ > > private IWorkbenchAction redoAction; > >- private IWorkbenchAction cutAction; >+ private CommandContributionItem cutItem; > >- private IWorkbenchAction copyAction; >+ private CommandContributionItem copyItem; > >- private IWorkbenchAction pasteAction; >+ private CommandContributionItem pasteItem; > >- private IWorkbenchAction deleteAction; >+ private CommandContributionItem deleteItem; > >- private IWorkbenchAction selectAllAction; >+ private CommandContributionItem selectAllItem; > >- private IWorkbenchAction findAction; >+ private CommandContributionItem findItem; > >- private IWorkbenchAction printAction; >+ private CommandContributionItem printMenuItem; >+ private CommandContributionItem printToolItem; > >- private IWorkbenchAction revertAction; >+ private CommandContributionItem revertItem; > >- private IWorkbenchAction refreshAction; >+ private CommandContributionItem refreshItem; > >- private IWorkbenchAction propertiesAction; >+ private CommandContributionItem propertiesItem; > > private IWorkbenchAction quitAction; > >- private IWorkbenchAction moveAction; >+ private CommandContributionItem moveItem; > >- private IWorkbenchAction renameAction; >+ private CommandContributionItem renameItem; > > private IWorkbenchAction goIntoAction; > >@@ -389,7 +395,7 @@ > fileToolBar.add(saveAction); > fileToolBar > .add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT)); >- fileToolBar.add(printAction); >+ fileToolBar.add(printToolItem); > fileToolBar > .add(new GroupMarker(IWorkbenchActionConstants.PRINT_EXT)); > >@@ -484,15 +490,15 @@ > menu.add(saveAction); > menu.add(saveAsAction); > menu.add(saveAllAction); >- menu.add(revertAction); >+ menu.add(revertItem); > menu.add(new Separator()); >- menu.add(moveAction); >- menu.add(renameAction); >- menu.add(refreshAction); >+ menu.add(moveItem); >+ menu.add(renameItem); >+ menu.add(refreshItem); > > menu.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT)); > menu.add(new Separator()); >- menu.add(printAction); >+ menu.add(printMenuItem); > menu.add(new GroupMarker(IWorkbenchActionConstants.PRINT_EXT)); > menu.add(new Separator()); > menu.add(openWorkspaceAction); >@@ -504,7 +510,7 @@ > menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); > > menu.add(new Separator()); >- menu.add(propertiesAction); >+ menu.add(propertiesItem); > > menu.add(ContributionItemFactory.REOPEN_EDITORS.create(getWindow())); > menu.add(new GroupMarker(IWorkbenchActionConstants.MRU)); >@@ -534,17 +540,17 @@ > menu.add(new GroupMarker(IWorkbenchActionConstants.UNDO_EXT)); > menu.add(new Separator()); > >- menu.add(cutAction); >- menu.add(copyAction); >- menu.add(pasteAction); >+ menu.add(cutItem); >+ menu.add(copyItem); >+ menu.add(pasteItem); > menu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT)); > menu.add(new Separator()); > >- menu.add(deleteAction); >- menu.add(selectAllAction); >+ menu.add(deleteItem); >+ menu.add(selectAllItem); > menu.add(new Separator()); > >- menu.add(findAction); >+ menu.add(findItem); > menu.add(new GroupMarker(IWorkbenchActionConstants.FIND_EXT)); > menu.add(new Separator()); > >@@ -861,19 +867,20 @@ > forwardHistoryAction = null; > undoAction = null; > redoAction = null; >- cutAction = null; >- copyAction = null; >- pasteAction = null; >- deleteAction = null; >- selectAllAction = null; >- findAction = null; >- printAction = null; >- revertAction = null; >- refreshAction = null; >- propertiesAction = null; >+ cutItem = null; >+ copyItem = null; >+ pasteItem = null; >+ deleteItem = null; >+ selectAllItem = null; >+ findItem = null; >+ printMenuItem = null; >+ printToolItem = null; >+ revertItem = null; >+ refreshItem = null; >+ propertiesItem = null; > quitAction = null; >- moveAction = null; >- renameAction = null; >+ moveItem = null; >+ renameItem = null; > goIntoAction = null; > backAction = null; > forwardAction = null; >@@ -954,6 +961,7 @@ > * Creates actions (and contribution items) for the menu bar, toolbar and status line. > */ > protected void makeActions(final IWorkbenchWindow window) { >+ ISharedImages sharedImages = window.getWorkbench().getSharedImages(); > > // @issue should obtain from ConfigurationItemFactory > statusLineItem = new StatusLineContributionItem("ModeContributionItem"); //$NON-NLS-1$ >@@ -1003,23 +1011,82 @@ > redoAction = ActionFactory.REDO.create(window); > register(redoAction); > >- cutAction = ActionFactory.CUT.create(window); >- register(cutAction); >- >- copyAction = ActionFactory.COPY.create(window); >- register(copyAction); >- >- pasteAction = ActionFactory.PASTE.create(window); >- register(pasteAction); >- >- printAction = ActionFactory.PRINT.create(window); >- register(printAction); >- >- selectAllAction = ActionFactory.SELECT_ALL.create(window); >- register(selectAllAction); >- >- findAction = ActionFactory.FIND.create(window); >- register(findAction); >+ CommandContributionItemParameter cutParm = new CommandContributionItemParameter( >+ window, >+ ActionFactory.CUT.getId(), >+ "org.eclipse.ui.edit.cut", //$NON-NLS-1$ >+ null, >+ sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_CUT), >+ sharedImages >+ .getImageDescriptor(ISharedImages.IMG_TOOL_CUT_DISABLED), >+ null, WorkbenchMessages.Workbench_cut, null, >+ WorkbenchMessages.Workbench_cutToolTip, >+ CommandContributionItem.STYLE_PUSH, null, false); >+ cutItem = new CommandContributionItem(cutParm); >+ >+ CommandContributionItemParameter copyParm = new CommandContributionItemParameter( >+ window, >+ ActionFactory.COPY.getId(), >+ "org.eclipse.ui.edit.copy", //$NON-NLS-1$ >+ null, >+ sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY), >+ sharedImages >+ .getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED), >+ null, WorkbenchMessages.Workbench_copy, null, >+ WorkbenchMessages.Workbench_copyToolTip, >+ CommandContributionItem.STYLE_PUSH, null, false); >+ copyItem = new CommandContributionItem(copyParm); >+ >+ CommandContributionItemParameter pasteParm = new CommandContributionItemParameter( >+ window, >+ ActionFactory.PASTE.getId(), >+ "org.eclipse.ui.edit.paste", //$NON-NLS-1$ >+ null, >+ sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE), >+ sharedImages >+ .getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED), >+ null, WorkbenchMessages.Workbench_paste, null, >+ WorkbenchMessages.Workbench_pasteToolTip, >+ CommandContributionItem.STYLE_PUSH, null, false); >+ pasteItem = new CommandContributionItem(pasteParm); >+ >+ CommandContributionItemParameter printParm = new CommandContributionItemParameter( >+ window, >+ ActionFactory.PRINT.getId(), >+ "org.eclipse.ui.file.print", //$NON-NLS-1$ >+ null, >+ sharedImages.getImageDescriptor(ISharedImages.IMG_ETOOL_PRINT_EDIT), >+ sharedImages >+ .getImageDescriptor(ISharedImages.IMG_ETOOL_PRINT_EDIT_DISABLED), >+ null, WorkbenchMessages.Workbench_print, null, >+ WorkbenchMessages.Workbench_printToolTip, >+ CommandContributionItem.STYLE_PUSH, null, false); >+ printMenuItem = new CommandContributionItem(printParm); >+ printToolItem = new CommandContributionItem(printParm); >+ >+ CommandContributionItemParameter selectAllParm = new CommandContributionItemParameter( >+ window, >+ ActionFactory.SELECT_ALL.getId(), >+ "org.eclipse.ui.edit.selectAll", //$NON-NLS-1$ >+ null, >+ null, >+ null, >+ null, WorkbenchMessages.Workbench_selectAll, null, >+ WorkbenchMessages.Workbench_selectAllToolTip, >+ CommandContributionItem.STYLE_PUSH, null, false); >+ selectAllItem = new CommandContributionItem(selectAllParm); >+ >+ CommandContributionItemParameter findParm = new CommandContributionItemParameter( >+ window, >+ ActionFactory.FIND.getId(), >+ "org.eclipse.ui.edit.findReplace", //$NON-NLS-1$ >+ null, >+ null, >+ null, >+ null, WorkbenchMessages.Workbench_findReplace, null, >+ WorkbenchMessages.Workbench_findReplaceToolTip, >+ CommandContributionItem.STYLE_PUSH, null, false); >+ findItem = new CommandContributionItem(findParm); > > closeAction = ActionFactory.CLOSE.create(window); > register(closeAction); >@@ -1057,8 +1124,19 @@ > addTaskAction = IDEActionFactory.ADD_TASK.create(window); > register(addTaskAction); > >- deleteAction = ActionFactory.DELETE.create(window); >- register(deleteAction); >+ CommandContributionItemParameter deleteParm = new CommandContributionItemParameter( >+ window, >+ ActionFactory.DELETE.getId(), >+ "org.eclipse.ui.edit.delete", //$NON-NLS-1$ >+ null, >+ sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE), >+ sharedImages >+ .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED), >+ null, WorkbenchMessages.Workbench_delete, null, >+ WorkbenchMessages.Workbench_deleteToolTip, >+ CommandContributionItem.STYLE_PUSH, >+ IWorkbenchHelpContextIds.DELETE_RETARGET_ACTION, false); >+ deleteItem = new CommandContributionItem(deleteParm); > > makeFeatureDependentActions(window); > >@@ -1139,23 +1217,68 @@ > .create(window); > register(backwardHistoryAction); > >- revertAction = ActionFactory.REVERT.create(window); >- register(revertAction); >- >- refreshAction = ActionFactory.REFRESH.create(window); >- register(refreshAction); >- >- propertiesAction = ActionFactory.PROPERTIES.create(window); >- register(propertiesAction); >+ CommandContributionItemParameter revertParm = new CommandContributionItemParameter( >+ window, >+ ActionFactory.REVERT.getId(), >+ "org.eclipse.ui.file.revert", //$NON-NLS-1$ >+ null, >+ null, >+ null, >+ null, WorkbenchMessages.Workbench_revert, null, >+ WorkbenchMessages.Workbench_revertToolTip, >+ CommandContributionItem.STYLE_PUSH, null, false); >+ revertItem = new CommandContributionItem(revertParm); >+ >+ CommandContributionItemParameter refreshParm = new CommandContributionItemParameter( >+ window, >+ ActionFactory.REFRESH.getId(), >+ "org.eclipse.ui.file.refresh", //$NON-NLS-1$ >+ null, >+ null, >+ null, >+ null, WorkbenchMessages.Workbench_refresh, null, >+ WorkbenchMessages.Workbench_refreshToolTip, >+ CommandContributionItem.STYLE_PUSH, null, false); >+ refreshItem = new CommandContributionItem(refreshParm); >+ >+ CommandContributionItemParameter propertiesParm = new CommandContributionItemParameter( >+ window, >+ ActionFactory.PROPERTIES.getId(), >+ "org.eclipse.ui.file.properties", //$NON-NLS-1$ >+ null, >+ null, >+ null, >+ null, WorkbenchMessages.Workbench_properties, null, >+ WorkbenchMessages.Workbench_propertiesToolTip, >+ CommandContributionItem.STYLE_PUSH, null, false); >+ propertiesItem = new CommandContributionItem(propertiesParm); > > quitAction = ActionFactory.QUIT.create(window); > register(quitAction); > >- moveAction = ActionFactory.MOVE.create(window); >- register(moveAction); >- >- renameAction = ActionFactory.RENAME.create(window); >- register(renameAction); >+ CommandContributionItemParameter moveParm = new CommandContributionItemParameter( >+ window, >+ ActionFactory.MOVE.getId(), >+ "org.eclipse.ui.edit.move", //$NON-NLS-1$ >+ null, >+ null, >+ null, >+ null, WorkbenchMessages.Workbench_move, null, >+ WorkbenchMessages.Workbench_moveToolTip, >+ CommandContributionItem.STYLE_PUSH, null, false); >+ moveItem = new CommandContributionItem(moveParm); >+ >+ CommandContributionItemParameter renameParm = new CommandContributionItemParameter( >+ window, >+ ActionFactory.RENAME.getId(), >+ "org.eclipse.ui.edit.rename", //$NON-NLS-1$ >+ null, >+ null, >+ null, >+ null, WorkbenchMessages.Workbench_rename, null, >+ WorkbenchMessages.Workbench_renameToolTip, >+ CommandContributionItem.STYLE_PUSH, null, false); >+ renameItem = new CommandContributionItem(renameParm); > > goIntoAction = ActionFactory.GO_INTO.create(window); > register(goIntoAction);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 226732
:
95833
|
95836
|
95838