final CheckMenuItem mi = new CheckMenuItem("_Project Tree"); mi.setGraphic(SpeedmentIcon.APPLICATION_SIDE_TREE.view()); mi.selectedProperty().bindBidirectional(ui.projectTreeVisibleProperty()); }) .set("workspace", () -> { final CheckMenuItem mi = new CheckMenuItem("_Workspace"); mi.setGraphic(SpeedmentIcon.APPLICATION_FORM.view()); mi.selectedProperty().bindBidirectional(ui.workspaceVisibleProperty()); }) .set("output", () -> { final CheckMenuItem mi = new CheckMenuItem("_Output"); mi.setGraphic(SpeedmentIcon.APPLICATION_XP_TERMINAL.view()); mi.selectedProperty().bindBidirectional(ui.outputVisibleProperty());
/** * Takes the provided {@link Action} and returns a {@link CheckMenuItem} instance * with all relevant properties bound to the properties of the Action. * * @param action The {@link Action} that the {@link CheckMenuItem} should bind to. * @return A {@link CheckMenuItem} that is bound to the state of the provided * {@link Action} */ public static CheckMenuItem createCheckMenuItem(final Action action) { return configure(new CheckMenuItem(), action); }
/** * Takes the provided {@link Action} and returns a {@link MenuItem} instance * with all relevant properties bound to the properties of the Action. * * @param action The {@link Action} that the {@link MenuItem} should bind to. * @return A {@link MenuItem} that is bound to the state of the provided * {@link Action} */ public static MenuItem createMenuItem(final Action action) { MenuItem menuItem = action.getClass().isAnnotationPresent(ActionCheck.class)? new CheckMenuItem(): new MenuItem(); return configure( menuItem, action); }
CheckMenuItem showMessagesItem = new CheckMenuItem("Enable onShowing/onHiding _messages"); MenuItem menu15 = new MenuItem("E_xit"); final String change[] = {"Change Text", "Change Back"}; final CheckMenuItem menu113 = new CheckMenuItem("Show \"foo\" item"); menu113.setSelected(true); menu113.selectedProperty().addListener(new InvalidationListener() {
MenuItem windowDock = new MenuItem("Im Dock ablegen"); windowDock.setAccelerator(KeyCombination.keyCombination("shortcut+M")); CheckMenuItem actual = new CheckMenuItem("Datum & Uhrzeit"); actual.setSelected(true); menuWindow.getItems().addAll(windowClose, windowDock, new SeparatorMenuItem(), actual);
MenuItem windowDock = new MenuItem("Im Dock ablegen"); windowDock.setAccelerator(KeyCombination.keyCombination("shortcut+M")); CheckMenuItem actual = new CheckMenuItem("Datum & Uhrzeit"); actual.setSelected(true); menuWindow.getItems().addAll(windowClose, windowDock, new SeparatorMenuItem(), actual);
fullScreenMenuItem = new CheckMenuItem("FullScreen"); fullScreenMenuItem.setOnAction(e -> switchFullscreen()); fullScreenMenuItem.setAccelerator(new KeyCodeCombination(KeyCode.F, KeyCombination.CONTROL_DOWN, KeyCombination.SHORTCUT_DOWN));