public void windowActivated(IWorkbenchWindow window) { if (window == getEditorSite().getWorkbenchWindow()) { /* * Workaround for problem described in * http://dev.eclipse.org/bugs/show_bug.cgi?id=11731 * Will be removed when SWT has solved the problem. */ window.getShell().getDisplay().asyncExec(new Runnable() { public void run() { handleActivation(); } }); } }
/** * Returns the status line manager of this editor. * * @return the status line manager of this editor * @since 2.0, protected since 3.3 */ protected IStatusLineManager getStatusLineManager() { return getEditorSite().getActionBars().getStatusLineManager(); }
/** * Returns the status line manager of this editor. * * @return the status line manager of this editor * @since 2.0, protected since 3.3 */ protected IStatusLineManager getStatusLineManager() { return getEditorSite().getActionBars().getStatusLineManager(); }
@Override public void windowActivated(IWorkbenchWindow window) { if (fHandleActivation && window == getEditorSite().getWorkbenchWindow()) { /* * Workaround for problem described in * http://dev.eclipse.org/bugs/show_bug.cgi?id=11731 * Will be removed when SWT has solved the problem. */ window.getShell().getDisplay().asyncExec(new Runnable() { @Override public void run() { handleActivation(); } }); } }
/** * Returns the status line manager of this editor. * * @return the status line manager of this editor * @since 2.0, protected since 3.3 */ protected IStatusLineManager getStatusLineManager() { return getEditorSite().getActionBars().getStatusLineManager(); }
@Override public void windowActivated(IWorkbenchWindow window) { if (fHandleActivation && window == getEditorSite().getWorkbenchWindow()) { /* * Workaround for problem described in * http://dev.eclipse.org/bugs/show_bug.cgi?id=11731 * Will be removed when SWT has solved the problem. */ window.getShell().getDisplay().asyncExec(() -> handleActivation()); } }
fActivationCodeTrigger.registerActionForKeyActivation(action); getEditorSite().getActionBarContributor().setActiveEditor(this); } else { getEditorSite().getActionBarContributor().setActiveEditor(null); Iterator<IAction> iter= fActions.values().iterator(); while (iter.hasNext()) {
fActivationCodeTrigger.registerActionForKeyActivation(action); getEditorSite().getActionBarContributor().setActiveEditor(this); } else { getEditorSite().getActionBarContributor().setActiveEditor(null); Iterator<IAction> iter= fActions.values().iterator(); while (iter.hasNext()) {
/** * Installs this trigger on the editor's text widget. * @since 2.0 */ public void install() { if (!fIsInstalled) { if (fSourceViewer instanceof ITextViewerExtension) { ITextViewerExtension e= (ITextViewerExtension) fSourceViewer; e.prependVerifyKeyListener(this); } else { StyledText text= fSourceViewer.getTextWidget(); text.addVerifyKeyListener(this); } fKeyBindingService= getEditorSite().getKeyBindingService(); fIsInstalled= true; } }
/** * Installs this trigger on the editor's text widget. * @since 2.0 */ public void install() { if (!fIsInstalled) { if (fSourceViewer instanceof ITextViewerExtension) { ITextViewerExtension e= (ITextViewerExtension) fSourceViewer; e.prependVerifyKeyListener(this); } else { StyledText text= fSourceViewer.getTextWidget(); text.addVerifyKeyListener(this); } fKeyBindingService= getEditorSite().getKeyBindingService(); fIsInstalled= true; } }
/** * Installs this trigger on the editor's text widget. * @since 2.0 */ public void install() { if (!fIsInstalled) { if (fSourceViewer instanceof ITextViewerExtension) { ITextViewerExtension e= (ITextViewerExtension) fSourceViewer; e.prependVerifyKeyListener(this); } else { StyledText text= fSourceViewer.getTextWidget(); text.addVerifyKeyListener(this); } fKeyBindingService= getEditorSite().getKeyBindingService(); fIsInstalled= true; } }
/** * Registers the given undo/redo action under the given ID and * ensures that previously installed actions get disposed. It * also takes care of re-registering the new action with the * global action handler. * * @param actionId the action id under which to register the action * @param action the action to register * @since 3.1 */ private void registerUndoRedoAction(String actionId, OperationHistoryActionHandler action) { IAction oldAction= getAction(actionId); if (oldAction instanceof OperationHistoryActionHandler) ((OperationHistoryActionHandler)oldAction).dispose(); setAction(actionId, action); IActionBars actionBars= getEditorSite().getActionBars(); if (actionBars != null) actionBars.setGlobalActionHandler(actionId, action); }
/** * Registers the given undo/redo action under the given ID and ensures that previously installed * actions get disposed. It also takes care of re-registering the new action with the global * action handler. * * @param actionId the action id under which to register the action * @param action the action to register or <code>null</code> to dispose them * @since 3.1 */ private void registerUndoRedoAction(String actionId, OperationHistoryActionHandler action) { IAction oldAction= getAction(actionId); if (oldAction instanceof OperationHistoryActionHandler) ((OperationHistoryActionHandler)oldAction).dispose(); if (action == null) return; setAction(actionId, action); IActionBars actionBars= getEditorSite().getActionBars(); if (actionBars != null) actionBars.setGlobalActionHandler(actionId, action); }
/** * Registers the given undo/redo action under the given ID and ensures that previously installed * actions get disposed. It also takes care of re-registering the new action with the global * action handler. * * @param actionId the action id under which to register the action * @param action the action to register or <code>null</code> to dispose them * @since 3.1 */ private void registerUndoRedoAction(String actionId, OperationHistoryActionHandler action) { IAction oldAction= getAction(actionId); if (oldAction instanceof OperationHistoryActionHandler) ((OperationHistoryActionHandler)oldAction).dispose(); if (action == null) return; setAction(actionId, action); IActionBars actionBars= getEditorSite().getActionBars(); if (actionBars != null) actionBars.setGlobalActionHandler(actionId, action); }
getEditorSite().registerContextMenu(fEditorContextMenuId, manager, getSelectionProvider(), isEditorInputIncludedInContextMenu()); else if (fCompatibilityMode) getEditorSite().registerContextMenu(DEFAULT_EDITOR_CONTEXT_MENU_ID, manager, getSelectionProvider(), isEditorInputIncludedInContextMenu()); String partId= getEditorSite().getId(); if (partId != null) getEditorSite().registerContextMenu(partId + ".EditorContext", manager, getSelectionProvider(), isEditorInputIncludedInContextMenu()); //$NON-NLS-1$ getEditorSite().registerContextMenu(COMMON_EDITOR_CONTEXT_MENU_ID, manager, getSelectionProvider(), false); getEditorSite().registerContextMenu(fRulerContextMenuId, manager, getSelectionProvider(), false); else if (fCompatibilityMode) getEditorSite().registerContextMenu(DEFAULT_RULER_CONTEXT_MENU_ID, manager, getSelectionProvider(), false); getEditorSite().registerContextMenu(partId + ".RulerContext", manager, getSelectionProvider(), false); //$NON-NLS-1$ getEditorSite().registerContextMenu(COMMON_RULER_CONTEXT_MENU_ID, manager, getSelectionProvider(), false);
getEditorSite().registerContextMenu(fEditorContextMenuId, manager, getSelectionProvider(), isEditorInputIncludedInContextMenu()); else if (fCompatibilityMode) getEditorSite().registerContextMenu(DEFAULT_EDITOR_CONTEXT_MENU_ID, manager, getSelectionProvider(), isEditorInputIncludedInContextMenu()); String partId= getEditorSite().getId(); if (partId != null) getEditorSite().registerContextMenu(partId + ".EditorContext", manager, getSelectionProvider(), isEditorInputIncludedInContextMenu()); //$NON-NLS-1$ getEditorSite().registerContextMenu(COMMON_EDITOR_CONTEXT_MENU_ID, manager, getSelectionProvider(), false); getEditorSite().registerContextMenu(fRulerContextMenuId, manager, getSelectionProvider(), false); else if (fCompatibilityMode) getEditorSite().registerContextMenu(DEFAULT_RULER_CONTEXT_MENU_ID, manager, getSelectionProvider(), false); getEditorSite().registerContextMenu(partId + ".RulerContext", manager, getSelectionProvider(), false); //$NON-NLS-1$ getEditorSite().registerContextMenu(COMMON_RULER_CONTEXT_MENU_ID, manager, getSelectionProvider(), false);
OperationHistoryActionHandler undoAction= new UndoActionHandler(getEditorSite(), undoContext); PlatformUI.getWorkbench().getHelpSystem().setHelp(undoAction, IAbstractTextEditorHelpContextIds.UNDO_ACTION); undoAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.UNDO); OperationHistoryActionHandler redoAction= new RedoActionHandler(getEditorSite(), undoContext); PlatformUI.getWorkbench().getHelpSystem().setHelp(redoAction, IAbstractTextEditorHelpContextIds.REDO_ACTION); redoAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.REDO);
IEditorSite editorSite= getEditorSite(); if (editorSite instanceof MultiPageEditorSite) editorSite= ((MultiPageEditorSite)editorSite).getMultiPageEditor().getEditorSite();
OperationHistoryActionHandler undoAction= new UndoActionHandler(getEditorSite(), undoContext); PlatformUI.getWorkbench().getHelpSystem().setHelp(undoAction, IAbstractTextEditorHelpContextIds.UNDO_ACTION); undoAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_UNDO); OperationHistoryActionHandler redoAction= new RedoActionHandler(getEditorSite(), undoContext); PlatformUI.getWorkbench().getHelpSystem().setHelp(redoAction, IAbstractTextEditorHelpContextIds.REDO_ACTION); redoAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_REDO);
OperationHistoryActionHandler undoAction= new UndoActionHandler(getEditorSite(), undoContext); PlatformUI.getWorkbench().getHelpSystem().setHelp(undoAction, IAbstractTextEditorHelpContextIds.UNDO_ACTION); undoAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_UNDO); OperationHistoryActionHandler redoAction= new RedoActionHandler(getEditorSite(), undoContext); PlatformUI.getWorkbench().getHelpSystem().setHelp(redoAction, IAbstractTextEditorHelpContextIds.REDO_ACTION); redoAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_REDO);