當前位置: 首頁>>代碼示例>>Java>>正文


Java MessageBusConnection.disconnect方法代碼示例

本文整理匯總了Java中com.intellij.util.messages.MessageBusConnection.disconnect方法的典型用法代碼示例。如果您正苦於以下問題:Java MessageBusConnection.disconnect方法的具體用法?Java MessageBusConnection.disconnect怎麽用?Java MessageBusConnection.disconnect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.util.messages.MessageBusConnection的用法示例。


在下文中一共展示了MessageBusConnection.disconnect方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: unsubscribeFrom

import com.intellij.util.messages.MessageBusConnection; //導入方法依賴的package包/類
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();
    }
    LafManager.getInstance().removeLafManagerListener(listener);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:19,代碼來源:NavBarListener.java

示例2: getWithActive

import com.intellij.util.messages.MessageBusConnection; //導入方法依賴的package包/類
protected boolean getWithActive(SvnAuthenticationManager active) throws SVNException {
  MessageBusConnection connection = null;
  try {
    final Project project = myVcs.getProject();
    connection = project.getMessageBus().connect(project);
    connection.subscribe(SvnAuthenticationManager.AUTHENTICATION_PROVIDER_LISTENER, new MyAuthenticationProviderListener());

    makeAuthCall(active);
  }
  finally {
    if (connection != null) {
      connection.disconnect();
    }
  }

  return afterAuthCall();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:AbstractAuthenticator.java

示例3: unsubscribeFrom

import com.intellij.util.messages.MessageBusConnection; //導入方法依賴的package包/類
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();
    }
  }
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:18,代碼來源:NavBarListener.java

示例4: projectClosed

