icon = (Image)button.getStyles().get("checkmarkImage");
}
// Update the image view
Menu.Item menuItem = (Menu.Item)button;
Menu menu = (Menu)menuItem.getParent();
int margin = (Integer)menu.getStyles().get("margin");
Insets padding = (Insets)getStyles().get("padding");
imageView.setImage(icon);
imageView.setPreferredWidth(margin - padding.left * 2);
imageView.getStyles().put("opacity", button.isEnabled() ? 1.0f : 0.5f);
// Update the labels
textLabel.setText(text != null ? text : "");
Font font = (Font)menu.getStyles().get("font");
textLabel.getStyles().put("font", font);
keyboardShortcutLabel.getStyles().put("font", font.deriveFont(Font.ITALIC));
Color color;
if (button.isEnabled()) {
if (highlighted) {
color = (Color)menu.getStyles().get("activeColor");
} else {
color = (Color)menu.getStyles().get("color");
}
} else {
color = (Color)menu.getStyles().get("disabledColor");
}
textLabel.getStyles().put("color", color);
keyboardShortcutLabel.getStyles().put("color", color);
boolean showKeyboardShortcuts = false;
if (menu.getStyles().containsKey("showKeyboardShortcuts")) {
showKeyboardShortcuts = (Boolean)menu.getStyles().get("showKeyboardShortcuts");
}
if (showKeyboardShortcuts) {
keyboardShortcutLabel.setVisible(true);
keyboardShortcutLabel.setText(