use of java.awt.CheckboxMenuItem in project jdk8u_jdk by JetBrains.
the class CCheckboxMenuItem method handleAction.
public void handleAction(final boolean state) {
final CheckboxMenuItem target = (CheckboxMenuItem) getTarget();
SunToolkit.executeOnEventHandlerThread(target, new Runnable() {
public void run() {
target.setState(state);
}
});
ItemEvent event = new ItemEvent(target, ItemEvent.ITEM_STATE_CHANGED, target.getLabel(), state ? ItemEvent.SELECTED : ItemEvent.DESELECTED);
SunToolkit.postEvent(SunToolkit.targetToAppContext(getTarget()), event);
}
use of java.awt.CheckboxMenuItem in project jdk8u_jdk by JetBrains.
the class WCheckboxMenuItemPeer method handleAction.
// native callbacks
public void handleAction(final boolean state) {
final CheckboxMenuItem target = (CheckboxMenuItem) this.target;
WToolkit.executeOnEventHandlerThread(target, new Runnable() {
@Override
public void run() {
target.setState(state);
postEvent(new ItemEvent(target, ItemEvent.ITEM_STATE_CHANGED, target.getLabel(), (state) ? ItemEvent.SELECTED : ItemEvent.DESELECTED));
}
});
}
use of java.awt.CheckboxMenuItem in project jdk8u_jdk by JetBrains.
the class AWTInputMethodPopupMenu method addMenuItem.
void addMenuItem(Object targetMenu, String label, String command, String currentSelection) {
MenuItem menuItem;
if (isSelected(command, currentSelection)) {
menuItem = new CheckboxMenuItem(label, true);
} else {
menuItem = new MenuItem(label);
}
menuItem.setActionCommand(command);
menuItem.addActionListener(this);
menuItem.setEnabled(command != null);
((Menu) targetMenu).add(menuItem);
}
Aggregations