Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 226732 | Differences between
and this patch

Collapse All | Expand All

(-)Eclipse UI Tests/org/eclipse/ui/tests/api/IActionBarsTest.java (-59 / +76 lines)
Lines 10-15 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.ui.tests.api;
11
package org.eclipse.ui.tests.api;
12
12
13
import org.eclipse.core.commands.NotEnabledException;
13
import org.eclipse.jface.action.Action;
14
import org.eclipse.jface.action.Action;
14
import org.eclipse.jface.action.IMenuManager;
15
import org.eclipse.jface.action.IMenuManager;
15
import org.eclipse.jface.action.IStatusLineManager;
16
import org.eclipse.jface.action.IStatusLineManager;
Lines 19-24 Link Here
19
import org.eclipse.ui.IWorkbenchActionConstants;
20
import org.eclipse.ui.IWorkbenchActionConstants;
20
import org.eclipse.ui.IWorkbenchPage;
21
import org.eclipse.ui.IWorkbenchPage;
21
import org.eclipse.ui.IWorkbenchWindow;
22
import org.eclipse.ui.IWorkbenchWindow;
23
import org.eclipse.ui.actions.ActionFactory;
24
import org.eclipse.ui.handlers.IHandlerService;
25
import org.eclipse.ui.internal.handlers.IActionCommandMappingService;
22
import org.eclipse.ui.tests.harness.util.ActionUtil;
26
import org.eclipse.ui.tests.harness.util.ActionUtil;
23
import org.eclipse.ui.tests.harness.util.UITestCase;
27
import org.eclipse.ui.tests.harness.util.UITestCase;
24
28
Lines 119-183 Link Here
119
                .getGlobalActionHandler(IWorkbenchActionConstants.UNDO));
123
                .getGlobalActionHandler(IWorkbenchActionConstants.UNDO));
120
    }
124
    }
