ListView<String> javaList = new ListView<>(); for (int i = 0; i < 4; i++) { javaList.getItems().add(ITEM + i);
@Override protected Node createUndecoratedEditor() { final VBox container = new VBox(); final ListView<String> listView = new ListView<>(strings); listView.setCellFactory(view -> new EnumCell(strings)); listView.setEditable(true); listView.setMaxHeight(USE_PREF_SIZE); listView.setPrefHeight(LIST_HEIGHT); final HBox controls = new HBox(SPACING); controls.setAlignment(Pos.CENTER); controls.getChildren().addAll( addButton(listView), removeButton(listView), populateButton(listView) ); container.setSpacing(SPACING); container.getChildren().addAll(listView, controls); hideShowBehaviour(container); return container; }
public StepRepresentationMenu(SetupUiJavaFXImplementation parent, Message<MenuItem> messageWaitingForResponse, String textToShow, List<String> menuItems, String defaultValue) { super(parent, messageWaitingForResponse, textToShow); this.messageWaitingForResponse = messageWaitingForResponse; this.menuItems = menuItems; this.listViewWidget = new ListView<>(); this.defaultValue = defaultValue; }
private ListView<T> createListView() { ListView<T> view = new ListView<>(); view.getSelectionModel().setSelectionMode(MULTIPLE); return view; } }
public void refresh() { // unless we do ALL of this - the custom cell rendering has problems in javafx // and starts duplicating the last row for some reason, spent a lot of time on this :( listView = new ListView(); listView.setItems(FXCollections.observableArrayList(units)); listView.setCellFactory(lv -> new FeatureOutlineCell()); scrollPane.setContent(listView); listView.getSelectionModel() .selectedIndexProperty() .addListener((o, prev, value) -> session.setSelectedScenario(value.intValue())); }
public TaskProgressViewSkin(TaskProgressView<T> monitor) { super(monitor); BorderPane borderPane = new BorderPane(); borderPane.getStyleClass().add("box"); // list view ListView<T> listView = new ListView<>(); listView.setPrefSize(500, 400); listView.setPlaceholder(new Label("No tasks running")); listView.setCellFactory(param -> new TaskCell()); listView.setFocusTraversable(false); Bindings.bindContent(listView.getItems(), monitor.getTasks()); borderPane.setCenter(listView); getChildren().add(listView); }
this.listView = new ListView<>(); this.listView.getStyleClass().add("efx-perspective-list"); //$NON-NLS-1$ this.listView.setCellFactory(PerspectiveCell::new);
ObservableList<String> model = new EventObservableList<String>(sorted_list); final ListView<String> listView = new ListView<String>(model); listView.setPrefSize(200, 250); listView.setEditable(false);
container.getChildren().add(f); final ListView<String> v = new ListView<String>(); v.setItems(FXCollections.observableArrayList(Font.getFamilies())); v.getSelectionModel().select(this.font.get().getFamily()); container.getChildren().add(f); ListView<FontPosture> v = new ListView<>(); v.setItems(FXCollections.observableArrayList(FontPosture .values())); container.getChildren().add(f); ListView<FontWeight> v = new ListView<>(); v.setItems(FXCollections.observableArrayList(FontWeight .values())); container.getChildren().add(f); ListView<Double> v = new ListView<Double>(); ObservableList<Double> sizes = FXCollections .observableArrayList(Double.valueOf(8d), Double.valueOf(9d), Double.valueOf(10d), Double.valueOf(11d), Double.valueOf(12d), Double.valueOf(14d), Double.valueOf(16d),
public AutoCompletePopupSkin(AutoCompletePopup<T> control){ this.control = control; suggestionList = new ListView<>(control.getSuggestions()); suggestionList.getStyleClass().add(AutoCompletePopup.DEFAULT_STYLE_CLASS); suggestionList.getStylesheets().add(AutoCompletionBinding.class .getResource("autocompletion.css").toExternalForm()); //$NON-NLS-1$ /** * Here we bind the prefHeightProperty to the minimum height between the * max visible rows and the current items list. We also add an arbitrary * 5 number because when we have only one item we have the vertical * scrollBar showing for no reason. */ suggestionList.prefHeightProperty().bind( Bindings.min(control.visibleRowCountProperty(), Bindings.size(suggestionList.getItems())) .multiply(LIST_CELL_HEIGHT).add(18)); suggestionList.setCellFactory(TextFieldListCell.forListView(control.getConverter())); //Allowing the user to control ListView width. suggestionList.prefWidthProperty().bind(control.prefWidthProperty()); suggestionList.maxWidthProperty().bind(control.maxWidthProperty()); suggestionList.minWidthProperty().bind(control.minWidthProperty()); registerEventListener(); }
listContainer.setSpacing(10); listContainer.setPadding(new Insets(10)); ListView<String> list = new ListView<String>(); ObservableList<String> listItems = FXCollections.observableArrayList("Item 1", "Item 2", "Item 3", "Item 4"); list.setItems(listItems); listTable.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); listContainer.getChildren().add(listTable); ListView<String> horizontalList = new ListView<String>(); horizontalList.setItems(listItems); horizontalList.setPrefWidth(250);
static ListView<String> createListView(int numOfItems, boolean multipleSelection, boolean disable, boolean horiz) { ListView<String> listView = new ListView<String>(); if (horiz) listView.setOrientation(Orientation.HORIZONTAL); listView.setPrefHeight((24*7)+4); listView.setPrefWidth(horiz ? 200 : 140); listView.getItems().addAll(sampleItems(numOfItems)); listView.setDisable(disable); if (multipleSelection) { listView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE); listView.getSelectionModel().selectRange(1, 5); } else { listView.getSelectionModel().select(1); } return listView; }
checkListView = new ListView<>(); checkListView.setItems(new SortedList<>(filterList, FilterValue::compareTo));
private void buildListViewTab(Tab tab) { GridPane grid = new GridPane(); grid.setPadding(new Insets(5, 5, 5, 5)); grid.setHgap(5); grid.setVgap(5); // create the listview final ListView<TestPerson> listView = new ListView<TestPerson>(); listView.setItems(data); // set the cell factory Callback<TestPerson, ObservableValue<Boolean>> getProperty = new Callback<TestPerson, ObservableValue<Boolean>>() { @Override public BooleanProperty call(TestPerson person) { // given a person, we return the property that represents // whether or not they are invited. We can then bind to this // bidirectionally. return person.telecommuterProperty(); } }; listView.setCellFactory(CheckBoxListCell.forListView(getProperty)); grid.add(listView, 0, 0); GridPane.setVgrow(listView, Priority.ALWAYS); GridPane.setHgrow(listView, Priority.ALWAYS); tab.setContent(grid); }
this.stage.getScene().addEventFilter(KeyEvent.KEY_PRESSED, this::handleKeyPressed); this.stage.getScene().getStylesheets().addAll(this.viewer.getTextWidget().getScene().getStylesheets()); this.proposalList = new ListView<>(); this.proposalList.getStyleClass().add("content-proposal-list"); //$NON-NLS-1$ this.proposalList.setOnMouseClicked((e) -> {
this.repositoryLayout.setSpacing(5); this.repositoryListView = new ListView<>(repositories); this.repositoryListView.setPrefHeight(0); this.repositoryListView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
final ListView<DetailsListElement<E>> container = new ListView<>(); container.getStyleClass().addAll("listWidget", "detailsListWidget");
final ListView<CompactListElement<E>> container = new ListView<>(); container.getStyleClass().addAll("listWidget", "compactListWidget");
dataPane.getChildren().addAll(new Label(Messages.getString("PaintEditor.CycleMethod")), cycleMethod); //$NON-NLS-1$ ListView<Stop> colorStops = new ListView<>(); colorStops.setCellFactory((v) -> new StopCell());
dataPane.getChildren().addAll(new Label(Messages.getString("PaintEditor.CycleMethod")), cycleMethod); //$NON-NLS-1$ ListView<Stop> colorStops = new ListView<>(); colorStops.setCellFactory((v) -> new StopCell());