mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Use message bus instead of PropertyChangeSupport for active lookup change notifications
GitOrigin-RevId: 650343c69ac523dbe1b7d7ec716c1b84d7f1f7e4
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8c949bf595
commit
6429469c1b
@@ -61,8 +61,20 @@ public abstract class LookupManager {
|
||||
|
||||
@NonNls public static final String PROP_ACTIVE_LOOKUP = "activeLookup";
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link LookupManagerListener.TOPIC}
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract void addPropertyChangeListener(@NotNull PropertyChangeListener listener);
|
||||
/**
|
||||
* @deprecated Use {@link LookupManagerListener.TOPIC}
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract void addPropertyChangeListener(@NotNull PropertyChangeListener listener, @NotNull Disposable disposable);
|
||||
/**
|
||||
* @deprecated Use {@link LookupManagerListener.TOPIC}
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract void removePropertyChangeListener(@NotNull PropertyChangeListener listener);
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.codeInsight.lookup;
|
||||
|
||||
import com.intellij.util.messages.Topic;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public interface LookupManagerListener {
|
||||
void activeLookupChanged(@Nullable Lookup oldLookup, @Nullable Lookup newLookup);
|
||||
|
||||
Topic<LookupManagerListener> TOPIC = Topic.create("lookup manager listener", LookupManagerListener.class);
|
||||
}
|
||||
@@ -155,7 +155,7 @@ public class LookupManagerImpl extends LookupManager {
|
||||
public void dispose() {
|
||||
myActiveLookup = null;
|
||||
myActiveLookupEditor = null;
|
||||
myPropertyChangeSupport.firePropertyChange(PROP_ACTIVE_LOOKUP, lookup, null);
|
||||
fireActiveLookupChanged(lookup, null);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -170,10 +170,15 @@ public class LookupManagerImpl extends LookupManager {
|
||||
alarm.cancelAllRequests(); // no items -> no doc
|
||||
}
|
||||
|
||||
myPropertyChangeSupport.firePropertyChange(PROP_ACTIVE_LOOKUP, null, myActiveLookup);
|
||||
fireActiveLookupChanged(null, myActiveLookup);
|
||||
return lookup;
|
||||
}
|
||||
|
||||
void fireActiveLookupChanged(LookupImpl oldLookup, LookupImpl newLookup) {
|
||||
myPropertyChangeSupport.firePropertyChange(PROP_ACTIVE_LOOKUP, oldLookup, newLookup);
|
||||
myProject.getMessageBus().syncPublisher(LookupManagerListener.TOPIC).activeLookupChanged(oldLookup, newLookup);
|
||||
}
|
||||
|
||||
private void showJavadoc(LookupImpl lookup) {
|
||||
if (myActiveLookup != lookup) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user