/** * Installs a submenu with <code>fEditor</code>'s ruler context menu that contains the choices * for the quick diff reference. This allows the toggle action to lazily install the menu once * quick diff has been enabled. */ private void setPopupMenu() { if (!(fEditor instanceof ITextEditorExtension)) return; ((ITextEditorExtension)fEditor).addRulerContextMenuListener(fListener); }
/** * Installs a submenu with <code>fEditor</code>'s ruler context menu that contains the choices * for the quick diff reference. This allows the toggle action to lazily install the menu once * quick diff has been enabled. */ private void setPopupMenu() { if (!(fEditor instanceof ITextEditorExtension)) return; ((ITextEditorExtension)fEditor).addRulerContextMenuListener(fListener); }
/** * Installs a submenu with <code>fEditor</code>'s ruler context menu that contains the choices * for the quick diff reference. This allows the toggle action to lazily install the menu once * quick diff has been enabled. */ private void setPopupMenu() { if (!(fEditor instanceof ITextEditorExtension)) return; ((ITextEditorExtension)fEditor).addRulerContextMenuListener(fListener); }
@Override public void setActiveEditor(IAction callerAction, IEditorPart targetEditor) { // Clean up old editor data. if (fCallerAction != null) { fCallerAction.setMenuCreator(null); } if (fEditor instanceof ITextEditorExtension) { ((ITextEditorExtension) fEditor).removeRulerContextMenuListener(this); } fRulerInfo = null; // Set up new editor data. fCallerAction = callerAction; fCallerAction.setMenuCreator(this); fEditor= targetEditor == null ? null : targetEditor.getAdapter(ITextEditor.class); if (fEditor != null) { if (fEditor instanceof ITextEditorExtension) { ((ITextEditorExtension) fEditor).addRulerContextMenuListener(this); } fRulerInfo= fEditor.getAdapter(IVerticalRulerInfo.class); } }
public void setActiveEditor(IAction callerAction, IEditorPart targetEditor) { if (fEditor != null) { IVerticalRulerInfo rulerInfo= (IVerticalRulerInfo) fEditor.getAdapter(IVerticalRulerInfo.class); if (rulerInfo != null) { Control control= rulerInfo.getControl(); if (control != null && !control.isDisposed()) control.removeMouseListener(this); } if (fEditor instanceof ITextEditorExtension) ((ITextEditorExtension) fEditor).removeRulerContextMenuListener(this); } fEditor= (ITextEditor)(targetEditor == null ? null : targetEditor.getAdapter(ITextEditor.class)); fCallerAction= callerAction; fAction= null; if (fEditor != null) { if (fEditor instanceof ITextEditorExtension) ((ITextEditorExtension) fEditor).addRulerContextMenuListener(this); IVerticalRulerInfo rulerInfo= (IVerticalRulerInfo) fEditor.getAdapter(IVerticalRulerInfo.class); if (rulerInfo != null) { fAction= createAction(fEditor, rulerInfo); update(); Control control= rulerInfo.getControl(); if (control != null && !control.isDisposed()) control.addMouseListener(this); } } }
@Override public void setActiveEditor(IAction callerAction, IEditorPart targetEditor) { if (fEditor != null) { IVerticalRulerInfo rulerInfo= fEditor.getAdapter(IVerticalRulerInfo.class); if (rulerInfo != null) { Control control= rulerInfo.getControl(); if (control != null && !control.isDisposed()) control.removeMouseListener(this); } if (fEditor instanceof ITextEditorExtension) ((ITextEditorExtension) fEditor).removeRulerContextMenuListener(this); } fEditor= targetEditor == null ? null : targetEditor.getAdapter(ITextEditor.class); fCallerAction= callerAction; fAction= null; if (fEditor != null) { if (fEditor instanceof ITextEditorExtension) ((ITextEditorExtension) fEditor).addRulerContextMenuListener(this); IVerticalRulerInfo rulerInfo= fEditor.getAdapter(IVerticalRulerInfo.class); if (rulerInfo != null) { fAction= createAction(fEditor, rulerInfo); update(); Control control= rulerInfo.getControl(); if (control != null && !control.isDisposed()) control.addMouseListener(this); } } }
@Override public void setActiveEditor(IAction callerAction, IEditorPart targetEditor) { if (fEditor != null) { IVerticalRulerInfo rulerInfo= fEditor.getAdapter(IVerticalRulerInfo.class); if (rulerInfo != null) { Control control= rulerInfo.getControl(); if (control != null && !control.isDisposed()) control.removeMouseListener(this); } if (fEditor instanceof ITextEditorExtension) ((ITextEditorExtension) fEditor).removeRulerContextMenuListener(this); } fEditor= targetEditor == null ? null : targetEditor.getAdapter(ITextEditor.class); fCallerAction= callerAction; fAction= null; if (fEditor != null) { if (fEditor instanceof ITextEditorExtension) ((ITextEditorExtension) fEditor).addRulerContextMenuListener(this); IVerticalRulerInfo rulerInfo= fEditor.getAdapter(IVerticalRulerInfo.class); if (rulerInfo != null) { fAction= createAction(fEditor, rulerInfo); update(); Control control= rulerInfo.getControl(); if (control != null && !control.isDisposed()) control.addMouseListener(this); } } }