mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
nice popup adjuster not in ctrl+n only
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user