public void setAutoShowAndHide(Boolean value) { this.autoShowAndHideObjectProperty.setValue(value); } public CornerMenu withAutoShowAndHide(Boolean value) { setAutoShowAndHide(value); return this; }
/** * Set the expanded state. This will update the {@link #expandedProperty()} accordingly. * * @param expanded Wheter the row editor should be expanded or not */ public void setExpanded(Boolean expanded) { expandedProperty().setValue(expanded); }
/** * Toggle the expanded state of the row at the given index. * * @param index The index of the row you want to toggle expansion for. */ public void toggleExpanded(int index) { SimpleBooleanProperty expanded = (SimpleBooleanProperty) getCellObservableValue(index); expanded.setValue(!expanded.getValue()); }
/** * Toggle the expanded state of this row editor. */ public void toggleExpanded() { SimpleBooleanProperty expanded = expandedProperty(); expanded.setValue(!expanded.getValue()); }
private void multipleSelectionChangeListener(ListChangeListener.Change<? extends TreeItem<N>> c) { for (TreeItem<N> selectedItem : c.getList()) { if (selectedItem.getValue() instanceof Project) { String id = ((Project) selectedItem.getValue()).getId(); boolean atleastOneOpened = openedProjects.stream().anyMatch(projectId -> projectId.equals(id)); deleteMenuItemDisableProperty.setValue(atleastOneOpened); if (atleastOneOpened) { break; } } } tree.setContextMenu(createMultipleContextMenu(c.getList())); }
public void onShowBBox(ActionEvent event) { CheckMenuItem item = (CheckMenuItem) event.getSource(); FXGL.getSettings().getDevShowBBox().setValue(item.isSelected()); }
public void onShowPosition(ActionEvent event) { CheckMenuItem item = (CheckMenuItem) event.getSource(); FXGL.getSettings().getDevShowPosition().setValue(item.isSelected()); }
@Override public void save() { if (!saved.getValue()) { // write script but remove listener before to avoid double update storableScript.removeListener(this); storableScript.writeScript(codeEditor.getCode()); storableScript.addListener(this); saved.setValue(true); } }
private void onMouseClickedEvent(MouseEvent event) { TreeItem<N> item = tree.getSelectionModel().getSelectedItem(); N node = item != null ? item.getValue() : null; selectedNode.setValue(node != null && filter.test(node, treeModel) ? (T) node : null); selectedFolder.setValue(node != null && treeModel.isFolder(node) && treeModel.isWritable((D) node) ? (D) node : null); doubleClick.setValue(event.getClickCount() == 2); }
private void treeViewChangeListener(ListChangeListener.Change<? extends TreeItem<N>> c) { if (c.getList().isEmpty()) { tree.setContextMenu(null); } else if (c.getList().size() == 1) { TreeItem<N> selectedTreeItem = c.getList().get(0); N value = selectedTreeItem.getValue(); if (value instanceof Project) { tree.setContextMenu(createProjectContextMenu(selectedTreeItem)); tree.setOnKeyPressed((KeyEvent ke) -> { if (ke.getCode() == KeyCode.F2) { renameNode(selectedTreeItem); } }); } else if (value instanceof Folder) { tree.setContextMenu(createFolderContextMenu(selectedTreeItem)); } else { tree.setContextMenu(null); } N node = selectedTreeItem.getValue(); String nodeId = (node instanceof Project) ? ((Project) node).getId() : null; deleteMenuItemDisableProperty.setValue(openedProjects.contains(nodeId)); } else { multipleSelectionChangeListener(c); } }