|
Lines 47-52
Link Here
|
| 47 |
import org.eclipse.swt.widgets.ScrollBar; |
47 |
import org.eclipse.swt.widgets.ScrollBar; |
| 48 |
import org.eclipse.swt.widgets.Shell; |
48 |
import org.eclipse.swt.widgets.Shell; |
| 49 |
|
49 |
|
|
|
50 |
import org.eclipse.jface.action.IMenuManager; |
| 50 |
import org.eclipse.jface.operation.IRunnableWithProgress; |
51 |
import org.eclipse.jface.operation.IRunnableWithProgress; |
| 51 |
import org.eclipse.jface.preference.IPreferenceStore; |
52 |
import org.eclipse.jface.preference.IPreferenceStore; |
| 52 |
import org.eclipse.jface.resource.JFaceResources; |
53 |
import org.eclipse.jface.resource.JFaceResources; |
|
Lines 61-66
Link Here
|
| 61 |
import org.eclipse.ui.IFileEditorInput; |
62 |
import org.eclipse.ui.IFileEditorInput; |
| 62 |
import org.eclipse.ui.IMemento; |
63 |
import org.eclipse.ui.IMemento; |
| 63 |
import org.eclipse.ui.PlatformUI; |
64 |
import org.eclipse.ui.PlatformUI; |
|
|
65 |
import org.eclipse.ui.actions.ActionContext; |
| 66 |
import org.eclipse.ui.actions.ActionGroup; |
| 64 |
import org.eclipse.ui.texteditor.IDocumentProvider; |
67 |
import org.eclipse.ui.texteditor.IDocumentProvider; |
| 65 |
import org.eclipse.ui.texteditor.ITextEditorActionConstants; |
68 |
import org.eclipse.ui.texteditor.ITextEditorActionConstants; |
| 66 |
|
69 |
|
|
Lines 80-89
Link Here
|
| 80 |
import org.eclipse.jdt.internal.corext.util.JavaModelUtil; |
83 |
import org.eclipse.jdt.internal.corext.util.JavaModelUtil; |
| 81 |
import org.eclipse.jdt.internal.corext.util.Messages; |
84 |
import org.eclipse.jdt.internal.corext.util.Messages; |
| 82 |
|
85 |
|
|
|
86 |
import org.eclipse.jdt.ui.actions.RefactorActionGroup; |
| 83 |
import org.eclipse.jdt.ui.wizards.BuildPathDialogAccess; |
87 |
import org.eclipse.jdt.ui.wizards.BuildPathDialogAccess; |
| 84 |
|
88 |
|
| 85 |
import org.eclipse.jdt.internal.ui.JavaPlugin; |
89 |
import org.eclipse.jdt.internal.ui.JavaPlugin; |
| 86 |
import org.eclipse.jdt.internal.ui.JavaUIStatus; |
90 |
import org.eclipse.jdt.internal.ui.JavaUIStatus; |
|
|
91 |
import org.eclipse.jdt.internal.ui.actions.CompositeActionGroup; |
| 87 |
import org.eclipse.jdt.internal.ui.util.ExceptionHandler; |
92 |
import org.eclipse.jdt.internal.ui.util.ExceptionHandler; |
| 88 |
import org.eclipse.jdt.internal.ui.wizards.buildpaths.SourceAttachmentBlock; |
93 |
import org.eclipse.jdt.internal.ui.wizards.buildpaths.SourceAttachmentBlock; |
| 89 |
|
94 |
|
|
Lines 481-486
Link Here
|
| 481 |
private Control fSourceAttachmentForm; |
486 |
private Control fSourceAttachmentForm; |
| 482 |
|
487 |
|
| 483 |
private InputUpdater fInputUpdater= new InputUpdater(); |
488 |
private InputUpdater fInputUpdater= new InputUpdater(); |
|
|
489 |
private CompositeActionGroup fContextMenuGroup; |
| 484 |
|
490 |
|
| 485 |
/** |
491 |
/** |
| 486 |
* Default constructor. |
492 |
* Default constructor. |
|
Lines 502-507
Link Here
|
| 502 |
|
508 |
|
| 503 |
setAction(ITextEditorActionConstants.SAVE, null); |
509 |
setAction(ITextEditorActionConstants.SAVE, null); |
| 504 |
setAction(ITextEditorActionConstants.REVERT_TO_SAVED, null); |
510 |
setAction(ITextEditorActionConstants.REVERT_TO_SAVED, null); |
|
|
511 |
|
| 512 |
ActionGroup rg= new RefactorActionGroup(this, ITextEditorActionConstants.GROUP_EDIT); |
| 513 |
fActionGroups.addGroup(rg); |
| 514 |
|
| 515 |
// We have to keep the context menu group separate to have better control over positioning |
| 516 |
fContextMenuGroup= new CompositeActionGroup(new ActionGroup[] { rg }); |
| 505 |
|
517 |
|
| 506 |
/* |
518 |
/* |
| 507 |
* 1GF82PL: ITPJUI:ALL - Need to be able to add bookmark to classfile |
519 |
* 1GF82PL: ITPJUI:ALL - Need to be able to add bookmark to classfile |
|
Lines 514-519
Link Here
|
| 514 |
* setAction(ITextEditorActionConstants.RULER_MANAGE_TASKS, new ClassFileMarkerRulerAction("ManageTasks.", getVerticalRuler(), this, IMarker.TASK, true)); //$NON-NLS-1$ |
526 |
* setAction(ITextEditorActionConstants.RULER_MANAGE_TASKS, new ClassFileMarkerRulerAction("ManageTasks.", getVerticalRuler(), this, IMarker.TASK, true)); //$NON-NLS-1$ |
| 515 |
*/ |
527 |
*/ |
| 516 |
} |
528 |
} |
|
|
529 |
|
| 530 |
/* |
| 531 |
* @see AbstractTextEditor#editorContextMenuAboutToShow(IMenuManager) |
| 532 |
*/ |
| 533 |
public void editorContextMenuAboutToShow(IMenuManager menu) { |
| 534 |
super.editorContextMenuAboutToShow(menu); |
| 535 |
|
| 536 |
ActionContext context= new ActionContext(getSelectionProvider().getSelection()); |
| 537 |
fContextMenuGroup.setContext(context); |
| 538 |
fContextMenuGroup.fillContextMenu(menu); |
| 539 |
fContextMenuGroup.setContext(null); |
| 540 |
} |
| 517 |
|
541 |
|
| 518 |
/* |
542 |
/* |
| 519 |
* @see JavaEditor#getElementAt(int) |
543 |
* @see JavaEditor#getElementAt(int) |
|
Lines 756-761
Link Here
|
| 756 |
IDocumentProvider documentProvider= getDocumentProvider(); |
780 |
IDocumentProvider documentProvider= getDocumentProvider(); |
| 757 |
if (documentProvider instanceof ClassFileDocumentProvider) |
781 |
if (documentProvider instanceof ClassFileDocumentProvider) |
| 758 |
((ClassFileDocumentProvider) documentProvider).removeInputChangeListener(this); |
782 |
((ClassFileDocumentProvider) documentProvider).removeInputChangeListener(this); |
|
|
783 |
|
| 784 |
if (fActionGroups != null) { |
| 785 |
fActionGroups.dispose(); |
| 786 |
fActionGroups= null; |
| 787 |
} |
| 788 |
|
| 759 |
super.dispose(); |
789 |
super.dispose(); |
| 760 |
} |
790 |
} |
| 761 |
|
791 |
|