121
125
122
    public void testSetGlobalActionHandler() throws Throwable {
126
        public void testSetGlobalActionHandler() throws Throwable {
123
        // From Javadoc: "Returns the global action handler for 
127
	        // From Javadoc: "Returns the global action handler for 
124
        // the action with the given id.  
128
	        // the action with the given id.  
125
129
	
126
        IViewPart part = fPage.showView(MockViewPart.ID);
130
	        IViewPart part = fPage.showView(MockViewPart.ID);
127
        IActionBars bars = part.getViewSite().getActionBars();
131
	        IActionBars bars = part.getViewSite().getActionBars();
128
        assertNotNull(bars);
132
	        assertNotNull(bars);
129
133
	
130
        // Create actions.
134
	        // Create actions.
131
        MockAction cut = new MockAction();
135
	        MockAction cut = new MockAction();
132
        MockAction copy = new MockAction();
136
	        MockAction copy = new MockAction();
133
        MockAction undo = new MockAction();
137
	        MockAction undo = new MockAction();
134
138
	
135
        // Set actions.
139
	        // Set actions.
136
        bars.setGlobalActionHandler(IWorkbenchActionConstants.CUT, cut);
140
	        bars.setGlobalActionHandler(IWorkbenchActionConstants.CUT, cut);
137
        bars.setGlobalActionHandler(IWorkbenchActionConstants.COPY, copy);
141
	        bars.setGlobalActionHandler(IWorkbenchActionConstants.COPY, copy);
138
        bars.setGlobalActionHandler(IWorkbenchActionConstants.UNDO, undo);
142
	        bars.setGlobalActionHandler(IWorkbenchActionConstants.UNDO, undo);
139
        bars.updateActionBars();
143
	        bars.updateActionBars();
140
144
	
141
        // Run the real workbench actions.
145
	        // Run the real workbench actions.
142
        // Verify the actions are invoked.
146
	        // Verify the actions are invoked.
143
        cut.hasRun = copy.hasRun = undo.hasRun = false;
147
	        cut.hasRun = copy.hasRun = undo.hasRun = false;
144
        ActionUtil.runActionUsingPath(this, fWindow,
148
	        
145
                IWorkbenchActionConstants.M_EDIT + '/'
149
	        // anything that has been converted from a RetargetAction in
146
                        + IWorkbenchActionConstants.CUT);
150
	        // WorkbenchActionBuilder must be run as a command
147
        ActionUtil.runActionUsingPath(this, fWindow,
151
	        runMatchingCommand(fWindow, ActionFactory.CUT.getId());
148
                IWorkbenchActionConstants.M_EDIT + '/'
152
	        
149
                        + IWorkbenchActionConstants.UNDO);
153
	        ActionUtil.runActionUsingPath(this, fWindow,
150
        assertTrue(cut.hasRun);
154
	                IWorkbenchActionConstants.M_EDIT + '/'
151
        assertTrue(!copy.hasRun);
155
	                        + IWorkbenchActionConstants.UNDO);
152
        assertTrue(undo.hasRun);
156
	        assertTrue(cut.hasRun);
153
157
	        assertTrue(!copy.hasRun);
154
        // Now create a second view and run the actions again.
158
	        assertTrue(undo.hasRun);
155
        // Our global actions should not be invoked.
159
	
156
        fPage.showView(MockViewPart.ID2);
160
	        // Now create a second view and run the actions again.
157
        cut.hasRun = copy.hasRun = undo.hasRun = false;
161
	        // Our global actions should not be invoked.
158
        ActionUtil.runActionUsingPath(this, fWindow,
162
	        fPage.showView(MockViewPart.ID2);
159
                IWorkbenchActionConstants.M_EDIT + '/'
163
	        cut.hasRun = copy.hasRun = undo.hasRun = false;
160
                        + IWorkbenchActionConstants.CUT);
164
	        runMatchingCommand(fWindow, ActionFactory.CUT.getId());
161
        ActionUtil.runActionUsingPath(this, fWindow,
165
	        ActionUtil.runActionUsingPath(this, fWindow,
162
                IWorkbenchActionConstants.M_EDIT + '/'
166
	                IWorkbenchActionConstants.M_EDIT + '/'
163
                        + IWorkbenchActionConstants.UNDO);
167
	                        + IWorkbenchActionConstants.UNDO);
164
        assertTrue(!cut.hasRun);
168
	        assertTrue(!cut.hasRun);
165
        assertTrue(!copy.hasRun);
169
	        assertTrue(!copy.hasRun);
166
        assertTrue(!undo.hasRun);
170
	        assertTrue(!undo.hasRun);
167
171
	
168
        // Reactivate test view and run actions again.
172
	        // Reactivate test view and run actions again.
169
        // This time our global actions should be invoked.		
173
	        // This time our global actions should be invoked.		
170
        fPage.activate(part);
174
	        fPage.activate(part);
171
        cut.hasRun = copy.hasRun = undo.hasRun = false;
175
	        cut.hasRun = copy.hasRun = undo.hasRun = false;
172
        ActionUtil.runActionUsingPath(this, fWindow,
176
	        runMatchingCommand(fWindow, ActionFactory.CUT.getId());
173
                IWorkbenchActionConstants.M_EDIT + '/'
177
	        ActionUtil.runActionUsingPath(this, fWindow,
174
                        + IWorkbenchActionConstants.CUT);
178
	                IWorkbenchActionConstants.M_EDIT + '/'
175
        ActionUtil.runActionUsingPath(this, fWindow,
179
	                        + IWorkbenchActionConstants.UNDO);
176
                IWorkbenchActionConstants.M_EDIT + '/'
180
	        assertTrue(cut.hasRun);
177
                        + IWorkbenchActionConstants.UNDO);
181
	        assertTrue(!copy.hasRun);
178
        assertTrue(cut.hasRun);
182
	        assertTrue(undo.hasRun);
179
        assertTrue(!copy.hasRun);
183
	    }
180
        assertTrue(undo.hasRun);
184
    
185
    private void runMatchingCommand(IWorkbenchWindow window, String actionId) {
186
    	IHandlerService hs = (IHandlerService) window.getService(IHandlerService.class);
187
    	IActionCommandMappingService ms = (IActionCommandMappingService) window.getService(IActionCommandMappingService.class);
188
    	String commandId = ms.getCommandId(actionId);
189
    	assertNotNull(commandId);
190
    	try {
191
			hs.executeCommand(commandId, null);
192
    	} catch (NotEnabledException e) {
193
    		// this is not a failure, just a condition to be checked by
194
    		// the test
195
		} catch (Exception e) {
196
			fail("Failed to run " + commandId, e);
197
		}
181
    }
198
    }
