mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
notnull, cleanup
GitOrigin-RevId: 0344990fb530e958940ce6155c88a63859eca4f3
This commit is contained in:
committed by
intellij-monorepo-bot
parent
42deff2c7a
commit
b768fa05f2
@@ -724,10 +724,10 @@ public abstract class PerFileConfigurableBase<T> implements SearchableConfigurab
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ComboBoxButton createComboBoxButton(Presentation presentation) {
|
||||
protected @NotNull ComboBoxButton createComboBoxButton(@NotNull Presentation presentation) {
|
||||
return new ComboBoxButton(presentation) {
|
||||
@Override
|
||||
protected JBPopup createPopup(Runnable onDispose) {
|
||||
protected @NotNull JBPopup createPopup(Runnable onDispose) {
|
||||
JBPopup popup = createValueEditorPopup(target, value.get(), onDispose, getDataContext(), o -> {
|
||||
value.set(o);
|
||||
updateText(presentation);
|
||||
|
||||
@@ -41,6 +41,7 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
|
||||
private static Icon myIcon;
|
||||
private static Icon myDisabledIcon;
|
||||
|
||||
@NotNull
|
||||
public static Icon getArrowIcon(boolean enabled) {
|
||||
if (myIcon != AllIcons.General.ArrowDown) {
|
||||
myIcon = UIManager.getIcon("ComboBoxButton.arrowIcon");
|
||||
@@ -98,7 +99,8 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
|
||||
return panel;
|
||||
}
|
||||
|
||||
protected ComboBoxButton createComboBoxButton(Presentation presentation) {
|
||||
@NotNull
|
||||
protected ComboBoxButton createComboBoxButton(@NotNull Presentation presentation) {
|
||||
return new ComboBoxButton(presentation);
|
||||
}
|
||||
|
||||
@@ -110,7 +112,7 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
|
||||
mySmallVariant = smallVariant;
|
||||
}
|
||||
|
||||
public void setPopupTitle(@NlsContexts.PopupTitle String popupTitle) {
|
||||
public void setPopupTitle(@NotNull @NlsContexts.PopupTitle String popupTitle) {
|
||||
myPopupTitle = popupTitle;
|
||||
}
|
||||
|
||||
@@ -122,7 +124,7 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
|
||||
protected abstract DefaultActionGroup createPopupActionGroup(JComponent button);
|
||||
|
||||
@NotNull
|
||||
protected DefaultActionGroup createPopupActionGroup(JComponent button, @NotNull DataContext dataContext) {
|
||||
protected DefaultActionGroup createPopupActionGroup(@NotNull JComponent button, @NotNull DataContext dataContext) {
|
||||
return createPopupActionGroup(button);
|
||||
}
|
||||
|
||||
@@ -143,7 +145,7 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
|
||||
private boolean myForcePressed;
|
||||
private @TooltipTitle String myTooltipText;
|
||||
|
||||
public ComboBoxButton(Presentation presentation) {
|
||||
public ComboBoxButton(@NotNull Presentation presentation) {
|
||||
myPresentation = presentation;
|
||||
|
||||
setIcon(myPresentation.getIcon());
|
||||
@@ -208,6 +210,7 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
@NotNull
|
||||
public Presentation getPresentation() {
|
||||
return myPresentation;
|
||||
}
|
||||
@@ -250,10 +253,12 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
|
||||
popup.showUnderneathOf(this);
|
||||
}
|
||||
|
||||
protected JBPopup createPopup(Runnable onDispose) {
|
||||
@NotNull
|
||||
protected JBPopup createPopup(@Nullable Runnable onDispose) {
|
||||
return createActionPopup(getDataContext(), this, onDispose);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected DataContext getDataContext() {
|
||||
return ActionToolbar.getDataContextFor(this);
|
||||
}
|
||||
@@ -276,7 +281,8 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
|
||||
if (Registry.is("ide.helptooltip.enabled") && StringUtil.isNotEmpty(myTooltipText)) {
|
||||
String shortcut = KeymapUtil.getFirstKeyboardShortcutText(ComboBoxAction.this);
|
||||
new HelpTooltip().setTitle(myTooltipText).setShortcut(shortcut).installOn(this);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
String tooltip = KeymapUtil.createTooltipText(myTooltipText, ComboBoxAction.this);
|
||||
setToolTipText(!tooltip.isEmpty() ? tooltip : null);
|
||||
}
|
||||
@@ -374,7 +380,8 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override public void updateUI() {
|
||||
@Override
|
||||
public void updateUI() {
|
||||
super.updateUI();
|
||||
updateMargin();
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public class SwitchTaskAction extends ComboBoxAction implements DumbAware {
|
||||
public JComponent createCustomComponent(@NotNull final Presentation presentation, @NotNull String place) {
|
||||
return new ComboBoxButton(presentation) {
|
||||
@Override
|
||||
protected JBPopup createPopup(Runnable onDispose) {
|
||||
protected @NotNull JBPopup createPopup(Runnable onDispose) {
|
||||
return SwitchTaskAction.createPopup(DataManager.getInstance().getDataContext(this), onDispose, false);
|
||||
}
|
||||
};
|
||||
|
||||
+2
-2
@@ -69,11 +69,11 @@ public abstract class AbstractComboBoxAction<T> extends ComboBoxAction {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ComboBoxButton createComboBoxButton(Presentation presentation) {
|
||||
protected @NotNull ComboBoxButton createComboBoxButton(@NotNull Presentation presentation) {
|
||||
if (myShowDisabledActions) {
|
||||
return new ComboBoxButton(presentation) {
|
||||
@Override
|
||||
protected JBPopup createPopup(Runnable onDispose) {
|
||||
protected @NotNull JBPopup createPopup(Runnable onDispose) {
|
||||
ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup(null, createPopupActionGroup(this), getDataContext(), true, onDispose, getMaxRows());
|
||||
popup.setMinimumSize(new Dimension(getMinWidth(), getMinHeight()));
|
||||
return popup;
|
||||
|
||||
Reference in New Issue
Block a user