コード例 #1
0
 public void windowOpened(final IWorkbenchWindow window) {
   final RegistryListerner listener = new RegistryListerner(window);
   synchronized (fCreatedListeners) {
     fCreatedListeners.add(listener);
   }
   fRegistry.addListener(listener, window.getActivePage());
 }
コード例 #2
0
 public void dispose() {
   synchronized (fCreatedListeners) {
     final Iterator<RegistryListerner> iter = fCreatedListeners.iterator();
     while (iter.hasNext()) {
       fRegistry.removeListener(iter.next());
       iter.remove();
     }
   }
 }
コード例 #3
0
 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;
 }
コード例 #4
0
ファイル: NicoUIPlugin.java プロジェクト: wtcooper/statet
 @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);
   }
 }
コード例 #5
0
ファイル: NicoUIPlugin.java プロジェクト: wtcooper/statet
  @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);
  }
コード例 #6
0
 public void windowActivated(final IWorkbenchWindow window) {
   fActiveWindow = window;
   handleActivated(fRegistry.getActiveToolSession(window.getActivePage()).getProcess());
 }