182
}
199
}
183
200
(-)src/org/eclipse/ui/internal/ide/WorkbenchActionBuilder.java (-69 / +219 lines)
Lines 37-42 Link Here
37
import org.eclipse.swt.SWT;
37
import org.eclipse.swt.SWT;
38
import org.eclipse.swt.widgets.Shell;
38
import org.eclipse.swt.widgets.Shell;
39
import org.eclipse.ui.IPageListener;
39
import org.eclipse.ui.IPageListener;
40
import org.eclipse.ui.ISharedImages;
40
import org.eclipse.ui.IWorkbenchActionConstants;
41
import org.eclipse.ui.IWorkbenchActionConstants;
41
import org.eclipse.ui.IWorkbenchPage;
42
import org.eclipse.ui.IWorkbenchPage;
42
import org.eclipse.ui.IWorkbenchWindow;
43
import org.eclipse.ui.IWorkbenchWindow;
Lines 50-61 Link Here
50
import org.eclipse.ui.ide.IDEActionFactory;
51
import org.eclipse.ui.ide.IDEActionFactory;
51
import org.eclipse.ui.ide.IIDEActionConstants;
52
import org.eclipse.ui.ide.IIDEActionConstants;
52
import org.eclipse.ui.internal.IPreferenceConstants;
53
import org.eclipse.ui.internal.IPreferenceConstants;
54
import org.eclipse.ui.internal.IWorkbenchHelpContextIds;
55
import org.eclipse.ui.internal.WorkbenchMessages;
53
import org.eclipse.ui.internal.WorkbenchPlugin;
56
import org.eclipse.ui.internal.WorkbenchPlugin;
57
import org.eclipse.ui.internal.handlers.IActionCommandMappingService;
54
import org.eclipse.ui.internal.ide.actions.BuildSetMenu;
58
import org.eclipse.ui.internal.ide.actions.BuildSetMenu;
55
import org.eclipse.ui.internal.ide.actions.BuildUtilities;
59
import org.eclipse.ui.internal.ide.actions.BuildUtilities;
56
import org.eclipse.ui.internal.ide.actions.QuickMenuAction;
60
import org.eclipse.ui.internal.ide.actions.QuickMenuAction;
57
import org.eclipse.ui.internal.ide.actions.RetargetActionWithDefault;
61
import org.eclipse.ui.internal.ide.actions.RetargetActionWithDefault;
58
import org.eclipse.ui.internal.provisional.application.IActionBarConfigurer2;
62
import org.eclipse.ui.internal.provisional.application.IActionBarConfigurer2;
63
import org.eclipse.ui.menus.CommandContributionItem;
64
import org.eclipse.ui.menus.CommandContributionItemParameter;
59
import org.eclipse.ui.menus.IMenuService;
65
import org.eclipse.ui.menus.IMenuService;
60
66
61
/**
67
/**
Lines 144-174 Link Here
144
150
145
    private IWorkbenchAction redoAction;
151
    private IWorkbenchAction redoAction;
146
152
147
    private IWorkbenchAction cutAction;
153
    private CommandContributionItem cutItem;
148
154
149
    private IWorkbenchAction copyAction;
155
    private CommandContributionItem copyItem;
150
156
151
    private IWorkbenchAction pasteAction;
157
    private CommandContributionItem pasteItem;
152
158
153
    private IWorkbenchAction deleteAction;
159
    private CommandContributionItem deleteItem;
154
160
155
    private IWorkbenchAction selectAllAction;
161
    private CommandContributionItem selectAllItem;
156
162
157
    private IWorkbenchAction findAction;
163
    private CommandContributionItem findItem;
158
164
159
    private IWorkbenchAction printAction;
165
    private CommandContributionItem printMenuItem;
166
    private CommandContributionItem printToolItem;
160
167
161
    private IWorkbenchAction revertAction;
168
    private CommandContributionItem revertItem;
162
169
163
    private IWorkbenchAction refreshAction;
170
    private CommandContributionItem refreshItem;
164
171
165
    private IWorkbenchAction propertiesAction;
172
    private CommandContributionItem propertiesItem;
166
173
167
    private IWorkbenchAction quitAction;
174
    private IWorkbenchAction quitAction;
168
175
169
    private IWorkbenchAction moveAction;
176
    private CommandContributionItem moveItem;
170
177
171
    private IWorkbenchAction renameAction;
178
    private CommandContributionItem renameItem;
172
179
173
    private IWorkbenchAction goIntoAction;
180
    private IWorkbenchAction goIntoAction;
174
181
Lines 389-395 Link Here
389
            fileToolBar.add(saveAction);
396
            fileToolBar.add(saveAction);
390
            fileToolBar
397
            fileToolBar
391
                    .add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT));
398
                    .add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT));
392
            fileToolBar.add(printAction);
399
            fileToolBar.add(printToolItem);
393
            fileToolBar
400
            fileToolBar
394
                    .add(new GroupMarker(IWorkbenchActionConstants.PRINT_EXT));
401
                    .add(new GroupMarker(IWorkbenchActionConstants.PRINT_EXT));
395
402
Lines 484-498 Link Here
484
        menu.add(saveAction);
491
        menu.add(saveAction);
485
        menu.add(saveAsAction);
492
        menu.add(saveAsAction);
486
        menu.add(saveAllAction);
493
        menu.add(saveAllAction);
487
        menu.add(revertAction);
494
        menu.add(revertItem);
488
        menu.add(new Separator());
495
        menu.add(new Separator());
489
        menu.add(moveAction);
496
        menu.add(moveItem);
490
        menu.add(renameAction);
497
        menu.add(renameItem);
491
        menu.add(refreshAction);
498
        menu.add(refreshItem);
492
499
493
        menu.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT));
500
        menu.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT));
494
        menu.add(new Separator());
501
        menu.add(new Separator());
495
        menu.add(printAction);
502
        menu.add(printMenuItem);
496
        menu.add(new GroupMarker(IWorkbenchActionConstants.PRINT_EXT));
503
        menu.add(new GroupMarker(IWorkbenchActionConstants.PRINT_EXT));
497
        menu.add(new Separator());
504
        menu.add(new Separator());
498
        menu.add(openWorkspaceAction);
505
        menu.add(openWorkspaceAction);
Lines 504-510 Link Here
504
        menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
511
        menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
505
512
506
        menu.add(new Separator());
513
        menu.add(new Separator());
507
        menu.add(propertiesAction);
514
        menu.add(propertiesItem);
508
515
509
        menu.add(ContributionItemFactory.REOPEN_EDITORS.create(getWindow()));
516
        menu.add(ContributionItemFactory.REOPEN_EDITORS.create(getWindow()));
510
        menu.add(new GroupMarker(IWorkbenchActionConstants.MRU));
517
        menu.add(new GroupMarker(IWorkbenchActionConstants.MRU));
Lines 534-550 Link Here
534
        menu.add(new GroupMarker(IWorkbenchActionConstants.UNDO_EXT));
541
        menu.add(new GroupMarker(IWorkbenchActionConstants.UNDO_EXT));
535
        menu.add(new Separator());
542
        menu.add(new Separator());
536
543
537
        menu.add(cutAction);
544
        menu.add(cutItem);
538
        menu.add(copyAction);
545
        menu.add(copyItem);
539
        menu.add(pasteAction);
546
        menu.add(pasteItem);
540
        menu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT));
547
        menu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT));
541
        menu.add(new Separator());
548
        menu.add(new Separator());
542
549
543
        menu.add(deleteAction);
550
        menu.add(deleteItem);
544
        menu.add(selectAllAction);
551
        menu.add(selectAllItem);
545
        menu.add(new Separator());
552
        menu.add(new Separator());
546
553
547
        menu.add(findAction);
554
        menu.add(findItem);
548
        menu.add(new GroupMarker(IWorkbenchActionConstants.FIND_EXT));
555
        menu.add(new GroupMarker(IWorkbenchActionConstants.FIND_EXT));
549
        menu.add(new Separator());
556
        menu.add(new Separator());
550
557
Lines 861-879 Link Here
861
        forwardHistoryAction = null;
868
        forwardHistoryAction = null;
862
        undoAction = null;
869
        undoAction = null;
863
        redoAction = null;
870
        redoAction = null;
864
        cutAction = null;
871
        cutItem = null;
865
        copyAction = null;
872
        copyItem = null;
866
        pasteAction = null;
873
        pasteItem = null;
867
        deleteAction = null;
874
        deleteItem = null;
868
        selectAllAction = null;
875
        selectAllItem = null;
869
        findAction = null;
876
        findItem = null;
870
        printAction = null;
877
        printMenuItem = null;
871
        revertAction = null;
878
        printToolItem = null;
872
        refreshAction = null;
879
        revertItem = null;
873
        propertiesAction = null;
880
        refreshItem = null;
881
        propertiesItem = null;
874
        quitAction = null;
882
        quitAction = null;
875
        moveAction = null;
883
        moveItem = null;
876
        renameAction = null;
884
        renameItem = null;
877
        goIntoAction = null;
885
        goIntoAction = null;
878
        backAction = null;
886
        backAction = null;
879
        forwardAction = null;
887
        forwardAction = null;
Lines 954-959 Link Here
954
     * Creates actions (and contribution items) for the menu bar, toolbar and status line.
962
     * Creates actions (and contribution items) for the menu bar, toolbar and status line.
955
     */
