protected boolean checkPanel() { boolean v = panel.isValid(true); for (Button button : buttons) { if (v != button.isEnabled()) { button.setEnabled(v); } } return v; }
/** * Force (set) button icons. This method ignores the application wide BUTTON_ICONS constant, and * always applies the icons if supplied. * * @param button * @param iconName */ public static void forceIcon(Button button, String iconName) { if (button != null && iconName != null && iconName.length() > 0) { button.setIcon(getButtonIcon(iconName, button.isEnabled())); } }
/** * Set button icons... application wide use of button icons can be toggled on and off by setting * the BUTTON_ICONS constant. * * <p>Icons will be used, despite any BUTTON_ICONS setting, if the button has no label. * * @param button * @param iconName */ public static void setIcon(Button button, String iconName) { if (button != null && iconName != null && iconName.length() > 0) { if (BUTTON_ICONS || button.getText() == null || button.getText().length() == 0) button.setIcon(getButtonIcon(iconName, button.isEnabled())); } }