Button d;
+ Button e;
+
private AbstractField f;
public void init() {
main.addComponent(d);
d = new Button("Click to focus Textfield", this, "setFocusF");
main.addComponent(d);
+ e = new Button("Test buton", this, "buttonEHandler");
+ e.addActionHandler(this);
+ main.addComponent(e);
f.focus();
}
ShortcutAction.KeyCode.C, new int[] {
ShortcutAction.ModifierKey.CTRL,
ShortcutAction.ModifierKey.SHIFT });
+ } else if (sender == e) {
+ actions = new Action[5];
+ actions[0] = (Action) new ShortcutAction("Button E action A",
+ ShortcutAction.KeyCode.A, null);
+ actions[1] = (Action) new ShortcutAction("Button E action B",
+ ShortcutAction.KeyCode.B, null);
+ actions[2] = (Action) new ShortcutAction("Button E action F1",
+ ShortcutAction.KeyCode.F1, null);
+ actions[3] = (Action) new ShortcutAction("Button E action F2",
+ ShortcutAction.KeyCode.F2, null);
+ actions[4] = (Action) new ShortcutAction("Button E action F3",
+ ShortcutAction.KeyCode.F3, null);
} else if (sender == a) {
actions[0] = (Action) new ShortcutAction("Button a action",
ShortcutAction.KeyCode.A,
this.buttonBHandler();
if (target == c)
this.buttonCHandler();
+ if (target == e)
+ this.buttonEHandler();
if (target == close)
this.close();
}
public void buttonCHandler() {
main.addComponent(new Label("Button C handler fired"));
}
+ public void buttonEHandler() {
+ main.addComponent(new Label("Button E handler fired"));
+ }
}