Exemplo n.º 1
0
 /**
  * Create the central place for editor factories. This manager will retrieve panel editors and use
  * the docking manager to addDockingPanel them
  *
  * @param dm Instance of docking manager
  */
 private void makeEditorManager(DockingManager dm) {
   editors = new EditorManagerImpl(dm);
   Services.registerService(
       org.orbisgis.viewapi.edition.EditorManager.class,
       I18N.tr("Use this instance to open an editable element (map,data source..)"),
       editors);
   pluginFramework
       .getHostBundleContext()
       .registerService(org.orbisgis.viewapi.edition.EditorManager.class, editors, null);
   editorFactoryTracker =
       new EditorFactoryTracker(pluginFramework.getHostBundleContext(), editors);
   editorFactoryTracker.open();
   editorTracker = new EditorPanelTracker(pluginFramework.getHostBundleContext(), editors);
   editorTracker.open();
 }
Exemplo n.º 2
0
  /** Free all resources allocated by this object */
  public void dispose() {
    // Close all running jobs
    final AppContext appContext = AppContext.getAppContext();
    ExecutorService executorService = (ExecutorService) appContext.get(SwingWorker.class);
    if (executorService != null) {
      executorService.shutdown();
    }

    // Free UI resources
    if (editors != null) {
      editors.dispose();
    }
    if (geoCatalog != null) {
      geoCatalog.dispose();
    }
    if (mainFrame != null) {
      mainFrame.dispose();
    }
    if (singleFrameTracker != null) {
      singleFrameTracker.close();
    }
    if (editorFactoryTracker != null) {
      editorFactoryTracker.close();
    }
    if (editorTracker != null) {
      editorTracker.close();
    }
    if (toolBarTracker != null) {
      toolBarTracker.close();
    }
    dockManager.dispose();
    loggerCollection.dispose();

    // Free libraries resources
    mainContext.dispose();

    UIFactory.setMainFrame(null);
  }