nice popup adjuster not in ctrl+n only

This commit is contained in:
Konstantin Bulenkov
2012-01-25 20:17:56 +01:00
parent bbfb1d46fd
commit 305d97ec30
3 changed files with 7 additions and 7 deletions
@@ -56,6 +56,6 @@ public class LangDataKeys extends PlatformDataKeys {
public static final DataKey<ConsoleView> CONSOLE_VIEW = DataKey.create("consoleView");
public static final DataKey<JBPopup> CHOOSE_BY_NAME_DROPDOWN = DataKey.create("chooseByNameDropDown");
public static final DataKey<JBPopup> CHOOSE_BY_NAME_POPUP = DataKey.create("chooseByNamePopup");
public static final DataKey<JBPopup> POSITION_ADJUSTER_POPUP = DataKey.create("chooseByNameDropDown");
public static final DataKey<JBPopup> PARENT_POPUP = DataKey.create("chooseByNamePopup");
}
@@ -1159,11 +1159,11 @@ public abstract class ChooseByNameBase {
@Override
public void calcData(final DataKey key, final DataSink sink) {
if (LangDataKeys.CHOOSE_BY_NAME_DROPDOWN.equals(key)) {
if (LangDataKeys.POSITION_ADJUSTER_POPUP.equals(key)) {
if (myDropdownPopup != null && myDropdownPopup.isVisible()) {
sink.put(key, myDropdownPopup);
}
} else if (LangDataKeys.CHOOSE_BY_NAME_POPUP.equals(key)) {
} else if (LangDataKeys.PARENT_POPUP.equals(key)) {
if (myTextPopup != null && myTextPopup.isVisible()) {
sink.put(key, myTextPopup);
}
@@ -88,9 +88,9 @@ public class PopupPositionManager {
return new PositionAdjuster(SwingUtilities.getWindowAncestor(focusOwner));
}
final Component existing = discoverPopup(LangDataKeys.CHOOSE_BY_NAME_DROPDOWN, focusOwner);
final Component existing = discoverPopup(LangDataKeys.POSITION_ADJUSTER_POPUP, focusOwner);
if (existing != null) {
return new PositionAdjuster2(existing, discoverPopup(LangDataKeys.CHOOSE_BY_NAME_POPUP, focusOwner));
return new PositionAdjuster2(existing, discoverPopup(LangDataKeys.PARENT_POPUP, focusOwner));
}
//final Window window = SwingUtilities.getWindowAncestor(focusOwner);
@@ -104,7 +104,7 @@ public class PopupPositionManager {
private PositionAdjuster2(final Component relativeTo, final Component topComponent) {
super(relativeTo);
myTopComponent = topComponent;
myTopComponent = topComponent == null ? relativeTo : topComponent;
}
@Override