@Override protected void startListening() { partService.addPartListener(listener); }
@Override public final void windowOpened(final IWorkbenchWindow window) { if (window != null) { window.getPartService().addPartListener(partListener); } }
public void setPartListener(IPartService partService, IPartListener2 listener) { if (partService == null) return; if (partListeners == null) partListeners = new HashMap<IPartService, IPartListener2>(); IPartListener2 oldListener = partListeners.get(partService); if (oldListener != null) partService.removePartListener(oldListener); partService.addPartListener(listener); partListeners.put(partService, listener); }
/** * Creates this activation listener. * * @param partService * the part service on which to add the part listener * @since 3.1 */ public ActivationListener(IPartService partService) { fPartService = partService; fPartService.addPartListener(this); PlatformUI.getWorkbench().addWindowListener(this); }
/** * Creates this activation listener. * * @param partService the part service on which to add the part listener * @since 3.1 */ public ActivationListener(IPartService partService) { fPartService= partService; fPartService.addPartListener(this); PlatformUI.getWorkbench().addWindowListener(this); }
public DebugWindowContextService(IWorkbenchWindow window, final IEvaluationService evaluationService) { fWindow = window; fWindow.getPartService().addPartListener(this); // need to register source provider on the UI thread (bug 438396) window.getShell().getDisplay().asyncExec(() -> { if (fWindow != null) { fSourceProvider = new DebugContextSourceProvider(DebugWindowContextService.this, evaluationService); } }); }
public void init(IEditorSite site, IEditorInput input) throws PartInitException { super.init(site, input); site.getWorkbenchWindow().getPartService().addPartListener(fActivationListener); }
public SourceInformationProvider(PDESourcePage editor, IInformationControlCreator creator, int impType) { fSourcePage = editor; fPresenterControlCreator = creator; fImpType = impType; if (fSourcePage != null && fImpType != F_NO_IMP) { fSourcePage.getSite().getWorkbenchWindow().getPartService().addPartListener(this); update(); } }
private RetargetAction createSubmenuAction(IPartService partService, String actionID, String text, String actionDefinitionId) { RetargetAction action= new RetargetAction(actionID, text); action.setActionDefinitionId(actionDefinitionId); partService.addPartListener(action); IWorkbenchPart activePart = partService.getActivePart(); if (activePart != null) { action.partActivated(activePart); } return action; }
@Override public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_previous); action.setToolTipText(WorkbenchMessages.Workbench_previousToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; } };
@Override public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_selectAll); action.setToolTipText(WorkbenchMessages.Workbench_selectAllToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; } };
@Override public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_properties); action.setToolTipText(WorkbenchMessages.Workbench_propertiesToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; } };
/** * Creates a new find/replace dialog accessor anchored at the given part site. * * @param site the part site */ public FindReplaceDialogStub(IWorkbenchPartSite site) { this(site.getShell()); fWindow= site.getWorkbenchWindow(); IPartService service= fWindow.getPartService(); service.addPartListener(this); partActivated(service.getActivePart()); }
public SQLInformationProvider(IEditorPart editor) { _fEditor = editor; if (_fEditor != null) { _fPartListener = new EditorWatcher(); IWorkbenchWindow window = _fEditor.getSite().getWorkbenchWindow(); window.getPartService().addPartListener(_fPartListener); update(); } }
/** * Installs this AST provider. */ void install() { // Create and register activation listener fActivationListener= new ActivationListener(); PlatformUI.getWorkbench().addWindowListener(fActivationListener); // Ensure existing windows get connected IWorkbenchWindow[] windows= PlatformUI.getWorkbench().getWorkbenchWindows(); for (int i= 0, length= windows.length; i < length; i++) windows[i].getPartService().addPartListener(fActivationListener); }
/** * Installs this AST provider. */ void install() { // Create and register activation listener fActivationListener= new ActivationListener(); PlatformUI.getWorkbench().addWindowListener(fActivationListener); // Ensure existing windows get connected IWorkbenchWindow[] windows= PlatformUI.getWorkbench().getWorkbenchWindows(); for (int i= 0, length= windows.length; i < length; i++) windows[i].getPartService().addPartListener(fActivationListener); }
/** * @see IWorkbenchWindowActionDelegate#init(IWorkbenchWindow) */ public void init(IWorkbenchWindow window) { setWindow(window); IWorkbenchPage page= window.getActivePage(); if (page != null) { setTargetPart(page.getActivePart()); } window.getPartService().addPartListener(this); update(); }
private ActionDelegateHelper() { fCurrentWindow= JDIDebugUIPlugin.getActiveWorkbenchWindow(); if (fCurrentWindow != null) { fCurrentWindow.getWorkbench().addWindowListener(this); fCurrentWindow.getPartService().addPartListener(this); IWorkbenchPage page= fCurrentWindow.getActivePage(); if (page != null) { IEditorPart part= page.getActiveEditor(); checkToSetTextEditor(part); } } }
@Override public final void createPartControl(Composite parent) { internalCreatePartControl(parent); inititalizeColors(); getSite().getWorkbenchWindow().getPartService().addPartListener(fPartListener); createContextMenu(); createActions(); fillActionBars(getViewSite().getActionBars()); PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), getHelpContextId()); }
@Override public final void createPartControl(Composite parent) { internalCreatePartControl(parent); inititalizeColors(); getSite().getWorkbenchWindow().getPartService().addPartListener(fPartListener); createContextMenu(); createActions(); fillActionBars(getViewSite().getActionBars()); PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), getHelpContextId()); }