public void windowOpened(final IWorkbenchWindow window) { final RegistryListerner listener = new RegistryListerner(window); synchronized (fCreatedListeners) { fCreatedListeners.add(listener); } fRegistry.addListener(listener, window.getActivePage()); }
public void dispose() { synchronized (fCreatedListeners) { final Iterator<RegistryListerner> iter = fCreatedListeners.iterator(); while (iter.hasNext()) { fRegistry.removeListener(iter.next()); iter.remove(); } } }
public Map getCurrentState() { final Map map = new HashMap(); Object tool = null; if (fActiveWindow != null) { tool = fRegistry.getActiveToolSession(fActiveWindow.getActivePage()).getProcess(); } if (tool == null) { tool = IEvaluationContext.UNDEFINED_VARIABLE; } map.put(ACTIVE_TOOL_NAME, tool); return map; }
@Override public void stop(final BundleContext context) throws Exception { try { if (fToolRegistry != null) { fToolRegistry.dispose(); fToolRegistry = null; } if (fContributionProvider != null) { fContributionProvider.dispose(); fContributionProvider = null; } if (fUIDecoratorsRegistry != null) { fUIDecoratorsRegistry = null; } } finally { gPlugin = null; super.stop(context); } }
@Override public void start(final BundleContext context) throws Exception { super.start(context); fToolRegistry = new ToolRegistry(); fToolRegistry.addListener( new IToolRegistryListener() { @Override public void toolSessionActivated(final ToolSessionUIData sessionData) { if (sessionData.getProcess() != null) { fToolRegistry.removeListener(this); if (fContributionProvider == null) { fContributionProvider = new NicoWindowContributions(); } } } @Override public void toolTerminated(final ToolSessionUIData sessionData) {} }, null); }
public void windowActivated(final IWorkbenchWindow window) { fActiveWindow = window; handleActivated(fRegistry.getActiveToolSession(window.getActivePage()).getProcess()); }