|
Lines 12-17
Link Here
|
| 12 |
|
12 |
|
| 13 |
import org.eclipse.core.resources.IProject; |
13 |
import org.eclipse.core.resources.IProject; |
| 14 |
import org.eclipse.core.resources.IncrementalProjectBuilder; |
14 |
import org.eclipse.core.resources.IncrementalProjectBuilder; |
|
|
15 |
import org.eclipse.ui.IWorkbenchCommandConstants; |
| 15 |
import org.eclipse.ui.IWorkbenchWindow; |
16 |
import org.eclipse.ui.IWorkbenchWindow; |
| 16 |
import org.eclipse.ui.actions.ActionFactory; |
17 |
import org.eclipse.ui.actions.ActionFactory; |
| 17 |
import org.eclipse.ui.actions.GlobalBuildAction; |
18 |
import org.eclipse.ui.actions.GlobalBuildAction; |
|
Lines 57-63
Link Here
|
| 57 |
* This action is a {@link RetargetAction} with |
58 |
* This action is a {@link RetargetAction} with |
| 58 |
* id "addTask". This action maintains its enablement state. |
59 |
* id "addTask". This action maintains its enablement state. |
| 59 |
*/ |
60 |
*/ |
| 60 |
public static final ActionFactory ADD_TASK = new ActionFactory("addTask") { //$NON-NLS-1$ |
61 |
public static final ActionFactory ADD_TASK = new ActionFactory("addTask", //$NON-NLS-1$ |
|
|
62 |
IWorkbenchCommandConstants.EDIT_ADDTASK) { |
| 61 |
/* (non-javadoc) method declared on ActionFactory */ |
63 |
/* (non-javadoc) method declared on ActionFactory */ |
| 62 |
public IWorkbenchAction create(IWorkbenchWindow window) { |
64 |
public IWorkbenchAction create(IWorkbenchWindow window) { |
| 63 |
if (window == null) { |
65 |
if (window == null) { |
|
Lines 66-72
Link Here
|
| 66 |
RetargetAction action = new RetargetAction(getId(), IDEWorkbenchMessages.Workbench_addTask); |
68 |
RetargetAction action = new RetargetAction(getId(), IDEWorkbenchMessages.Workbench_addTask); |
| 67 |
action.setToolTipText(IDEWorkbenchMessages.Workbench_addTaskToolTip); |
69 |
action.setToolTipText(IDEWorkbenchMessages.Workbench_addTaskToolTip); |
| 68 |
window.getPartService().addPartListener(action); |
70 |
window.getPartService().addPartListener(action); |
| 69 |
action.setActionDefinitionId("org.eclipse.ui.edit.addTask"); //$NON-NLS-1$ |
71 |
action.setActionDefinitionId(getCommandId()); |
| 70 |
return action; |
72 |
return action; |
| 71 |
} |
73 |
} |
| 72 |
}; |
74 |
}; |
|
Lines 76-82
Link Here
|
| 76 |
* This action is a {@link RetargetAction} with |
78 |
* This action is a {@link RetargetAction} with |
| 77 |
* id "bookmark". This action maintains its enablement state. |
79 |
* id "bookmark". This action maintains its enablement state. |
| 78 |
*/ |
80 |
*/ |
| 79 |
public static final ActionFactory BOOKMARK = new ActionFactory("bookmark") { //$NON-NLS-1$ |
81 |
public static final ActionFactory BOOKMARK = new ActionFactory("bookmark", //$NON-NLS-1$ |
|
|
82 |
IWorkbenchCommandConstants.EDIT_ADDBOOKMARK) { |
| 80 |
/* (non-javadoc) method declared on ActionFactory */ |
83 |
/* (non-javadoc) method declared on ActionFactory */ |
| 81 |
public IWorkbenchAction create(IWorkbenchWindow window) { |
84 |
public IWorkbenchAction create(IWorkbenchWindow window) { |
| 82 |
if (window == null) { |
85 |
if (window == null) { |
|
Lines 85-91
Link Here
|
| 85 |
RetargetAction action = new RetargetAction(getId(), IDEWorkbenchMessages.Workbench_addBookmark); |
88 |
RetargetAction action = new RetargetAction(getId(), IDEWorkbenchMessages.Workbench_addBookmark); |
| 86 |
action.setToolTipText(IDEWorkbenchMessages.Workbench_addBookmarkToolTip); |
89 |
action.setToolTipText(IDEWorkbenchMessages.Workbench_addBookmarkToolTip); |
| 87 |
window.getPartService().addPartListener(action); |
90 |
window.getPartService().addPartListener(action); |
| 88 |
action.setActionDefinitionId("org.eclipse.ui.edit.addBookmark"); //$NON-NLS-1$ |
91 |
action.setActionDefinitionId(getCommandId()); |
| 89 |
return action; |
92 |
return action; |
| 90 |
} |
93 |
} |
| 91 |
}; |
94 |
}; |
|
Lines 94-100
Link Here
|
| 94 |
* IDE-specific workbench action: Incremental build. |
97 |
* IDE-specific workbench action: Incremental build. |
| 95 |
* This action maintains its enablement state. |
98 |
* This action maintains its enablement state. |
| 96 |
*/ |
99 |
*/ |
| 97 |
public static final ActionFactory BUILD = new ActionFactory("build") { //$NON-NLS-1$ |
100 |
public static final ActionFactory BUILD = new ActionFactory("build", //$NON-NLS-1$ |
|
|
101 |
IWorkbenchCommandConstants.PROJECT_BUILDALL) { |
| 98 |
/* (non-javadoc) method declared on ActionFactory */ |
102 |
/* (non-javadoc) method declared on ActionFactory */ |
| 99 |
public IWorkbenchAction create(IWorkbenchWindow window) { |
103 |
public IWorkbenchAction create(IWorkbenchWindow window) { |
| 100 |
if (window == null) { |
104 |
if (window == null) { |
|
Lines 148-154
Link Here
|
| 148 |
* id "buildProject". This action maintains its enablement state. |
152 |
* id "buildProject". This action maintains its enablement state. |
| 149 |
*/ |
153 |
*/ |
| 150 |
public static final ActionFactory BUILD_PROJECT = new ActionFactory( |
154 |
public static final ActionFactory BUILD_PROJECT = new ActionFactory( |
| 151 |
"buildProject") { //$NON-NLS-1$ |
155 |
"buildProject", IWorkbenchCommandConstants.PROJECT_BUILDPROJECT) { //$NON-NLS-1$ |
| 152 |
/* (non-javadoc) method declared on ActionFactory */ |
156 |
/* (non-javadoc) method declared on ActionFactory */ |
| 153 |
public IWorkbenchAction create(IWorkbenchWindow window) { |
157 |
public IWorkbenchAction create(IWorkbenchWindow window) { |
| 154 |
if (window == null) { |
158 |
if (window == null) { |
|
Lines 158-164
Link Here
|
| 158 |
IDEWorkbenchMessages.Workbench_buildProject); |
162 |
IDEWorkbenchMessages.Workbench_buildProject); |
| 159 |
action.setToolTipText(IDEWorkbenchMessages.Workbench_buildProjectToolTip); |
163 |
action.setToolTipText(IDEWorkbenchMessages.Workbench_buildProjectToolTip); |
| 160 |
window.getPartService().addPartListener(action); |
164 |
window.getPartService().addPartListener(action); |
| 161 |
action.setActionDefinitionId("org.eclipse.ui.project.buildProject"); //$NON-NLS-1$ |
165 |
action.setActionDefinitionId(getCommandId()); |
| 162 |
return action; |
166 |
return action; |
| 163 |
} |
167 |
} |
| 164 |
}; |
168 |
}; |
|
Lines 169-175
Link Here
|
| 169 |
* id "closeProject". This action maintains its enablement state. |
173 |
* id "closeProject". This action maintains its enablement state. |
| 170 |
*/ |
174 |
*/ |
| 171 |
public static final ActionFactory CLOSE_PROJECT = new ActionFactory( |
175 |
public static final ActionFactory CLOSE_PROJECT = new ActionFactory( |
| 172 |
"closeProject") { //$NON-NLS-1$ |
176 |
"closeProject", IWorkbenchCommandConstants.PROJECT_CLOSEPROJECT) { //$NON-NLS-1$ |
| 173 |
/* (non-javadoc) method declared on ActionFactory */ |
177 |
/* (non-javadoc) method declared on ActionFactory */ |
| 174 |
public IWorkbenchAction create(IWorkbenchWindow window) { |
178 |
public IWorkbenchAction create(IWorkbenchWindow window) { |
| 175 |
if (window == null) { |
179 |
if (window == null) { |
|
Lines 178-184
Link Here
|
| 178 |
RetargetAction action = new RetargetAction(getId(), IDEWorkbenchMessages.CloseResourceAction_text); |
182 |
RetargetAction action = new RetargetAction(getId(), IDEWorkbenchMessages.CloseResourceAction_text); |
| 179 |
action.setToolTipText(IDEWorkbenchMessages.CloseResourceAction_text); |
183 |
action.setToolTipText(IDEWorkbenchMessages.CloseResourceAction_text); |
| 180 |
window.getPartService().addPartListener(action); |
184 |
window.getPartService().addPartListener(action); |
| 181 |
action.setActionDefinitionId("org.eclipse.ui.project.closeProject"); //$NON-NLS-1$ |
185 |
action.setActionDefinitionId(getCommandId()); |
| 182 |
return action; |
186 |
return action; |
| 183 |
} |
187 |
} |
| 184 |
}; |
188 |
}; |
|
Lines 199-205
Link Here
|
| 199 |
* @since 3.2 |
203 |
* @since 3.2 |
| 200 |
*/ |
204 |
*/ |
| 201 |
public static final ActionFactory CLOSE_UNRELATED_PROJECTS = new ActionFactory( |
205 |
public static final ActionFactory CLOSE_UNRELATED_PROJECTS = new ActionFactory( |
| 202 |
"closeUnrelatedProjects") { //$NON-NLS-1$ |
206 |
"closeUnrelatedProjects", IWorkbenchCommandConstants.PROJECT_CLOSEUNRELATEDPROJECTS) { //$NON-NLS-1$ |
| 203 |
/* (non-javadoc) method declared on ActionFactory */ |
207 |
/* (non-javadoc) method declared on ActionFactory */ |
| 204 |
public IWorkbenchAction create(IWorkbenchWindow window) { |
208 |
public IWorkbenchAction create(IWorkbenchWindow window) { |
| 205 |
if (window == null) { |
209 |
if (window == null) { |
|
Lines 208-214
Link Here
|
| 208 |
RetargetAction action = new RetargetAction(getId(), IDEWorkbenchMessages.CloseUnrelatedProjectsAction_text); |
212 |
RetargetAction action = new RetargetAction(getId(), IDEWorkbenchMessages.CloseUnrelatedProjectsAction_text); |
| 209 |
action.setToolTipText(IDEWorkbenchMessages.CloseUnrelatedProjectsAction_toolTip); |
213 |
action.setToolTipText(IDEWorkbenchMessages.CloseUnrelatedProjectsAction_toolTip); |
| 210 |
window.getPartService().addPartListener(action); |
214 |
window.getPartService().addPartListener(action); |
| 211 |
action.setActionDefinitionId("org.eclipse.ui.project.closeUnrelatedProjects"); //$NON-NLS-1$ |
215 |
action.setActionDefinitionId(getCommandId()); |
| 212 |
return action; |
216 |
return action; |
| 213 |
} |
217 |
} |
| 214 |
}; |
218 |
}; |
|
Lines 241-247
Link Here
|
| 241 |
* id "openProject". This action maintains its enablement state. |
245 |
* id "openProject". This action maintains its enablement state. |
| 242 |
*/ |
246 |
*/ |
| 243 |
public static final ActionFactory OPEN_PROJECT = new ActionFactory( |
247 |
public static final ActionFactory OPEN_PROJECT = new ActionFactory( |
| 244 |
"openProject") { //$NON-NLS-1$ |
248 |
"openProject", IWorkbenchCommandConstants.PROJECT_OPENPROJECT) { //$NON-NLS-1$ |
| 245 |
/* (non-javadoc) method declared on ActionFactory */ |
249 |
/* (non-javadoc) method declared on ActionFactory */ |
| 246 |
public IWorkbenchAction create(IWorkbenchWindow window) { |
250 |
public IWorkbenchAction create(IWorkbenchWindow window) { |
| 247 |
if (window == null) { |
251 |
if (window == null) { |
|
Lines 250-256
Link Here
|
| 250 |
RetargetAction action = new RetargetAction(getId(), IDEWorkbenchMessages.OpenResourceAction_text); |
254 |
RetargetAction action = new RetargetAction(getId(), IDEWorkbenchMessages.OpenResourceAction_text); |
| 251 |
action.setToolTipText(IDEWorkbenchMessages.OpenResourceAction_toolTip); |
255 |
action.setToolTipText(IDEWorkbenchMessages.OpenResourceAction_toolTip); |
| 252 |
window.getPartService().addPartListener(action); |
256 |
window.getPartService().addPartListener(action); |
| 253 |
action.setActionDefinitionId("org.eclipse.ui.project.openProject"); //$NON-NLS-1$ |
257 |
action.setActionDefinitionId(getCommandId()); |
| 254 |
return action; |
258 |
return action; |
| 255 |
} |
259 |
} |
| 256 |
}; |
260 |
}; |
|
Lines 356-362
Link Here
|
| 356 |
* This action maintains its enablement state. |
360 |
* This action maintains its enablement state. |
| 357 |
*/ |
361 |
*/ |
| 358 |
public static final ActionFactory TIPS_AND_TRICKS = new ActionFactory( |
362 |
public static final ActionFactory TIPS_AND_TRICKS = new ActionFactory( |
| 359 |
"tipsAndTricks") { //$NON-NLS-1$ |
363 |
"tipsAndTricks", IWorkbenchCommandConstants.HELP_TIPSANDTRICKS) { //$NON-NLS-1$ |
| 360 |
/* (non-javadoc) method declared on ActionFactory */ |
364 |
/* (non-javadoc) method declared on ActionFactory */ |
| 361 |
public IWorkbenchAction create(IWorkbenchWindow window) { |
365 |
public IWorkbenchAction create(IWorkbenchWindow window) { |
| 362 |
if (window == null) { |
366 |
if (window == null) { |