use of javax.swing.plaf.ComboBoxUI in project android by JetBrains.
the class GradleEditorComboBoxEditor method getComboboxPopup.
@Nullable
private static ComboPopup getComboboxPopup(final JComboBox comboBox) {
final ComboBoxUI ui = comboBox.getUI();
ComboPopup popup = null;
if (ui instanceof BasicComboBoxUI) {
try {
final Field popupField = BasicComboBoxUI.class.getDeclaredField("popup");
popupField.setAccessible(true);
popup = (ComboPopup) popupField.get(ui);
} catch (NoSuchFieldException e1) {
popup = null;
} catch (IllegalAccessException e1) {
popup = null;
}
}
return popup;
}
use of javax.swing.plaf.ComboBoxUI in project intellij-community by JetBrains.
the class FixedComboBoxEditor method getComboboxPopup.
@Nullable
private static ComboPopup getComboboxPopup(final JComboBox comboBox) {
final ComboBoxUI ui = comboBox.getUI();
ComboPopup popup = null;
if (ui instanceof BasicComboBoxUI) {
popup = ReflectionUtil.getField(BasicComboBoxUI.class, ui, ComboPopup.class, "popup");
}
return popup;
}
Aggregations