package com.sun.glass.ui;
import com.sun.glass.events.KeyEvent;
import com.sun.glass.ui.delegate.MenuItemDelegate;
public final class {
public interface {
public void ();
public void ();
}
public static final MenuItem = null;
private final MenuItemDelegate ;
private String ;
private Callback ;
private boolean ;
private boolean ;
private int ;
private int ;
protected (String title) {
this(title, null);
}
protected (String title, Callback callback) {
this(title, callback, KeyEvent.VK_UNDEFINED, KeyEvent.MODIFIER_NONE);
}
protected (String title, Callback callback,
int shortcutKey, int shortcutModifiers) {
this(title, callback, shortcutKey, shortcutModifiers, null);
}
protected (String title, Callback callback,
int shortcutKey, int shortcutModifiers, Pixels pixels) {
Application.checkEventThread();
this.title = title;
this.callback = callback;
this.shortcutKey = shortcutKey;
this.shortcutModifiers = shortcutModifiers;
enabled = true;
checked = false;
delegate = PlatformFactory.getPlatformFactory().createMenuItemDelegate(this);
if (!delegate.createMenuItem(title, callback,
shortcutKey, shortcutModifiers, pixels, enabled, checked)) {
throw new RuntimeException("MenuItem creation error.");
}
}
public String () {
Application.checkEventThread();
return title;
}
public void (String title) {
Application.checkEventThread();
if (delegate.setTitle(title)) {
this.title = title;
}
}
public Callback () {
Application.checkEventThread();
return callback;
}
public void (Callback callback) {
Application.checkEventThread();
if (delegate.setCallback(callback)) {
this.callback = callback;
}
}
public boolean () {
Application.checkEventThread();
return enabled;
}
public void (boolean enabled) {
Application.checkEventThread();
if (delegate.setEnabled(enabled)) {
this.enabled = enabled;
}
}
public boolean () {
Application.checkEventThread();
return checked;
}
public void (boolean checked) {
Application.checkEventThread();
if (delegate.setChecked(checked)) {
this.checked = checked;
}
}
public int () {
Application.checkEventThread();
return shortcutKey;
}
public int () {
Application.checkEventThread();
return shortcutModifiers;
}
public void (int shortcutKey, int shortcutModifiers) {
Application.checkEventThread();
if (delegate.setShortcut(shortcutKey, shortcutModifiers)) {
this.shortcutKey = shortcutKey;
this.shortcutModifiers = shortcutModifiers;
}
}
public boolean (Pixels pixels) {
Application.checkEventThread();
return (delegate.setPixels(pixels));
}
MenuItemDelegate () {
return delegate;
}
}