mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Add ComboBox with animated icon inside
GitOrigin-RevId: fcf23ab82f175f345ce302899dfd451e7d355923
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f850d60198
commit
a84c574ef5
@@ -516,6 +516,31 @@ public class ComponentPanelTestAction extends DumbAwareAction {
|
||||
.withValidator(() -> "Two".equals(eComboBox.getSelectedItem()) ? new ValidationInfo("Two is not preferred", eComboBox).asWarning() : null)
|
||||
.installOn(eComboBox);
|
||||
|
||||
ComboBox<String> animatedIconComboBox = new ComboBox<>();
|
||||
animatedIconComboBox.setEditable(true);
|
||||
animatedIconComboBox.setEditor(new BasicComboBoxEditor(){
|
||||
@Override
|
||||
protected JTextField createEditorComponent() {
|
||||
ExtendableTextField cbEditor = new ExtendableTextField();
|
||||
cbEditor.addExtension(new ExtendableTextComponent.Extension() {
|
||||
private final Icon icon = new AnimatedIcon.FS();
|
||||
|
||||
@Override
|
||||
public Icon getIcon(boolean hovered) {
|
||||
return !hovered ? icon : AllIcons.Process.FS.Step_passive;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return "Refresh";
|
||||
}
|
||||
});
|
||||
cbEditor.setEditable(false);
|
||||
cbEditor.setBorder(null);
|
||||
return cbEditor;
|
||||
}
|
||||
});
|
||||
|
||||
// Panels factory
|
||||
return UI.PanelFactory.grid().
|
||||
add(UI.PanelFactory.panel(tfbb).
|
||||
@@ -530,6 +555,9 @@ public class ComponentPanelTestAction extends DumbAwareAction {
|
||||
add(UI.PanelFactory.panel(eComboBox).
|
||||
withLabel("ComboBox &extendable:").withComment("ComboBox with ExtendableTextEditor")).
|
||||
|
||||
add(UI.PanelFactory.panel(animatedIconComboBox).
|
||||
withLabel("&Animated combobox:").withComment("ComboBox with animated icon")).
|
||||
|
||||
createPanel();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user