963
     */
956
    protected void makeActions(final IWorkbenchWindow window) {
964
    protected void makeActions(final IWorkbenchWindow window) {
965
    	ISharedImages sharedImages = window.getWorkbench().getSharedImages();
966
    	IActionCommandMappingService acms = (IActionCommandMappingService) window
967
				.getService(IActionCommandMappingService.class);
957
968
958
        // @issue should obtain from ConfigurationItemFactory
969
        // @issue should obtain from ConfigurationItemFactory
959
        statusLineItem = new StatusLineContributionItem("ModeContributionItem"); //$NON-NLS-1$
970
        statusLineItem = new StatusLineContributionItem("ModeContributionItem"); //$NON-NLS-1$
Lines 1003-1025 Link Here
1003
        redoAction = ActionFactory.REDO.create(window);
1014
        redoAction = ActionFactory.REDO.create(window);
1004
        register(redoAction);
1015
        register(redoAction);
1005
1016
1006
        cutAction = ActionFactory.CUT.create(window);
1017
        String cutId = "org.eclipse.ui.edit.cut"; //$NON-NLS-1$
1007
        register(cutAction);
1018
		CommandContributionItemParameter cutParm = new CommandContributionItemParameter(
1008
1019
				window,
1009
        copyAction = ActionFactory.COPY.create(window);
1020
				ActionFactory.CUT.getId(),
1010
        register(copyAction);
1021
				cutId,
1011
1022
				null,
1012
        pasteAction = ActionFactory.PASTE.create(window);
1023
				sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_CUT),
1013
        register(pasteAction);
1024
				sharedImages
1014
1025
						.getImageDescriptor(ISharedImages.IMG_TOOL_CUT_DISABLED),
1015
        printAction = ActionFactory.PRINT.create(window);
1026
				null, WorkbenchMessages.Workbench_cut, null,
1016
        register(printAction);
1027
				WorkbenchMessages.Workbench_cutToolTip,
1017
1028
				CommandContributionItem.STYLE_PUSH, null, false);
1018
        selectAllAction = ActionFactory.SELECT_ALL.create(window);
1029
        cutItem = new CommandContributionItem(cutParm);
1019
        register(selectAllAction);
1030
        acms.map(ActionFactory.CUT.getId(), cutId);
1020
1031
1021
        findAction = ActionFactory.FIND.create(window);
1032
        String copyId = "org.eclipse.ui.edit.copy"; //$NON-NLS-1$
1022
        register(findAction);
1033
        CommandContributionItemParameter copyParm = new CommandContributionItemParameter(
1034
				window,
1035
				ActionFactory.COPY.getId(),
1036
				copyId,
1037
				null,
1038
				sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY),
1039
				sharedImages
1040
						.getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED),
