/** * Sets the orientation of this component. This is overridden to also * update the orientation of the popup menu. * * @param o The new orientation. */ @Override public void applyComponentOrientation(ComponentOrientation o) { super.applyComponentOrientation(o); if (popupMenu!=null) { popupMenu.applyComponentOrientation(o); } }
@Override public void applyComponentOrientation(ComponentOrientation o) { super.applyComponentOrientation(o); getColumnControlPopup().applyComponentOrientation(o); }
@Override public void applyComponentOrientation(ComponentOrientation o) { super.applyComponentOrientation(o); getColumnControlPopup().applyComponentOrientation(o); }
@Override public void applyComponentOrientation(ComponentOrientation o) { super.applyComponentOrientation(o); getColumnControlPopup().applyComponentOrientation(o); }
@Override public void applyComponentOrientation(ComponentOrientation o) { super.applyComponentOrientation(o); getColumnControlPopup().applyComponentOrientation(o); }
@Override public void applyComponentOrientation(ComponentOrientation o) { super.applyComponentOrientation(o); getColumnControlPopup().applyComponentOrientation(o); }
/** * @return A new JButton with default styling */ public static JButton newButton(Action action) { // The action resets all text JButton button = new JButton(action); // Ensure borders render smoothly button.setOpaque(false); // Reinforce the idea of clicking button.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); // Ensure we use the correct component orientation button.applyComponentOrientation(Languages.currentComponentOrientation()); // Apply default theme (do not set foreground color) NimbusDecorator.applyThemeColor(Themes.currentTheme.buttonBackground(), button); return button; }
/** * <p>Align the icon according to the locale (leading or trailing)</p> * * @param button The button (iconography will change will changes to the label color and font) * @param leading True if the icon comes before the text in the reading direction (LTR and RTL is handled automatically) */ private static void align(JButton button, boolean leading) { button.applyComponentOrientation(ComponentOrientation.getOrientation(Languages.currentLocale())); if (leading) { // Text trails the icon in LTR button.setHorizontalTextPosition(SwingConstants.TRAILING); } else { button.setHorizontalTextPosition(SwingConstants.LEADING); } }