本文整理匯總了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);
}
}
示例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();
}
示例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();
}
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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);
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
}
示例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();
}
}
示例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();
}
示例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();
}
}
示例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();
}
}