mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix option button tooltip text
This commit is contained in:
@@ -15,7 +15,6 @@ import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ModalityState;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.help.HelpManager;
|
||||
import com.intellij.openapi.keymap.KeymapUtil;
|
||||
import com.intellij.openapi.project.DumbAwareAction;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.popup.*;
|
||||
@@ -56,6 +55,8 @@ import java.util.*;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.intellij.openapi.keymap.KeymapUtil.getKeystrokeText;
|
||||
|
||||
/**
|
||||
* The standard base class for modal dialog boxes. The dialog wrapper could be used only on event dispatch thread.
|
||||
* In case when the dialog must be created from other threads use
|
||||
@@ -738,9 +739,9 @@ public abstract class DialogWrapper {
|
||||
@NotNull
|
||||
private JButton createJOptionsButton(@NotNull OptionAction action) {
|
||||
JBOptionButton optionButton = new JBOptionButton(action, action.getOptions());
|
||||
String tooltip = String.format("Show drop-down menu (%s)", getKeystrokeText(SHOW_OPTION_KEYSTROKE));
|
||||
optionButton.setOptionTooltipText(tooltip);
|
||||
optionButton.setOkToProcessDefaultMnemonics(false);
|
||||
optionButton.setOptionTooltipText(
|
||||
"Press " + KeymapUtil.getKeystrokeText(SHOW_OPTION_KEYSTROKE) + " to expand or use a mnemonic of a contained action");
|
||||
|
||||
final Set<JBOptionButton.OptionInfo> infos = optionButton.getOptionInfos();
|
||||
for (final JBOptionButton.OptionInfo eachInfo : infos) {
|
||||
@@ -1867,7 +1868,7 @@ public abstract class DialogWrapper {
|
||||
|
||||
private void recordAction(String name, AWTEvent event) {
|
||||
if (event instanceof KeyEvent) {
|
||||
String shortcut = KeymapUtil.getKeystrokeText(KeyStroke.getKeyStrokeForEvent((KeyEvent)event));
|
||||
String shortcut = getKeystrokeText(KeyStroke.getKeyStrokeForEvent((KeyEvent)event));
|
||||
ActionsCollector.getInstance().record(name + " " + shortcut);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,11 +81,7 @@ public class JBOptionButton extends JButton implements Weighted {
|
||||
|
||||
@Override
|
||||
public String getToolTipText(MouseEvent event) {
|
||||
if (!isSimpleButton() && myMoreRec.x < event.getX()) {
|
||||
return myOptionTooltipText;
|
||||
} else {
|
||||
return super.getToolTipText(event);
|
||||
}
|
||||
return !isSimpleButton() ? myOptionTooltipText : super.getToolTipText(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user