1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
def newButton = ActionFX.button(actionMap.get("NewAction") as ActionFX);
def openButton = ActionFX.button(actionMap.get("OpenAction") as ActionFX);
def closeButton = ActionFX.button(actionMap.get("CloseAction") as ActionFX);
def saveButton = ActionFX.button(actionMap.get("SaveAction") as ActionFX);
def saveAsButton = ActionFX.button(actionMap.get("SaveAsAction") as ActionFX);
def copyButton = ActionFX.button(actionMap.get("CopyAction") as ActionFX);
def cutButton = ActionFX.button(actionMap.get("CutAction") as ActionFX);
def pasteButton = ActionFX.button(actionMap.get("PasteAction") as ActionFX);
[...]
/**
* Creates a button out of the provided action.
* <br/>The button's text will not be shown.
* @param action The action.
* @return A <code>SwingButton</code> instance.
*/
public function button(action:ActionFX):SwingButton {
return button(action, false);
}
/**
* Creates a button out of the provided action.
* @param action The action.
* @param showText Indicates whether the button's text should be shown.
* @return A <code>SwingButton</code> instance.
*/
public function button(action:ActionFX, showText:Boolean):SwingButton {
// Hack: declare final to avoid a compiler crash.
def a = action;
def result = SwingButton {
name: bind a.name;
text: bind if (showText) { a.name } else { null };
icon: bind if (a.largeIcon == null) { a.smallIcon } else { a.largeIcon };
enabled: bind a.enabled;
action: bind a.action;
}
return result;
} |