import com.intellij.util.messages.MessageBusConnection; //導入方法依賴的package包/類
@Override
public void projectClosed(Project project) {
  myProjectDataMap.remove(getProjectPath(project));
  final MessageBusConnection conn = myConnections.remove(project);
  if (conn != null) {
    conn.disconnect();
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:BuildManager.java

示例5: removeFileTypeListener

import com.intellij.util.messages.MessageBusConnection; //導入方法依賴的package包/類
@Override
public void removeFileTypeListener(@NotNull FileTypeListener listener) {
  final MessageBusConnection connection = myAdapters.remove(listener);
  if (connection != null) {
    connection.disconnect();
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:FileTypeManagerImpl.java

示例6: removeVcsListener

import com.intellij.util.messages.MessageBusConnection; //導入方法依賴的package包/類
@Override
public void removeVcsListener(VcsListener listener) {
  final MessageBusConnection connection = myAdapters.remove(listener);
  if (connection != null) {
    connection.disconnect();
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:ProjectLevelVcsManagerImpl.java

示例7: cleanup

import com.intellij.util.messages.MessageBusConnection; //導入方法依賴的package包/類
private void cleanup() {
  if (!myWatchRequests.isEmpty()) {
    LocalFileSystem.getInstance().removeWatchedRoots(myWatchRequests);
    myWatchRequests = Collections.emptySet();
  }

  final MessageBusConnection connection = myBusConnection;
  if (connection != null) {
    myBusConnection = null;
    connection.disconnect();
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:13,代碼來源:JarDirectoryWatcherImpl.java

示例8: onModuleRemoved

import com.intellij.util.messages.MessageBusConnection; //導入方法依賴的package包/類
private void onModuleRemoved(final Module module) {
  final MessageBusConnection connection = myModule2Connection.remove(module);
  if (connection != null) {
    connection.disconnect();
  }

  final FacetManager facetManager = FacetManager.getInstance(module);
  final Facet[] facets = facetManager.getAllFacets();
  for (Facet facet : facets) {
    onFacetRemoved(facet, false);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:13,代碼來源:ProjectWideFacetListenersRegistryImpl.java

示例9: uninstallListeners

import com.intellij.util.messages.MessageBusConnection; //導入方法依賴的package包/類
public void uninstallListeners() {
	VirtualFileManager.getInstance().removeVirtualFileListener(myVirtualFileListener);
	if ( !projectIsClosed ) {
		MessageBusConnection msgBus = project.getMessageBus().connect(project);
		msgBus.disconnect();
	}
}
 
開發者ID:antlr,項目名稱:jetbrains-plugin-st4,代碼行數:8,代碼來源:STGroupPluginController.java

示例10: moduleRemoved

import com.intellij.util.messages.MessageBusConnection; //導入方法依賴的package包/類
@Override
public void moduleRemoved(Project project, final Module module) {
  final MessageBusConnection connection = myModule2Connection.remove(module);
  if (connection != null) {
    connection.disconnect();
  }
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:8,代碼來源:FacetPointersManagerImpl.java

示例11: doWithSubscribeToAuthProvider

import com.intellij.util.messages.MessageBusConnection; //導入方法依賴的package包/類
private void doWithSubscribeToAuthProvider(SvnAuthenticationManager.ISVNAuthenticationProviderListener listener,
                                           final ThrowableRunnable<SVNException> runnable) throws SVNException {
  MessageBusConnection connection = null;
  try {
    final Project project = myVcs.getProject();
    connection = project.getMessageBus().connect(project);
    connection.subscribe(SvnAuthenticationManager.AUTHENTICATION_PROVIDER_LISTENER, listener);
    runnable.run();
  } finally {
    if (connection != null) {
      connection.disconnect();
    }
  }
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:15,代碼來源:IdeaSvnkitBasedAuthenticationCallback.java

示例12: removeFileTypeListener

import com.intellij.util.messages.MessageBusConnection; //導入方法依賴的package包/類
@Override
public void removeFileTypeListener(@Nonnull FileTypeListener listener) {
  final MessageBusConnection connection = myAdapters.remove(listener);
  if (connection != null) {
    connection.disconnect();
  }
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:8,代碼來源:FileTypeManagerImpl.java

示例13: testRootsEditing

import com.intellij.util.messages.MessageBusConnection; //導入方法依賴的package包/類
public void testRootsEditing() {
  final MessageBusConnection connection = myProject.getMessageBus().connect();
  final ModuleManager moduleManager = ModuleManager.getInstance(myProject);
  final MyModuleListener moduleListener = new MyModuleListener();
  connection.subscribe(ProjectTopics.MODULES, moduleListener);

  final Module moduleA;
  final Module moduleB;
  {
    final ModifiableModuleModel moduleModel = moduleManager.getModifiableModel();
    moduleA = moduleModel.newModule("a.iml", StdModuleTypes.JAVA.getId());
    moduleB = moduleModel.newModule("b.iml", StdModuleTypes.JAVA.getId());
    final ModifiableRootModel rootModelA = ModuleRootManager.getInstance(moduleA).getModifiableModel();
    final ModifiableRootModel rootModelB = ModuleRootManager.getInstance(moduleB).getModifiableModel();
    rootModelB.addModuleOrderEntry(moduleA);

    final ContentEntry contentEntryA = rootModelA.addContentEntry(getVirtualFileInTestData("a"));
    contentEntryA.addSourceFolder(getVirtualFileInTestData("a/src"), false);
    final ContentEntry contentEntryB = rootModelB.addContentEntry(getVirtualFileInTestData("b"));
    contentEntryB.addSourceFolder(getVirtualFileInTestData("b/src"), false);

    ApplicationManager.getApplication().runWriteAction(() -> {
      ModifiableModelCommitter.multiCommit(new ModifiableRootModel[]{rootModelB, rootModelA}, moduleModel);
    });
  }

  final JavaPsiFacade psiManager = getJavaFacade();
  assertNull(psiManager.findClass("j.B", GlobalSearchScope.moduleWithDependenciesScope(moduleA)));
  assertNull(psiManager.findClass("q.A", GlobalSearchScope.moduleScope(moduleB)));

  assertNotNull(psiManager.findClass("q.A", GlobalSearchScope.moduleScope(moduleA)));
  assertNotNull(psiManager.findClass("q.A", GlobalSearchScope.moduleWithDependenciesScope(moduleB)));
  assertNotNull(psiManager.findClass("j.B", GlobalSearchScope.moduleScope(moduleB)));
  assertNotNull(psiManager.findClass("j.B", GlobalSearchScope.moduleWithDependenciesScope(moduleB)));

  moduleManager.disposeModule(moduleB);
  moduleManager.disposeModule(moduleA);
  moduleListener.assertCorrectEvents(new String[][]{{"+b", "+a"}, {"-b"}, {"-a"}});

  connection.disconnect();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:42,代碼來源:MultiModuleEditingTest.java

示例14: removeCompilationStatusListener

import com.intellij.util.messages.MessageBusConnection; //導入方法依賴的package包/類
public void removeCompilationStatusListener(@NotNull final CompilationStatusListener listener) {
  final MessageBusConnection connection = myListenerAdapters.remove(listener);
  if (connection != null) {
    connection.disconnect();
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:7,代碼來源:CompilerManagerImpl.java

示例15: remove

import com.intellij.util.messages.MessageBusConnection; //導入方法依賴的package包/類
public void remove(@NotNull T listener) {
  final MessageBusConnection connection = myListenerToConnectionMap.remove(listener);
  if (connection != null) {
    connection.disconnect();
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:7,代碼來源:MessageListenerList.java


注:本文中的com.intellij.util.messages.MessageBusConnection.disconnect方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。