public void uninitGosuPlugin() {
    gw.plugin.ij.util.UIUtil.closeAllGosuEditors(_project, null);

    // DebuggerManager.getInstance( _project ).unregisterPositionManagerFactory( _positionManager );
    removeCompiler();

    _projectConnection.disconnect();
    _projectConnection = null;
    _applicationConnection.disconnect();
    _applicationConnection = null;
    _gosuCompiler = null;
    _fileModificationManager = null;
    _startupOk = true;
    _startupError = null;
  }
 @Override
 public void removeVcsListener(VcsListener listener) {
   final MessageBusConnection connection = myAdapters.remove(listener);
   if (connection != null) {
     connection.disconnect();
   }
 }
Beispiel #3
0
  @Override
  public void deactivate() {
    if (null != myHgRemoteStatusUpdater) {
      myHgRemoteStatusUpdater.deactivate();
      myHgRemoteStatusUpdater = null;
    }
    if (null != myHgCurrentBranchStatusUpdater) {
      myHgCurrentBranchStatusUpdater.deactivate();
      myHgCurrentBranchStatusUpdater = null;
    }
    if (null != myStatusWidget) {
      myStatusWidget.deactivate();
      myStatusWidget = null;
    }
    if (null != myIncomingWidget) {
      myIncomingWidget.deactivate();
      myIncomingWidget = null;
    }
    if (null != myOutgoingWidget) {
      myOutgoingWidget.deactivate();
      myOutgoingWidget = null;
    }
    if (messageBusConnection != null) {
      messageBusConnection.disconnect();
    }

    if (myVFSListener != null) {
      Disposer.dispose(myVFSListener);
      myVFSListener = null;
    }

    super.deactivate();
  }
 @Override
 public void projectClosed(Project project) {
   myProjectDataMap.remove(getProjectPath(project));
   final MessageBusConnection conn = myConnections.remove(project);
   if (conn != null) {
     conn.disconnect();
   }
 }
 @Override
 public void dispose() {
   if (myWatchRequest != null) {
     LocalFileSystem.getInstance().removeWatchedRoot(myWatchRequest);
   }
   if (myMessageBusConnection != null) {
     myMessageBusConnection.disconnect();
   }
 }
Beispiel #6
0
 private void disposeListeners() {
   FileStatusManager.getInstance(myProject).removeFileStatusListener(myFileStatusListener);
   VirtualFileManager.getInstance().removeVirtualFileListener(myFileListener);
   VirtualFileManager.getInstance().removeVirtualFileManagerListener(myVirtualFileManagerListener);
   myProject
       .getComponent(ProjectLevelVcsManager.class)
       .removeVcsListener(myDirectoryMappingListener);
   ChangeListManager.getInstance(myProject).removeChangeListListener(myChangeListListener);
   myMessageBusConnection.disconnect();
 }
  private void stopListeningAndCheckEvents() {
    myBusConnection.disconnect();
    myBusConnection = null;

    assertTrue(myExpectedEventWasProduced);
    assertFalse(myUnexpectedEventWasProduced);

    myExpectedEventWasProduced = false;
    myUnexpectedEventWasProduced = false;
  }
  /**
   * Disposes all resources allocated be the TextEditorComponent. It disposes all created editors,
   * unregisters listeners. The behaviour of the splitter after disposing is unpredictable.
   */
  void dispose() {
    myDocument.removeDocumentListener(myDocumentListener);
    EditorHistoryManager.getInstance(myProject).updateHistoryEntry(myFile, false);
    disposeEditor(myEditor);
    myConnection.disconnect();

    myFile.getFileSystem().removeVirtualFileListener(myVirtualFileListener);
    // myFocusWatcher.deinstall(this);
    // removePropertyChangeListener(mySplitterPropertyChangeListener);

    // super.dispose();
  }
  /**
   * Should typically be called when there is no MPS facet left in the project. We don't want to put
   * any load on Idea in this case. We only keep tracking facet notifications, to react when MPS
   * facet is back.
   */
  private void deactivate() {
    synchronized (LOCK) {
      workerConnection.disconnect();

      // remove all our solutions
      for (Module mod : myModulesToSolutions.keySet()) {
        untrackModule(mod, false);
      }

      myIsActivated = false;
    }
  }
  @Override
  public void disposeComponent() {
    releaseEditor();
    myMappings.disposeMe();
    myConnect.disconnect();
    Disposer.dispose(myAnnotationLocalChangesListener);
    myContentManager = null;

    ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(myProject);
    if (toolWindowManager != null && toolWindowManager.getToolWindow(ToolWindowId.VCS) != null) {
      toolWindowManager.unregisterToolWindow(ToolWindowId.VCS);
    }
  }
  @Override
  protected void tearDown() throws Exception {
    LOG.debug("================== tearing down " + getName() + " ==================");

    try {
      myConnection.disconnect();
      myWatcher.shutdown();
      assertFalse(myWatcher.isOperational());
    } finally {
      myFileSystem = null;
      myWatcher = null;
      super.tearDown();
    }

    LOG.debug("================== tearing down " + getName() + " ==================");
  }
 private static LightweightHint showErrorHint(Project project, Editor editor, String text) {
   final LightweightHint[] result = {null};
   final EditorHintListener listener =
       new EditorHintListener() {
         public void hintShown(
             final Project project, final LightweightHint hint, final int flags) {
           result[0] = hint;
         }
       };
   final MessageBusConnection connection = project.getMessageBus().connect();
   connection.subscribe(EditorHintListener.TOPIC, listener);
   assert text != null;
   HintManager.getInstance().showErrorHint(editor, text, HintManager.UNDER);
   connection.disconnect();
   return result[0];
 }
 static void unsubscribeFrom(NavBarPanel panel) {
   final NavBarListener listener = (NavBarListener) panel.getClientProperty(LISTENER);
   panel.putClientProperty(LISTENER, null);
   if (listener != null) {
     final Project project = panel.getProject();
     KeyboardFocusManager.getCurrentKeyboardFocusManager().removePropertyChangeListener(listener);
     FileStatusManager.getInstance(project).removeFileStatusListener(listener);
     PsiManager.getInstance(project).removePsiTreeChangeListener(listener);
     WolfTheProblemSolver.getInstance(project).removeProblemListener(listener);
     ActionManager.getInstance().removeAnActionListener(listener);
     final MessageBusConnection connection = (MessageBusConnection) panel.getClientProperty(BUS);
     panel.putClientProperty(BUS, null);
     if (connection != null) {
       connection.disconnect();
     }
   }
 }
Beispiel #14
0
 @Override
 public void dispose() {
   final ProjectLibraryTable projectLibraryTable =
       (ProjectLibraryTable) ProjectLibraryTable.getInstance(myModule.getProject());
   ModelAccess.instance()
       .runReadAction(
           new Runnable() {
             @Override
             public void run() {
               for (final Library library : projectLibraryTable.getLibraries()) {
                 if (ModuleLibraryType.isModuleLibrary(library)) {
                   library.getRootProvider().removeRootSetChangedListener(myRootSetListener);
                 }
               }
             }
           });
   projectLibraryTable.removeListener(myLibrariesListener);
   ApplicationManager.getApplication()
       .getComponent(JdkStubSolutionManager.class)
       .releaseSdk(myModule);
   super.dispose();
   myConnection.disconnect();
 }
 public void disposeComponent() {
   connection.disconnect();
 }
 @Override
 public void disposeComponent() {
   myMessageBusConnection.disconnect();
 }
 public void deactivate() {
   myConnection.disconnect();
 }