/*
* @see IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, org.eclipse.ui.IEditorPart)
*/
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);
}
}
}