1041
				null, WorkbenchMessages.Workbench_copy, null,
1042
				WorkbenchMessages.Workbench_copyToolTip,
1043
				CommandContributionItem.STYLE_PUSH, null, false);
1044
		copyItem = new CommandContributionItem(copyParm);
1045
		acms.map(ActionFactory.COPY.getId(), copyId);
1046
1047
		String pasteId = "org.eclipse.ui.edit.paste"; //$NON-NLS-1$
1048
		CommandContributionItemParameter pasteParm = new CommandContributionItemParameter(
1049
				window,
1050
				ActionFactory.PASTE.getId(),
1051
				pasteId,
1052
				null,
1053
				sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE),
1054
				sharedImages
1055
						.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED),
1056
				null, WorkbenchMessages.Workbench_paste, null,
1057
				WorkbenchMessages.Workbench_pasteToolTip,
1058
				CommandContributionItem.STYLE_PUSH, null, false);
1059
        pasteItem = new CommandContributionItem(pasteParm);
1060
        acms.map(ActionFactory.PASTE.getId(), pasteId);
1061
1062
        String printId = "org.eclipse.ui.file.print"; //$NON-NLS-1$
1063
		CommandContributionItemParameter printParm = new CommandContributionItemParameter(
1064
				window,
1065
				ActionFactory.PRINT.getId(),
1066
				printId,
1067
				null,
1068
				sharedImages.getImageDescriptor(ISharedImages.IMG_ETOOL_PRINT_EDIT),
1069
				sharedImages
1070
						.getImageDescriptor(ISharedImages.IMG_ETOOL_PRINT_EDIT_DISABLED),
1071
				null, WorkbenchMessages.Workbench_print, null,
1072
				WorkbenchMessages.Workbench_printToolTip,
1073
				CommandContributionItem.STYLE_PUSH, null, false);
