/** * Removes the ruler context menu listener from the current editor. */ private void removePopupMenu() { if (!(fEditor instanceof ITextEditorExtension)) return; ((ITextEditorExtension)fEditor).removeRulerContextMenuListener(fListener); }
/** * Removes the ruler context menu listener from the current editor. */ private void removePopupMenu() { if (!(fEditor instanceof ITextEditorExtension)) return; ((ITextEditorExtension)fEditor).removeRulerContextMenuListener(fListener); }
/** * Removes the ruler context menu listener from the current editor. */ private void removePopupMenu() { if (!(fEditor instanceof ITextEditorExtension)) return; ((ITextEditorExtension)fEditor).removeRulerContextMenuListener(fListener); }
@Override public void dispose() { if (fCallerAction != null) { fCallerAction.setMenuCreator(null); } if (fEditor instanceof ITextEditorExtension) { ((ITextEditorExtension) fEditor).removeRulerContextMenuListener(this); } fRulerInfo = null; }
@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); } } }