public class Menus implements Application {
private Window window = null;
private TabPane tabPane = null;
public Menus() {
Action.getNamedActions().put("fileNew", new Action() {
@Override
public void perform() {
// TODO Read document.wtkx
Panel panel = new Panel();
tabPane.getTabs().add(panel);
TabPane.setLabel(panel, "Document " + tabPane.getTabs().getLength());
}
});
Action.getNamedActions().put("fileOpen", new Action() {
@Override
public void perform() {
FileBrowserSheet fileBrowserSheet = new FileBrowserSheet(FileBrowserSheet.Mode.OPEN);
fileBrowserSheet.open(window);
}
});
Action.getNamedActions().put("cut", new Action() {
@Override
public void perform() {
TextInput textInput = (TextInput)window.getFocusDescendant();
textInput.cut();
}
});
Action.getNamedActions().put("copy", new Action() {
@Override
public void perform() {
TextInput textInput = (TextInput)window.getFocusDescendant();
textInput.copy();
}
});
Action.getNamedActions().put("paste", new Action() {
@Override
public void perform() {
TextInput textInput = (TextInput)window.getFocusDescendant();
textInput.paste();
}