public static boolean isSynthUI(final MenuItemUI ui) { Class<?> aClass = ui.getClass(); while (aClass != null && aClass.getSimpleName().contains("Synth")) { final Class<?>[] interfaces = aClass.getInterfaces(); for (int i = 0, length = interfaces.length; i < length; i++) { final Class<?> anInterface = interfaces[i]; if (V6_SYNTH_UI_CLASS.equals(anInterface.getName()) || V7_SYNTH_UI_CLASS.equals(anInterface.getName())) { return true; } } aClass = aClass.getSuperclass(); } return false; }
/** * Maps {@code JMenuItem.setUI(MenuItemUI)} through queue */ public void setUI(final MenuItemUI menuItemUI) { runMapping(new MapVoidAction("setUI") { @Override public void map() { ((JMenuItem) getSource()).setUI(menuItemUI); } }); }
public static SynthContext getSynthContext(final MenuItemUI ui, final JComponent item) { assert Patches.USE_REFLECTION_TO_ACCESS_JDK7; try { final Method getContext = ui.getClass().getMethod("getContext", JComponent.class); getContext.setAccessible(true); return (SynthContext)getContext.invoke(ui, item); } catch (Exception e) { throw new RuntimeException(e); } }
@Override public void updateUI() { setUI((MenuItemUI) UIManager.getUI(this)); if(popupMenu != null) { popupMenu.setUI((PopupMenuUI) UIManager.getUI(popupMenu)); } }
@Override public void updateUI() { setUI((MenuItemUI) UIManager.getUI(this)); if (popupMenu != null) { popupMenu.setUI((PopupMenuUI) UIManager.getUI(popupMenu)); } }
public void setUI(MenuItemUI ui) { super.setUI(ui); }
/** * This method sets this menuItem's UI to the UIManager's default for the * current look and feel. */ public void updateUI() { setUI((MenuItemUI) UIManager.getUI(this)); }
@Override public void setUI(final MenuItemUI ui) { final MenuItemUI newUi = !myTopLevel && UIUtil.isUnderGTKLookAndFeel() && GtkMenuUI.isUiAcceptable(ui) ? new GtkMenuUI(ui) : ui; super.setUI(newUi); }
@Override public void setUI(final MenuItemUI ui) { final MenuItemUI newUi = UIUtil.isUnderGTKLookAndFeel() && GtkMenuItemUI.isUiAcceptable(ui) ? new GtkMenuItemUI(ui) : ui; super.setUI(newUi); }
public GtkMenuUI(final MenuItemUI originalUI) { assert isUiAcceptable(originalUI) : originalUI; myOriginalUI = (BasicMenuUI)originalUI; }
public static boolean isUiAcceptable(final MenuItemUI ui) { return ui instanceof BasicMenuUI && GtkPaintingUtil.isSynthUI(ui); }
public IconWrapper(final Icon icon, final MenuItemUI originalUI) { myIcon = icon; myOriginalUI = originalUI; }
public GtkMenuItemUI(final MenuItemUI originalUI) { assert isUiAcceptable(originalUI) : originalUI; myOriginalUI = (BasicMenuItemUI)originalUI; }
public static boolean isUiAcceptable(final MenuItemUI ui) { return ui instanceof BasicMenuItemUI && GtkPaintingUtil.isSynthUI(ui); }
public void setUI(final MenuItemUI ui) { super.setUI(ui); }
public void updateUI() { setUI((MenuItemUI)UIManager.getUI(this)); }