Lines 12-22
Link Here
|
12 |
*******************************************************************************/ |
12 |
*******************************************************************************/ |
13 |
package org.eclipse.wst.sse.ui.internal.actions; |
13 |
package org.eclipse.wst.sse.ui.internal.actions; |
14 |
|
14 |
|
15 |
import java.util.ResourceBundle; |
15 |
//import java.util.ResourceBundle; |
16 |
|
16 |
|
17 |
import org.eclipse.core.runtime.Platform; |
17 |
import org.eclipse.core.runtime.Platform; |
18 |
import org.eclipse.jface.action.GroupMarker; |
18 |
import org.eclipse.jface.action.GroupMarker; |
19 |
import org.eclipse.jface.action.IAction; |
19 |
//import org.eclipse.jface.action.IAction; |
20 |
import org.eclipse.jface.action.IMenuManager; |
20 |
import org.eclipse.jface.action.IMenuManager; |
21 |
import org.eclipse.jface.action.IStatusLineManager; |
21 |
import org.eclipse.jface.action.IStatusLineManager; |
22 |
import org.eclipse.jface.action.IToolBarManager; |
22 |
import org.eclipse.jface.action.IToolBarManager; |
Lines 24-44
Link Here
|
24 |
import org.eclipse.jface.action.Separator; |
24 |
import org.eclipse.jface.action.Separator; |
25 |
import org.eclipse.ui.IActionBars; |
25 |
import org.eclipse.ui.IActionBars; |
26 |
import org.eclipse.ui.IEditorPart; |
26 |
import org.eclipse.ui.IEditorPart; |
27 |
import org.eclipse.ui.IWorkbenchActionConstants; |
27 |
//import org.eclipse.ui.IWorkbenchActionConstants; |
28 |
import org.eclipse.ui.IWorkbenchPage; |
28 |
import org.eclipse.ui.IWorkbenchPage; |
29 |
import org.eclipse.ui.actions.ActionFactory; |
29 |
//import org.eclipse.ui.actions.ActionFactory; |
30 |
import org.eclipse.ui.editors.text.TextEditorActionContributor; |
30 |
import org.eclipse.ui.editors.text.TextEditorActionContributor; |
31 |
import org.eclipse.ui.ide.IDEActionFactory; |
31 |
//import org.eclipse.ui.ide.IDEActionFactory; |
32 |
import org.eclipse.ui.texteditor.ITextEditor; |
32 |
import org.eclipse.ui.texteditor.ITextEditor; |
33 |
import org.eclipse.ui.texteditor.ITextEditorActionConstants; |
33 |
//import org.eclipse.ui.texteditor.ITextEditorActionConstants; |
34 |
import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; |
34 |
//import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; |
35 |
import org.eclipse.ui.texteditor.ITextEditorExtension; |
35 |
//import org.eclipse.ui.texteditor.ITextEditorExtension; |
36 |
import org.eclipse.ui.texteditor.RetargetTextEditorAction; |
36 |
import org.eclipse.ui.texteditor.RetargetTextEditorAction; |
37 |
import org.eclipse.wst.sse.ui.internal.ExtendedEditorActionBuilder; |
37 |
//import org.eclipse.wst.sse.ui.internal.ExtendedEditorActionBuilder; |
38 |
import org.eclipse.wst.sse.ui.internal.GotoAnnotationAction; |
38 |
import org.eclipse.wst.sse.ui.internal.GotoAnnotationAction; |
39 |
import org.eclipse.wst.sse.ui.internal.IExtendedContributor; |
39 |
import org.eclipse.wst.sse.ui.internal.IExtendedContributor; |
40 |
import org.eclipse.wst.sse.ui.internal.ISourceViewerActionBarContributor; |
40 |
import org.eclipse.wst.sse.ui.internal.ISourceViewerActionBarContributor; |
41 |
import org.eclipse.wst.sse.ui.internal.SSEUIMessages; |
41 |
//import org.eclipse.wst.sse.ui.internal.SSEUIMessages; |
42 |
import org.eclipse.wst.sse.ui.internal.ui.OffsetStatusLineContributionItem; |
42 |
import org.eclipse.wst.sse.ui.internal.ui.OffsetStatusLineContributionItem; |
43 |
|
43 |
|
44 |
/** |
44 |
/** |
Lines 85-91
Link Here
|
85 |
public ActionContributor() { |
85 |
public ActionContributor() { |
86 |
super(); |
86 |
super(); |
87 |
|
87 |
|
88 |
ResourceBundle resourceBundle = SSEUIMessages.getResourceBundle(); |
88 |
/* ResourceBundle resourceBundle = SSEUIMessages.getResourceBundle(); |
89 |
|
89 |
|
90 |
fCommandsSeparator = new Separator(); |
90 |
fCommandsSeparator = new Separator(); |
91 |
|
91 |
|
Lines 146-156
Link Here
|
146 |
if (_showDebugStatus) { |
146 |
if (_showDebugStatus) { |
147 |
fDebugStatusOffset = new OffsetStatusLineContributionItem(StructuredTextEditorActionConstants.STATUS_CATEGORY_OFFSET, true, 20); |
147 |
fDebugStatusOffset = new OffsetStatusLineContributionItem(StructuredTextEditorActionConstants.STATUS_CATEGORY_OFFSET, true, 20); |
148 |
} |
148 |
} |
149 |
} |
149 |
*/ } |
150 |
|
150 |
|
151 |
protected void addToMenu(IMenuManager menu) { |
151 |
protected void addToMenu(IMenuManager menu) { |
152 |
// edit commands |
152 |
// edit commands |
153 |
IMenuManager editMenu = menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT); |
153 |
/* IMenuManager editMenu = menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT); |
154 |
if (editMenu != null) { |
154 |
if (editMenu != null) { |
155 |
editMenu.add(fCommandsSeparator); |
155 |
editMenu.add(fCommandsSeparator); |
156 |
editMenu.add(fToggleInsertModeAction); |
156 |
editMenu.add(fToggleInsertModeAction); |
Lines 159-165
Link Here
|
159 |
editMenu.add(fCommandsSeparator); |
159 |
editMenu.add(fCommandsSeparator); |
160 |
editMenu.add(fMenuAdditionsGroupMarker); |
160 |
editMenu.add(fMenuAdditionsGroupMarker); |
161 |
} |
161 |
} |
162 |
|
162 |
|
163 |
// source commands |
163 |
// source commands |
164 |
String sourceMenuLabel = SSEUIMessages.SourceMenu_label; //$NON-NLS-1$ |
164 |
String sourceMenuLabel = SSEUIMessages.SourceMenu_label; //$NON-NLS-1$ |
165 |
String sourceMenuId = "sourceMenuId"; // This is just a menu id. No //$NON-NLS-1$ |
165 |
String sourceMenuId = "sourceMenuId"; // This is just a menu id. No //$NON-NLS-1$ |
Lines 175-181
Link Here
|
175 |
sourceMenu.add(fShiftRight); |
175 |
sourceMenu.add(fShiftRight); |
176 |
sourceMenu.add(fShiftLeft); |
176 |
sourceMenu.add(fShiftLeft); |
177 |
} |
177 |
} |
178 |
} |
178 |
*/ } |
179 |
|
179 |
|
180 |
protected void addToPopupMenu(IMenuManager menu) { |
180 |
protected void addToPopupMenu(IMenuManager menu) { |
181 |
// add nothing |
181 |
// add nothing |
Lines 188-209
Link Here
|
188 |
} |
188 |
} |
189 |
|
189 |
|
190 |
protected void addToToolBar(IToolBarManager toolBarManager) { |
190 |
protected void addToToolBar(IToolBarManager toolBarManager) { |
191 |
toolBarManager.add(fToolbarSeparator); |
191 |
/* toolBarManager.add(fToolbarSeparator); |
192 |
toolBarManager.add(fToolbarAdditionsGroupMarker); |
192 |
toolBarManager.add(fToolbarAdditionsGroupMarker); |
193 |
} |
193 |
*/ } |
194 |
|
194 |
|
195 |
/** |
195 |
/** |
196 |
* @see org.eclipse.ui.part.EditorActionBarContributor#contributeToMenu(IMenuManager) |
196 |
* @see org.eclipse.ui.part.EditorActionBarContributor#contributeToMenu(IMenuManager) |
197 |
*/ |
197 |
*/ |
198 |
public void contributeToMenu(IMenuManager menu) { |
198 |
public void contributeToMenu(IMenuManager menu) { |
199 |
super.contributeToMenu(menu); |
199 |
super.contributeToMenu(menu); |
200 |
|
200 |
/* |
201 |
addToMenu(menu); |
201 |
addToMenu(menu); |
202 |
|
202 |
|
203 |
if (extendedContributor != null) { |
203 |
if (extendedContributor != null) { |
204 |
extendedContributor.contributeToMenu(menu); |
204 |
extendedContributor.contributeToMenu(menu); |
205 |
} |
205 |
} |
206 |
} |
206 |
*/ } |
207 |
|
207 |
|
208 |
/* |
208 |
/* |
209 |
* (non-Javadoc) |
209 |
* (non-Javadoc) |
Lines 212-223
Link Here
|
212 |
*/ |
212 |
*/ |
213 |
public void contributeToPopupMenu(IMenuManager menu) { |
213 |
public void contributeToPopupMenu(IMenuManager menu) { |
214 |
|
214 |
|
215 |
addToPopupMenu(menu); |
215 |
/* addToPopupMenu(menu); |
216 |
|
216 |
|
217 |
if (extendedContributor != null) { |
217 |
if (extendedContributor != null) { |
218 |
extendedContributor.contributeToPopupMenu(menu); |
218 |
extendedContributor.contributeToPopupMenu(menu); |
219 |
} |
219 |
} |
220 |
} |
220 |
*/ } |
221 |
|
221 |
|
222 |
/* |
222 |
/* |
223 |
* (non-Javadoc) |
223 |
* (non-Javadoc) |
Lines 240-251
Link Here
|
240 |
public void contributeToToolBar(IToolBarManager toolBarManager) { |
240 |
public void contributeToToolBar(IToolBarManager toolBarManager) { |
241 |
super.contributeToToolBar(toolBarManager); |
241 |
super.contributeToToolBar(toolBarManager); |
242 |
|
242 |
|
243 |
addToToolBar(toolBarManager); |
243 |
/* addToToolBar(toolBarManager); |
244 |
|
244 |
|
245 |
if (extendedContributor != null) { |
245 |
if (extendedContributor != null) { |
246 |
extendedContributor.contributeToToolBar(toolBarManager); |
246 |
extendedContributor.contributeToToolBar(toolBarManager); |
247 |
} |
247 |
} |
248 |
} |
248 |
*/ } |
249 |
|
249 |
|
250 |
/** |
250 |
/** |
251 |
* @see org.eclipse.ui.part.EditorActionBarContributor#dispose() |
251 |
* @see org.eclipse.ui.part.EditorActionBarContributor#dispose() |
Lines 300-308
Link Here
|
300 |
return; |
300 |
return; |
301 |
super.setActiveEditor(activeEditor); |
301 |
super.setActiveEditor(activeEditor); |
302 |
|
302 |
|
303 |
ITextEditor textEditor = getTextEditor(activeEditor); |
303 |
// ITextEditor textEditor = getTextEditor(activeEditor); |
304 |
|
304 |
|
305 |
IActionBars actionBars = getActionBars(); |
305 |
/* IActionBars actionBars = getActionBars(); |
306 |
if (actionBars != null) { |
306 |
if (actionBars != null) { |
307 |
actionBars.setGlobalActionHandler(ITextEditorActionDefinitionIds.GOTO_NEXT_ANNOTATION, fNextAnnotation); |
307 |
actionBars.setGlobalActionHandler(ITextEditorActionDefinitionIds.GOTO_NEXT_ANNOTATION, fNextAnnotation); |
308 |
actionBars.setGlobalActionHandler(ITextEditorActionDefinitionIds.GOTO_PREVIOUS_ANNOTATION, fPreviousAnnotation); |
308 |
actionBars.setGlobalActionHandler(ITextEditorActionDefinitionIds.GOTO_PREVIOUS_ANNOTATION, fPreviousAnnotation); |
Lines 342-348
Link Here
|
342 |
((ITextEditorExtension) textEditor).setStatusField(fDebugStatusOffset, StructuredTextEditorActionConstants.STATUS_CATEGORY_OFFSET); |
342 |
((ITextEditorExtension) textEditor).setStatusField(fDebugStatusOffset, StructuredTextEditorActionConstants.STATUS_CATEGORY_OFFSET); |
343 |
fDebugStatusOffset.setActiveEditor(textEditor); |
343 |
fDebugStatusOffset.setActiveEditor(textEditor); |
344 |
} |
344 |
} |
345 |
} |
345 |
*/ } |
346 |
|
346 |
|
347 |
/* |
347 |
/* |
348 |
* (non-Javadoc) |
348 |
* (non-Javadoc) |
Lines 350-368
Link Here
|
350 |
* @see org.eclipse.wst.sse.ui.ISourceViewerActionBarContributor#setViewerSpecificContributionsEnabled(boolean) |
350 |
* @see org.eclipse.wst.sse.ui.ISourceViewerActionBarContributor#setViewerSpecificContributionsEnabled(boolean) |
351 |
*/ |
351 |
*/ |
352 |
public void setViewerSpecificContributionsEnabled(boolean enabled) { |
352 |
public void setViewerSpecificContributionsEnabled(boolean enabled) { |
353 |
fShiftRight.setEnabled(enabled); |
353 |
/* fShiftRight.setEnabled(enabled); |
354 |
fShiftLeft.setEnabled(enabled); |
354 |
fShiftLeft.setEnabled(enabled); |
355 |
fNextAnnotation.setEnabled(enabled); |
355 |
fNextAnnotation.setEnabled(enabled); |
356 |
fPreviousAnnotation.setEnabled(enabled); |
356 |
fPreviousAnnotation.setEnabled(enabled); |
357 |
|
357 |
|
358 |
/* |
358 |
|
359 |
* fComment.setEnabled(enabled); fUncomment.setEnabled(enabled); |
359 |
* fComment.setEnabled(enabled); fUncomment.setEnabled(enabled); |
360 |
*/ |
360 |
|
361 |
fToggleComment.setEnabled(enabled); |
361 |
fToggleComment.setEnabled(enabled); |
362 |
fAddBlockComment.setEnabled(enabled); |
362 |
fAddBlockComment.setEnabled(enabled); |
363 |
fRemoveBlockComment.setEnabled(enabled); |
363 |
fRemoveBlockComment.setEnabled(enabled); |
364 |
// convert line delimiters are not source viewer-specific |
364 |
// convert line delimiters are not source viewer-specific |
365 |
} |
365 |
*/ } |
366 |
|
366 |
|
367 |
/* |
367 |
/* |
368 |
* (non-Javadoc) |
368 |
* (non-Javadoc) |
Lines 370-377
Link Here
|
370 |
* @see org.eclipse.wst.sse.ui.extension.IExtendedContributor#updateToolbarActions() |
370 |
* @see org.eclipse.wst.sse.ui.extension.IExtendedContributor#updateToolbarActions() |
371 |
*/ |
371 |
*/ |
372 |
public void updateToolbarActions() { |
372 |
public void updateToolbarActions() { |
373 |
if (extendedContributor != null) { |
373 |
/* if (extendedContributor != null) { |
374 |
extendedContributor.updateToolbarActions(); |
374 |
extendedContributor.updateToolbarActions(); |
375 |
} |
375 |
} |
376 |
} |
376 |
*/ } |
377 |
} |
377 |
} |