mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't show overload switch prompt for lookup hint
This commit is contained in:
@@ -91,10 +91,11 @@ public class ParameterInfoComponent extends JPanel {
|
||||
}
|
||||
|
||||
ParameterInfoComponent(Object[] objects, Editor editor, @NotNull ParameterInfoHandler handler) {
|
||||
this(objects, editor, handler, false);
|
||||
this(objects, editor, handler, false, false);
|
||||
}
|
||||
|
||||
ParameterInfoComponent(Object[] objects, Editor editor, @NotNull ParameterInfoHandler handler, boolean requestFocus) {
|
||||
ParameterInfoComponent(Object[] objects, Editor editor, @NotNull ParameterInfoHandler handler,
|
||||
boolean requestFocus, boolean allowSwitchLabel) {
|
||||
super(new BorderLayout());
|
||||
myRequestFocus = requestFocus;
|
||||
|
||||
@@ -131,7 +132,8 @@ public class ParameterInfoComponent extends JPanel {
|
||||
|
||||
String upShortcut = KeymapUtil.getFirstKeyboardShortcutText(IdeActions.ACTION_METHOD_OVERLOAD_SWITCH_UP);
|
||||
String downShortcut = KeymapUtil.getFirstKeyboardShortcutText(IdeActions.ACTION_METHOD_OVERLOAD_SWITCH_DOWN);
|
||||
if (upShortcut.isEmpty() && downShortcut.isEmpty()) {
|
||||
if (!allowSwitchLabel || myObjects.length <= 1 || !myHandler.supportsOverloadSwitching() ||
|
||||
upShortcut.isEmpty() && downShortcut.isEmpty()) {
|
||||
myShortcutLabel = null;
|
||||
}
|
||||
else {
|
||||
@@ -277,9 +279,7 @@ public class ParameterInfoComponent extends JPanel {
|
||||
}
|
||||
}
|
||||
|
||||
if (myShortcutLabel != null) {
|
||||
myShortcutLabel.setVisible(!singleParameterInfo && myObjects.length > 1 && myHandler.supportsOverloadSwitching());
|
||||
}
|
||||
if (myShortcutLabel != null) myShortcutLabel.setVisible(!singleParameterInfo);
|
||||
|
||||
invalidate();
|
||||
validate();
|
||||
|
||||
@@ -149,7 +149,7 @@ public class ParameterInfoController implements Disposable {
|
||||
myHandler = handler;
|
||||
myProvider = new MyBestLocationPointProvider(editor);
|
||||
myLbraceMarker = editor.getDocument().createRangeMarker(lbraceOffset, lbraceOffset);
|
||||
myComponent = new ParameterInfoComponent(descriptors, editor, handler, requestFocus);
|
||||
myComponent = new ParameterInfoComponent(descriptors, editor, handler, requestFocus, true);
|
||||
myHint = new LightweightHint(myComponent);
|
||||
myKeepOnHintHidden = !showHint;
|
||||
mySingleParameterInfo = !showHint;
|
||||
|
||||
@@ -143,7 +143,7 @@ public class ShowParameterInfoHandler implements CodeInsightActionHandler {
|
||||
final Project project,
|
||||
ParameterInfoHandler handler,
|
||||
boolean requestFocus) {
|
||||
ParameterInfoComponent component = new ParameterInfoComponent(descriptors, editor, handler, requestFocus);
|
||||
ParameterInfoComponent component = new ParameterInfoComponent(descriptors, editor, handler, requestFocus, false);
|
||||
component.update(false);
|
||||
|
||||
final LightweightHint hint = new LightweightHint(component);
|
||||
|
||||
Reference in New Issue
Block a user