final PMenuBar fileBar = new PMenuBar(vertical);
menuBar.addItem("File", fileBar);
final PMenuItem newItem = new PMenuItem("New");
newItem.setCommand(new PCommand() {
@Override
public void execute() {
PNotificationManager.notify("Menu Selection, " + newItem.getText(), Notification.HUMANIZED);
}
});
final PMenuItem openItem = new PMenuItem("Open");
openItem.setCommand(new PCommand() {
@Override
public void execute() {
PNotificationManager.notify("Menu Selection, " + openItem.getText(), Notification.HUMANIZED);
}
});
final PMenuItem closeItem = new PMenuItem("Close");
openItem.setCommand(new PCommand() {
@Override
public void execute() {
PNotificationManager.notify("Menu Selection, " + closeItem.getText(), Notification.HUMANIZED);
}
});
fileBar.addItem(newItem);
fileBar.addItem(openItem);
fileBar.addItem(closeItem);
fileBar.addSeparator();
final PMenuBar recentItem = new PMenuBar(vertical);
fileBar.addItem("Recent", recentItem);
final PMenuItem recent1 = new PMenuItem("recent1");
recent1.setCommand(new PCommand() {
@Override
public void execute() {
PNotificationManager.notify("Menu Selection, " + recent1.getText(), Notification.HUMANIZED);
}
});
final PMenuItem recent2 = new PMenuItem("recent2");
recent2.setCommand(new PCommand() {
@Override
public void execute() {
PNotificationManager.notify("Menu Selection, " + recent2.getText(), Notification.HUMANIZED);
}