1074
        printMenuItem = new CommandContributionItem(printParm);
1075
        printToolItem = new CommandContributionItem(printParm);
1076
        acms.map(ActionFactory.PRINT.getId(), printId);
1077
1078
        String selectId = "org.eclipse.ui.edit.selectAll"; //$NON-NLS-1$
1079
		CommandContributionItemParameter selectAllParm = new CommandContributionItemParameter(
1080
				window,
1081
				ActionFactory.SELECT_ALL.getId(),
1082
				selectId,
1083
				null,
1084
				null,
1085
				null,
1086
				null, WorkbenchMessages.Workbench_selectAll, null,
1087
				WorkbenchMessages.Workbench_selectAllToolTip,
1088
				CommandContributionItem.STYLE_PUSH, null, false);
1089
        selectAllItem = new CommandContributionItem(selectAllParm);
1090
        acms.map(ActionFactory.SELECT_ALL.getId(), selectId);
1091
1092
        String findId = "org.eclipse.ui.edit.findReplace"; //$NON-NLS-1$
1093
		CommandContributionItemParameter findParm = new CommandContributionItemParameter(
1094
				window,
1095
				ActionFactory.FIND.getId(),
1096
				findId,
1097
				null,
1098
				null,
1099
				null,
1100
				null, WorkbenchMessages.Workbench_findReplace, null,
1101
				WorkbenchMessages.Workbench_findReplaceToolTip,
1102
				CommandContributionItem.STYLE_PUSH, null, false);
1103
        findItem = new CommandContributionItem(findParm);
1104
        acms.map(ActionFactory.FIND.getId(), findId);
1023
1105
1024
        closeAction = ActionFactory.CLOSE.create(window);
1106
        closeAction = ActionFactory.CLOSE.create(window);
1025
        register(closeAction);
1107
        register(closeAction);
Lines 1057-1064 Link Here
1057
        addTaskAction = IDEActionFactory.ADD_TASK.create(window);
1139
        addTaskAction = IDEActionFactory.ADD_TASK.create(window);
1058
        register(addTaskAction);
1140
        register(addTaskAction);
1059
1141
1060
        deleteAction = ActionFactory.DELETE.create(window);
1142
        String deleteId = "org.eclipse.ui.edit.delete"; //$NON-NLS-1$
1061
        register(deleteAction);
1143
		CommandContributionItemParameter deleteParm = new CommandContributionItemParameter(
1144
				window,
1145
				ActionFactory.DELETE.getId(),
1146
				deleteId,
1147
				null,
1148
				sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE),
1149
				sharedImages
1150
						.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED),
1151
				null, WorkbenchMessages.Workbench_delete, null,
1152
				WorkbenchMessages.Workbench_deleteToolTip,
1153
				CommandContributionItem.STYLE_PUSH, 
1154
				IWorkbenchHelpContextIds.DELETE_RETARGET_ACTION, false);
1155
        deleteItem = new CommandContributionItem(deleteParm);
1156
        acms.map(ActionFactory.DELETE.getId(), deleteId);
1062
1157
1063
        makeFeatureDependentActions(window);
1158
        makeFeatureDependentActions(window);
1064
1159
Lines 1139-1161 Link Here
1139
                .create(window);
1234
                .create(window);
1140
        register(backwardHistoryAction);
1235
        register(backwardHistoryAction);
1141
1236
1142
        revertAction = ActionFactory.REVERT.create(window);
