public static final class InputController { @FXML private JFXListView<?> toolbarPopupList; // close application @FXML private void submit() { if (toolbarPopupList.getSelectionModel().getSelectedIndex() == 1) { Platform.exit(); } } } }
@Override public Node load(String name) { final FXMLLoader loader = fxmlLoader(); final String filename = FXML_PREFIX + name + FXML_SUFFIX; loader.setLocation(InjectionLoaderImpl.class.getResource(filename)); try { return loader.load(); } catch (final IOException ex) { throw new SpeedmentToolException( "Error! Could not find FXML-file: " + filename + ".", ex ); } }
@ViewController(value = "/fxml/ui/Pickers.fxml", title = "Material Design Example") public class PickersController { @FXML private StackPane root; @FXML private JFXDatePicker dateOverlay; @FXML private JFXTimePicker timeOverlay; @PostConstruct public void init() { dateOverlay.setDialogParent(root); timeOverlay.setDialogParent(root); } }
@ViewController(value = "/fxml/ui/ListView.fxml", title = "Material Design Example") public class ListViewController { @FXML private JFXListView<?> list1; @FXML private JFXListView<?> list2; @FXML private JFXListView<?> subList; @FXML private JFXButton button3D; @FXML private JFXButton collapse; @FXML private JFXButton expand;
@ViewController(value = "/fxml/ui/Highlighter.fxml", title = "Material Design Example") public class HighlighterController { @FXML private JFXTextField searchField; @FXML private Pane content; private JFXHighlighter highlighter = new JFXHighlighter(); /** * init fxml when loaded. */ @PostConstruct public void init() { JFXDepthManager.setDepth(content, 1); JFXNodeUtils.addDelayedEventHandler(searchField, Duration.millis(400), KeyEvent.KEY_PRESSED, event -> highlighter.highlight(content, searchField.getText())); } }
/** * * @author Emil Forslund */ public final class AboutController implements Initializable { private @Inject InfoComponent infoComponent; private @Inject Brand brand; private @FXML ImageView titleImage; private @FXML Button close; private @FXML Label version; private @FXML Label license; private @FXML Label external; @Override public void initialize(URL location, ResourceBundle resources) { brand.logoLarge().map(Image::new).ifPresent(titleImage::setImage); license.setText(license.getText().replace("{title}", infoComponent.getTitle())); version.setText(infoComponent.getImplementationVersion()); external.setText(infoComponent.getLicenseName()); close.setOnAction(newCloseHandler()); } }
@FXML public void onNewComment() { System.out.println("New Comment"); //Close list nodesList.animateList(false); }
/** * * @author Emil Forslund */ public final class ToolbarController implements Initializable { private @Inject ToolbarComponent toolbar; private @FXML HBox hBox; @Override public void initialize(URL location, ResourceBundle resources) { toolbar.populate(hBox); } }
/** * * @author Emil Forslund */ public final class MenubarController implements Initializable { private @Inject MenuBarComponent menuBarComponent; public @FXML MenuBar menuBar; @Override public void initialize(URL location, ResourceBundle resources) { menuBarComponent.populate(menuBar); } }
@FXML public void onNewFilter() { System.out.println("New Filter"); //Close list nodesList.animateList(false); }
@FXML public void onNewFile() { System.out.println("New File"); //Close list nodesList.animateList(false); }
/** * * @author Emil Forslund */ public final class OutputController implements Initializable { private @Inject UserInterfaceComponent ui; private @FXML VBox log; @Override public void initialize(URL location, ResourceBundle resources) { Bindings.bindContent( log.getChildren(), ui.outputMessages() ); } }
@FXML public void close() { if (destroyed.compareAndSet(false, true)) { onClose.run(); remove(notification); } }
@FXML private void submit() { if (toolbarPopupList.getSelectionModel().getSelectedIndex() == 1) { Platform.exit(); } } }