mirror of
https://github.com/aNNiMON/HotaruFX.git
synced 2024-09-19 14:14:21 +03:00
Add play toolbar button
This commit is contained in:
parent
e76f27b66e
commit
cd0385e74d
@ -16,7 +16,8 @@ public class FontAwesome {
|
||||
public static final String
|
||||
UNDO = "\uf0e2",
|
||||
REDO = "\uf01e",
|
||||
CLIPBOARD = "\uf0ea"
|
||||
CLIPBOARD = "\uf0ea",
|
||||
PLAY = "\uf04b"
|
||||
;
|
||||
|
||||
static final Map<String, String> MAPPING;
|
||||
@ -25,5 +26,6 @@ public class FontAwesome {
|
||||
MAPPING.put("undo", UNDO);
|
||||
MAPPING.put("redo", REDO);
|
||||
MAPPING.put("clipboard", CLIPBOARD);
|
||||
MAPPING.put("play", PLAY);
|
||||
}
|
||||
}
|
||||
|
@ -95,7 +95,9 @@ public class EditorController implements Initializable, DocumentListener {
|
||||
private void handleMenuPlay(ActionEvent event) {
|
||||
log.setText("");
|
||||
val input = editor.getText();
|
||||
logError(input);
|
||||
if (input.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
val context = new Context();
|
||||
BundleLoader.load(context, Arrays.asList(
|
||||
@ -128,6 +130,7 @@ public class EditorController implements Initializable, DocumentListener {
|
||||
initUndoRedo();
|
||||
openSample();
|
||||
editor.getUndoManager().forgetHistory();
|
||||
Platform.runLater(editor::requestFocus);
|
||||
}
|
||||
|
||||
private void initUndoRedo() {
|
||||
|
@ -41,6 +41,12 @@
|
||||
<FontAwesomeIcon icon="redo"/>
|
||||
</graphic>
|
||||
</Button>
|
||||
<Separator/>
|
||||
<Button onAction="#handleMenuPlay">
|
||||
<graphic>
|
||||
<FontAwesomeIcon icon="play"/>
|
||||
</graphic>
|
||||
</Button>
|
||||
</ToolBar>
|
||||
</VBox>
|
||||
</top>
|
||||
|
Loading…
Reference in New Issue
Block a user