1237
        String revertId = "org.eclipse.ui.file.revert"; //$NON-NLS-1$
1143
        register(revertAction);
1238
		CommandContributionItemParameter revertParm = new CommandContributionItemParameter(
1144
1239
				window,
1145
        refreshAction = ActionFactory.REFRESH.create(window);
1240
				ActionFactory.REVERT.getId(),
1146
        register(refreshAction);
1241
				revertId,
1147
1242
				null,
1148
        propertiesAction = ActionFactory.PROPERTIES.create(window);
1243
				null,
1149
        register(propertiesAction);
1244
				null,
1245
				null, WorkbenchMessages.Workbench_revert, null,
1246
				WorkbenchMessages.Workbench_revertToolTip,
1247
				CommandContributionItem.STYLE_PUSH, null, false);
1248
        revertItem = new CommandContributionItem(revertParm);
1249
        acms.map(ActionFactory.REVERT.getId(), revertId);
1250
1251
        String refreshId = "org.eclipse.ui.file.refresh"; //$NON-NLS-1$
1252
		CommandContributionItemParameter refreshParm = new CommandContributionItemParameter(
1253
				window,
1254
				ActionFactory.REFRESH.getId(),
1255
				refreshId,
1256
				null,
1257
				null,
1258
				null,
1259
				null, WorkbenchMessages.Workbench_refresh, null,
1260
				WorkbenchMessages.Workbench_refreshToolTip,
1261
				CommandContributionItem.STYLE_PUSH, null, false);
1262
        refreshItem = new CommandContributionItem(refreshParm);
1263
        acms.map(ActionFactory.REFRESH.getId(), refreshId);
1264
1265
        String propId = "org.eclipse.ui.file.properties"; //$NON-NLS-1$
1266
		CommandContributionItemParameter propertiesParm = new CommandContributionItemParameter(
1267
				window,
1268
				ActionFactory.PROPERTIES.getId(),
1269
				propId,
1270
				null,
1271
				null,
1272
				null,
1273
				null, WorkbenchMessages.Workbench_properties, null,
1274
				WorkbenchMessages.Workbench_propertiesToolTip,
1275
				CommandContributionItem.STYLE_PUSH, null, false);
1276
        propertiesItem = new CommandContributionItem(propertiesParm);
1277
        acms.map(ActionFactory.PROPERTIES.getId(), propId);
1150
1278
1151
        quitAction = ActionFactory.QUIT.create(window);
1279
        quitAction = ActionFactory.QUIT.create(window);
1152
        register(quitAction);
1280
        register(quitAction);
1153
1281
1154
        moveAction = ActionFactory.MOVE.create(window);
1282
        String moveId = "org.eclipse.ui.edit.move"; //$NON-NLS-1$
1155
        register(moveAction);
1283
		CommandContributionItemParameter moveParm = new CommandContributionItemParameter(
1156
1284
				window,
1157
        renameAction = ActionFactory.RENAME.create(window);
1285
				ActionFactory.MOVE.getId(),
1158
        register(renameAction);
1286
				moveId,
1287
				null,
1288
				null,
1289
				null,
1290
				null, WorkbenchMessages.Workbench_move, null,
1291
				WorkbenchMessages.Workbench_moveToolTip,
1292
				CommandContributionItem.STYLE_PUSH, null, false);
1293
        moveItem = new CommandContributionItem(moveParm);
1294
        acms.map(ActionFactory.MOVE.getId(), moveId);
1295
1296
        String renameId = "org.eclipse.ui.edit.rename"; //$NON-NLS-1$
1297
		CommandContributionItemParameter renameParm = new CommandContributionItemParameter(
1298
				window,
1299
				ActionFactory.RENAME.getId(),
1300
				renameId,
1301
				null,
1302
				null,
1303
				null,
1304
				null, WorkbenchMessages.Workbench_rename, null,
1305
				WorkbenchMessages.Workbench_renameToolTip,
1306
				CommandContributionItem.STYLE_PUSH, null, false);
1307
        renameItem = new CommandContributionItem(renameParm);
1308
        acms.map(ActionFactory.RENAME.getId(), renameId);
1159
1309
1160
        goIntoAction = ActionFactory.GO_INTO.create(window);
1310
        goIntoAction = ActionFactory.GO_INTO.create(window);
1161
        register(goIntoAction);
1311
        register(goIntoAction);

Return to bug 226732