mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
let lookup iself hide when the editor is hidden (EA-40772)
This commit is contained in:
@@ -73,6 +73,8 @@ import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.ui.AbstractLayoutManager;
|
||||
import com.intellij.util.ui.AsyncProcessIcon;
|
||||
import com.intellij.util.ui.ButtonlessScrollBarUI;
|
||||
import com.intellij.util.ui.update.Activatable;
|
||||
import com.intellij.util.ui.update.UiNotifyConnector;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
@@ -85,8 +87,10 @@ import javax.swing.event.ListSelectionEvent;
|
||||
import javax.swing.event.ListSelectionListener;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.util.*;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class LookupImpl extends LightweightHint implements LookupEx, Disposable {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.lookup.impl.LookupImpl");
|
||||
@@ -872,6 +876,17 @@ public class LookupImpl extends LightweightHint implements LookupEx, Disposable
|
||||
}
|
||||
});
|
||||
|
||||
Disposer.register(this, new UiNotifyConnector(myEditor.getContentComponent(), new Activatable() {
|
||||
@Override
|
||||
public void showNotify() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideNotify() {
|
||||
hideLookup(false);
|
||||
}
|
||||
}));
|
||||
|
||||
myList.addListSelectionListener(new ListSelectionListener() {
|
||||
private LookupElement oldItem = null;
|
||||
|
||||
|
||||
@@ -41,8 +41,6 @@ import com.intellij.psi.PsiFile;
|
||||
import com.intellij.ui.LightweightHint;
|
||||
import com.intellij.util.Alarm;
|
||||
import com.intellij.util.messages.MessageBus;
|
||||
import com.intellij.util.ui.update.Activatable;
|
||||
import com.intellij.util.ui.update.UiNotifyConnector;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
|
||||
@@ -138,17 +136,6 @@ public class LookupManagerImpl extends LookupManager {
|
||||
final LookupImpl lookup = new LookupImpl(myProject, editor, arranger);
|
||||
DaemonCodeAnalyzer.getInstance(myProject).disableUpdateByTimer(lookup);
|
||||
|
||||
final UiNotifyConnector connector = new UiNotifyConnector(editor.getContentComponent(), new Activatable() {
|
||||
@Override
|
||||
public void showNotify() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideNotify() {
|
||||
hideActiveLookup();
|
||||
}
|
||||
});
|
||||
|
||||
final Alarm alarm = new Alarm();
|
||||
final Runnable request = new Runnable() {
|
||||
@Override
|
||||
@@ -204,8 +191,6 @@ public class LookupManagerImpl extends LookupManager {
|
||||
myActiveLookupEditor = null;
|
||||
lookup.removeLookupListener(this);
|
||||
myPropertyChangeSupport.firePropertyChange(PROP_ACTIVE_LOOKUP, lookup, null);
|
||||
|
||||
Disposer.dispose(connector);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user