javafx.scene.control.ListView.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(9.1k)|赞(0)|评价(0)|浏览(156)

本文整理了Java中javafx.scene.control.ListView.<init>()方法的一些代码示例,展示了ListView.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ListView.<init>()方法的具体详情如下:
包路径:javafx.scene.control.ListView
类名称:ListView
方法名:<init>

ListView.<init>介绍

暂无

代码示例

代码示例来源:origin: jfoenixadmin/JFoenix

ListView<String> javaList = new ListView<>();
for (int i = 0; i < 4; i++) {
  javaList.getItems().add(ITEM + i);

代码示例来源:origin: speedment/speedment

@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;
}

代码示例来源:origin: PhoenicisOrg/phoenicis

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;
}

代码示例来源:origin: org.controlsfx/controlsfx

private ListView<T> createListView() {
    ListView<T> view = new ListView<>();
    view.getSelectionModel().setSelectionMode(MULTIPLE);
    return view;
  }
}

代码示例来源:origin: com.intuit.karate/karate-core

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()));        
}

代码示例来源:origin: org.controlsfx/controlsfx

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);
}

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.workbench.fx

this.listView = new ListView<>();
this.listView.getStyleClass().add("efx-perspective-list"); //$NON-NLS-1$
this.listView.setCellFactory(PerspectiveCell::new);

代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java16

ObservableList<String> model = new EventObservableList<String>(sorted_list);
final ListView<String> listView = new ListView<String>(model);
listView.setPrefSize(200, 250);
listView.setEditable(false);

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.dialogs

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),

代码示例来源:origin: org.controlsfx/controlsfx

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();
}

代码示例来源:origin: com.aquafx-project/aquafx

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);

代码示例来源:origin: com.aquafx-project/aquafx

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;
}

代码示例来源:origin: org.controlsfx/controlsfx

checkListView = new ListView<>();
checkListView.setItems(new SortedList<>(filterList, FilterValue::compareTo));

代码示例来源:origin: com.aquafx-project/aquafx

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);
}

代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.text.ui

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) -> {

代码示例来源:origin: PhoenicisOrg/phoenicis

this.repositoryLayout.setSpacing(5);
this.repositoryListView = new ListView<>(repositories);
this.repositoryListView.setPrefHeight(0);
this.repositoryListView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);

代码示例来源:origin: PhoenicisOrg/phoenicis

final ListView<DetailsListElement<E>> container = new ListView<>();
container.getStyleClass().addAll("listWidget", "detailsListWidget");

代码示例来源:origin: PhoenicisOrg/phoenicis

final ListView<CompactListElement<E>> container = new ListView<>();
container.getStyleClass().addAll("listWidget", "compactListWidget");

代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.ui.controls

dataPane.getChildren().addAll(new Label(Messages.getString("PaintEditor.CycleMethod")), cycleMethod); //$NON-NLS-1$
ListView<Stop> colorStops = new ListView<>();
colorStops.setCellFactory((v) -> new StopCell());

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls

dataPane.getChildren().addAll(new Label(Messages.getString("PaintEditor.CycleMethod")), cycleMethod); //$NON-NLS-1$
ListView<Stop> colorStops = new ListView<>();
colorStops.setCellFactory((v) -> new StopCell());

相关文章