@Override public void init() { // allow multiple rows selection tableView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE); // listener for items selection change tableView .getSelectionModel() .getSelectedIndices() .addListener( (ListChangeListener<Integer>) change -> { if (change.getList().size() > 0) { setContextMenuState(true, true, true, true); } else { setContextMenuState(false, false, false, false); } }); // prevent table columns reordering tableView .getColumns() .addListener( (ListChangeListener<TableColumn<FileItem, ?>>) change -> { change.next(); if (change.wasReplaced()) { tableView.getColumns().clear(); tableView.getColumns().addAll(selectColumn, filenameColumn, filepathColumn); } }); // set column as a CheckBox column selectColumn.setCellFactory( cellData -> { CheckBoxTableCell<FileItem, Boolean> checkBoxTableCell = new CheckBoxTableCell<>(); // set value changed listener checkBoxTableCell.setSelectedStateCallback( index -> tableView.getItems().get(index).selectedProperty()); return checkBoxTableCell; }); // add checkbox to column heading selectFilesCheckBox = new CheckBox(); selectFilesCheckBox.setDisable(true); selectColumn.setGraphic(selectFilesCheckBox); selectFilesCheckBox .selectedProperty() .addListener( (observable, oldValue, newValue) -> { synchronized (LOCK) { tableView.getItems().forEach(fileItem -> fileItem.setSelected(newValue)); } }); // set value of cells in column selectColumn.setCellValueFactory(cellData -> cellData.getValue().selectedProperty()); filenameColumn.setCellValueFactory(cellData -> cellData.getValue().filenameProperty()); filepathColumn.setCellValueFactory(cellData -> cellData.getValue().filepathProperty()); }
@SuppressWarnings({"unchecked", "rawtypes"}) public void initialize(URL url, ResourceBundle rb) { ObservableList<Medarbejder> data = FXCollections.observableArrayList(); try { Connection con = dataaccess.getConnection(); PreparedStatement prep = con.prepareStatement( "SELECT MEDARBEJDER.NAVN, EMAIL, MEDARBEJDER.AFDELING FROM MEDARBEJDER"); rs = prep.executeQuery(); while (rs.next()) { data.add( new Medarbejder(rs.getString("navn"), rs.getString("email"), rs.getString("afdeling"))); } viewNavn.setCellValueFactory(new PropertyValueFactory("navn")); viewEmail.setCellValueFactory(new PropertyValueFactory("email")); viewAfdeling.setCellValueFactory(new PropertyValueFactory("afdeling")); TableView.setItems(null); TableView.setItems(data); } catch (Exception e) { e.printStackTrace(); System.out.println("Error on Building Data"); } }
public MediaTable() { imageColumnHeaderText = new SimpleStringProperty("Image"); titleColumnHeaderText = new SimpleStringProperty("Title"); descriptionColumnHeaderText = new SimpleStringProperty("Description"); imageColumnHeaderVisible = new SimpleBooleanProperty(true); titleColumnHeaderVisible = new SimpleBooleanProperty(true); descriptionColumnHeaderVisible = new SimpleBooleanProperty(true); TableColumn<T, Image> imageTableColumn = new TableColumn<>(); imageTableColumn.setCellValueFactory(c -> c.getValue().imageProperty()); imageTableColumn.textProperty().bind(imageColumnHeaderText); imageTableColumn.visibleProperty().bind(imageColumnHeaderVisible); imageTableColumn.setCellFactory(c -> new ImageTableCell()); TableColumn<T, String> titleTableColumn = new TableColumn<>(); titleTableColumn.setCellValueFactory(c -> c.getValue().titleProperty()); titleTableColumn.textProperty().bind(titleColumnHeaderText); titleTableColumn.visibleProperty().bind(titleColumnHeaderVisible); TableColumn<T, String> descriptionTableColumn = new TableColumn<>(); descriptionTableColumn.setCellValueFactory(c -> c.getValue().descriptionProperty()); descriptionTableColumn.textProperty().bind(descriptionColumnHeaderText); descriptionTableColumn.visibleProperty().bind(descriptionColumnHeaderVisible); getColumns().addAll(imageTableColumn, titleTableColumn, descriptionTableColumn); }
private void initializeFilteredPersonnelTableView() { personnelNameColumn.setCellValueFactory(new PropertyValueFactory<Official, String>("name")); personnelRankColumn.setCellValueFactory( new Callback<TableColumn.CellDataFeatures<Official, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<Official, String> arg0) { final Official official = arg0.getValue(); final StringExpression concat = Bindings.selectString(official.rankProperty(), "designation"); return concat; } }); Bindings.bindContent(officialsFilteredTableView.getItems(), officialFilteredList); gameData .getOfficials() .addListener( new ListChangeListener<Official>() { @Override public void onChanged(Change<? extends Official> arg0) { updateOfficialFiltersResult(); } }); // TODO initialize assignOfficialMenuItem to be sure that it's not // enable if not correct values are selected }
@FXML private void initialize() { personTableNameColumn.setCellValueFactory( (dataFeatures) -> dataFeatures.getValue().nameProperty()); personTableNameColumn.setCellFactory(TextFieldTableCell.forTableColumn()); personTableNameColumn.setOnEditCommit( (cellEditEvent) -> { int row = cellEditEvent.getTablePosition().getRow(); Person person = cellEditEvent.getTableView().getItems().get(row); person.setName(cellEditEvent.getNewValue()); }); personTableEmailColumn.setCellValueFactory( (dataFeatures) -> dataFeatures.getValue().emailProperty()); personTableEmailColumn.setCellFactory(TextFieldTableCell.forTableColumn()); personTableNameColumn.setOnEditCommit( (cellEditEvent) -> { int row = cellEditEvent.getTablePosition().getRow(); Person person = cellEditEvent.getTableView().getItems().get(row); person.setEmail(cellEditEvent.getNewValue()); }); ReadOnlyObjectProperty<Person> selectionProperty = personTableView.getSelectionModel().selectedItemProperty(); selectionProperty.addListener( (observable, oldValue, newValue) -> { personPaneController.setModel(newValue); }); personList = personTableView.getItems(); }
// https://docs.oracle.com/javafx/2/ui_controls/table-view.htm @SuppressWarnings("unchecked") public DataPanel(final String string) { super(string); tableView = new ScrollPane(); tableView.setPrefSize(Region.USE_COMPUTED_SIZE, Region.USE_COMPUTED_SIZE); tableView.setMaxSize(Region.USE_COMPUTED_SIZE, Region.USE_COMPUTED_SIZE); // set(MsstGuiPckg.getInstance().getGuiPreferredSize().propertyDataPanelWithHeight(), // MsstGuiPckg.getInstance().getGuiPreferredSize().propertyDataPanelWithWidth()); elementName = new TableColumn<>("element-name"); elementValue = new TableColumn<>("element-value"); elementName.setCellValueFactory(new PropertyValueFactory<TableEntry, String>("elementName")); elementValue.setCellValueFactory(new PropertyValueFactory<TableEntry, String>("elementValue")); dataTable = new TableView<TableEntry>(); dataTable.getColumns().addAll(elementName, elementValue); dataTable.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); dataTable.setPrefHeight( MsstGuiPckg.getInstance().getGuiPreferredSize().propertyDataPanelWithHeight()); dataTable.setPrefWidth( MsstGuiPckg.getInstance().getGuiPreferredSize().propertyDataPanelWithWidth()); dataTable.setEditable(true); tableView.setContent(dataTable); ; tableView.setFitToHeight(true); tableView.setFitToWidth(true); setContent(tableView); }
@FXML void initialize() { getAllImageViewsForButtons(); configureWidthHeightForImageViews(); configureButtons(); contentPane.setAlignment(Pos.CENTER); // show all customers and all employees titleLabel.setText("All Customers and All Employees"); TableView table = new TableView(); TableColumn fnCol = new TableColumn("First Name"); fnCol.setCellValueFactory(new PropertyValueFactory<>("firstName")); TableColumn lnCol = new TableColumn("Last Name"); lnCol.setCellValueFactory(new PropertyValueFactory<>("lastName")); TableColumn emailCol = new TableColumn("email"); emailCol.setCellValueFactory(new PropertyValueFactory<>("email")); table.getColumns().addAll(fnCol, lnCol, emailCol); ObservableList<Person> data = FXCollections.observableArrayList(operation.getAllCustomersAndEmployees()); table.setItems(data); table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); contentPane.getChildren().add(table); }
/** Initializes the controller class. */ @Override public void initialize(URL url, ResourceBundle rb) { resultTable.setItems(searchResults); titleC.setCellFactory( (TableColumn<SearchResult, String> p) -> { TextFieldTableCell<SearchResult, String> cell = new TextFieldTableCell<>(); cell.setOnMouseClicked( t -> { if (t.getClickCount() == 2 && (!cell.isEmpty())) { try { String file = cell.getTableView().getItems().get(cell.getIndex()).getId().get(); Runtime.getRuntime() .exec( "open /Users/Luxin/Documents/UTC/LO17/SearchEngine/TD/TD01/BULLETINS/" + file + ".htm"); } catch (IOException ex) { Logger.getLogger(SearchEngineInterfaceController.class.getName()) .log(Level.SEVERE, null, ex); } } }); return cell; }); scoreC.setCellValueFactory(cell -> cell.getValue().getScore()); idC.setCellValueFactory(cell -> cell.getValue().getId()); titleC.setCellValueFactory(cell -> cell.getValue().getTitle()); }
@SuppressWarnings("unchecked") private void initComponents() { pane = new AnchorPane(); pane.setPrefSize(800, 600); pane.setStyle( "-fx-background-color: linear-gradient(from 0% 0% to 100% 100%, blue 0%, silver 100%);"); txPesquisa = new TextField(); DropShadow ds = new DropShadow(); ds.setSpread(0.5); ds.setColor(Color.web("#FF0000")); txPesquisa.setEffect(ds); txPesquisa.setPromptText("Digite o item para pesquisa"); txPesquisa.setPrefWidth(200); txPesquisa.setFocusTraversable(false); tbVitrine = new TableView<ItensProperty>(); initItens(); tbVitrine.setItems(listItens); tbVitrine.setPrefSize(780, 550); columnProduto = new TableColumn<ItensProperty, String>(); columnProduto.setCellValueFactory(new PropertyValueFactory<ItensProperty, String>("produto")); columnProduto.setText("Produto"); columnPreco = new TableColumn<ItensProperty, Double>(); columnPreco.setCellValueFactory(new PropertyValueFactory<ItensProperty, Double>("preco")); columnPreco.setText("Preço"); tbVitrine.getColumns().addAll(columnProduto, columnPreco); pane.getChildren().addAll(txPesquisa, tbVitrine); }
@Override public void initialize(URL url, ResourceBundle rb) { table = new TableView<>(); data = new ProjectData(); TableColumn idProjectCol = new TableColumn("ID"); idProjectCol.setCellValueFactory( new PropertyValueFactory<ProjectDataItem, String>("IDProject")); idProjectCol.setCellFactory(new EditableCell()); TableColumn nameCol = new TableColumn("Name"); nameCol.setCellValueFactory(new PropertyValueFactory<ProjectDataItem, String>("Name")); nameCol.setCellFactory(new EditableCell()); TableColumn descriptionCol = new TableColumn("Description"); descriptionCol.setCellValueFactory( new PropertyValueFactory<ProjectDataItem, String>("Description")); descriptionCol.setCellFactory(new EditableCell()); table.setItems(data.getData()); table.getColumns().addAll(idProjectCol, nameCol, descriptionCol); table.setEditable(true); table.setTableMenuButtonVisible(true); table.setContextMenu(new ProjectFormController.ProjectContextMenu()); table.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE); paneTable.getChildren().add(table); AnchorPane.setTopAnchor(table, 0.0); AnchorPane.setLeftAnchor(table, 0.0); AnchorPane.setRightAnchor(table, 0.0); AnchorPane.setBottomAnchor(table, 50.0); }
public void putInTable(ObservableList<Medarbejder> datars) { viewNavn.setCellValueFactory(new PropertyValueFactory("navn")); viewEmail.setCellValueFactory(new PropertyValueFactory("email")); viewAfdeling.setCellValueFactory(new PropertyValueFactory("afdeling")); TableView.setItems(null); TableView.setItems(datars); }
public void initialize() { columnaMaterias.setCellValueFactory( new PropertyValueFactory<tableHistorial, String>("materia")); columnaFecha.setCellValueFactory(new PropertyValueFactory<tableHistorial, String>("fecha")); columnaTipoExamen.setCellValueFactory( new PropertyValueFactory<tableHistorial, String>("tipoExamen")); llenarTablaColoquios(); }
/** initializes the tableView (history) */ private void initializeTableView() { historyTable.setItems(HistoryHelper.getHistory()); nameColumn.setCellValueFactory( new PropertyValueFactory<TransformationResultHistory, String>("fileName")); percentageColumn.setCellValueFactory( new PropertyValueFactory<TransformationResultHistory, Number>("percentOfSuppression")); dateColumn.setCellValueFactory( new PropertyValueFactory<TransformationResultHistory, Date>("transformationDate")); }
@Override public void preencherTabela() { colunaNome.setCellValueFactory(new PropertyValueFactory<Funcionario, String>("nome")); colunaCPF.setCellValueFactory(new PropertyValueFactory<Funcionario, Double>("cpf")); colunaTel.setCellValueFactory(new PropertyValueFactory<Funcionario, String>("telefones")); colunaFun.setCellValueFactory( new PropertyValueFactory<Funcionario, String>("tipoDeFuncionario")); atualizarLista(); }
/** * Updates updateEditRecipeList and UpdateIngredients when loading vista. Sets cellValueFactory * with the column names for the tableview. */ @Override public void initialize(URL location, ResourceBundle resources) { System.out.println("Initialize EditRecipesController"); mainController = VistaNavigator.getMainController(); updateIngredients(); Name.setCellValueFactory(new PropertyValueFactory<Ingredient, String>("name")); Amount.setCellValueFactory(new PropertyValueFactory<Ingredient, String>("amount")); Unit.setCellValueFactory(new PropertyValueFactory<Ingredient, String>("unit")); System.out.println("- End of Initialize EditRecipesController"); }
@Override public void loaded() { Course course = (Course) parameter; courseNameField.textProperty().bindBidirectional(course.getNameProperty()); universityField.textProperty().bindBidirectional(course.getUniversity().getNameProperty()); preRequisitesTable.setItems(course.getPreRequisites()); preRequisiteNameColumn.setCellValueFactory((q) -> q.getValue().getNameProperty()); preRequisiteFieldColumn.setCellValueFactory((q) -> q.getValue().getFieldProperty()); }
@FXML private void initialize() { // set values for allTeamsTableView's columns _allTeamsNameColumn.setCellValueFactory( new PropertyValueFactory<DisplayTeamDTO, String>("Name")); // set values for addedTeamsTableViews' columns _allTeamsOpponentNameColumn.setCellValueFactory( new PropertyValueFactory<DisplayTeamDTO, String>("Name")); }
/** * Initializes the controller class. This method is automatically called after fxml file has been * loaded. */ @FXML private void initialize() { // setting up the radioButtons final ToggleGroup timeIntervalGroup = new ToggleGroup(); monthlyRadioButton.setToggleGroup(timeIntervalGroup); dailyRadioButton.setToggleGroup(timeIntervalGroup); hourlyRadioButton.setToggleGroup(timeIntervalGroup); fifteenMinRadioButton.setToggleGroup(timeIntervalGroup); fifteenMinRadioButton.setSelected(true); final ToggleGroup typOfChartGroup = new ToggleGroup(); regularTimeSeriesRadioButton.setToggleGroup(typOfChartGroup); scatterRadioButton.setToggleGroup(typOfChartGroup); dailyTypeOfDayRadioButton.setToggleGroup(typOfChartGroup); regularTimeSeriesRadioButton.setSelected(true); final ToggleGroup typeOfDayGroup = new ToggleGroup(); schoolDayRadioButton.setToggleGroup(typeOfDayGroup); summerDayRadioButton.setToggleGroup(typeOfDayGroup); holidayRadioButton.setToggleGroup(typeOfDayGroup); weekendRadioButton.setToggleGroup(typeOfDayGroup); everyDayRadioButton.setToggleGroup(typeOfDayGroup); everyDayRadioButton.setSelected(true); updateEnabledButtons(); // initialize a unique instance of the database database = Database.getInstance(); // initialize the meter table with all the columns. meterNumberColumn.setCellValueFactory(cellData -> cellData.getValue().getMeterNumber()); meterTable.setEditable(true); meterNumberColumn.setCellFactory(TextFieldTableCell.forTableColumn()); meterNumberColumn.setOnEditCommit( new EventHandler<TableColumn.CellEditEvent<Meter, String>>() { @Override public void handle(CellEditEvent<Meter, String> event) { event .getTableView() .getItems() .get(event.getTablePosition().getRow()) .setMeterNumber(Assistant.parsePropertiesString(event.getNewValue())); } }); startDateColumn.setCellValueFactory( cellData -> Assistant.parsePropertiesString(cellData.getValue().getStartDate().toString())); endDateColumn.setCellValueFactory( cellData -> Assistant.parsePropertiesString(cellData.getValue().getEndDate().toString())); activatedColumn.setCellFactory(cellData -> new CheckBoxCell()); colorColumn.setCellFactory(cellData -> new ColorButtonCell(java.awt.Color.GREEN)); initializeDateTable(); }
private Pane buildUpperArea() { Pane up = new Pane(); up.prefHeightProperty().bind(this.heightProperty()); up.prefWidthProperty().bind(this.widthProperty()); TableView<DebateDetails> table = new TableView<DebateDetails>(); table.prefHeightProperty().bind(up.heightProperty()); table.prefWidthProperty().bind(up.widthProperty()); final Label label = new Label("Debate Tournament"); label.setFont(new Font("Arial", 20)); table.setEditable(false); table.getChildrenUnmodifiable().clear(); table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); TableColumn<DebateDetails, String> divCol = new TableColumn<DebateDetails, String>("Division"); divCol.setCellValueFactory(new PropertyValueFactory<>("division")); TableColumn<DebateDetails, String> teamCountCol = new TableColumn<DebateDetails, String>("Team Count"); teamCountCol.setCellValueFactory(new PropertyValueFactory<>(String.valueOf("teamCount"))); TableColumn<DebateDetails, String> debCountCol = new TableColumn<DebateDetails, String>("Debate Count"); debCountCol.setCellValueFactory(new PropertyValueFactory<>(String.valueOf("totalMatch"))); TableColumn<DebateDetails, String> debCompCol = new TableColumn<DebateDetails, String>("Debates Completed "); debCompCol.setCellValueFactory(new PropertyValueFactory<>(String.valueOf("matchCompleted"))); TableColumn<DebateDetails, String> debRemCol = new TableColumn<DebateDetails, String>("Upcoming Debates"); debRemCol.setCellValueFactory(new PropertyValueFactory<>(String.valueOf("matchRemaining"))); final ObservableList<DebateDetails> data = FXCollections.observableArrayList(TeamManager.getDebateDetails()); table.setItems(data); table.getColumns().add(divCol); table.getColumns().add(teamCountCol); table.getColumns().add(debCountCol); table.getColumns().add(debCompCol); table.getColumns().add(debRemCol); final VBox vbox = new VBox(); vbox.setSpacing(5); vbox.setPadding(new Insets(10, 0, 0, 10)); vbox.getChildren().addAll(label, table); up.getChildren().add(vbox); return up; }
public void setFddObjectModel(FddObjectModel fddObjectModel) { logger.entry(); if (fddObjectModel != null) { fddObjectModel .getInteractionClasses() .values() .stream() .forEach( (value) -> { interactions.add(new InteractionState(value)); }); InteractionTableView.setItems(interactions); interactions.forEach( (interaction) -> { interaction .onProperty() .addListener( (observable, oldValue, newValue) -> { if (!newValue) { cb.setSelected(false); } else if (interactions.stream().allMatch(a -> a.isOn())) { cb.setSelected(true); } }); }); InteractionTableColumn.setCellValueFactory(new PropertyValueFactory<>("interactionName")); CheckTableColumn.setCellValueFactory( new Callback< TableColumn.CellDataFeatures<InteractionState, Boolean>, ObservableValue<Boolean>>() { @Override public ObservableValue<Boolean> call( TableColumn.CellDataFeatures<InteractionState, Boolean> param) { return param.getValue().onProperty(); } }); CheckTableColumn.setCellFactory(CheckBoxTableCell.forTableColumn(CheckTableColumn)); cb.setUserData(CheckTableColumn); cb.setOnAction( (ActionEvent event) -> { CheckBox cb1 = (CheckBox) event.getSource(); TableColumn tc = (TableColumn) cb1.getUserData(); InteractionTableView.getItems() .stream() .forEach( (item) -> { item.setOn(cb1.isSelected()); }); }); CheckTableColumn.setGraphic(cb); } logger.exit(); }
@Override public void initialize(URL location, ResourceBundle resources) { imageSave.setImage(new Image(GuiMain.class.getResourceAsStream("save_32x32.png"))); imageCancel.setImage(new Image(GuiMain.class.getResourceAsStream("cancel_32x32.png"))); dpDate.setValue(LocalDate.now()); cnDetails.setCellValueFactory(new PropertyValueFactory<>("details")); cnValue.setCellValueFactory(new PropertyValueFactory<>("value")); cnDate.setCellValueFactory(new PropertyValueFactory<>("date")); withdrawals = FXCollections.observableArrayList(); tableWithdrawals.setItems(withdrawals); }
public void setChapitres(int id) { this.idCours = id; chapitreDAO = new ImplChapitreDAO(); chapitreDisplayChapitreTable.setItems(chapitreDAO.displayChapitre(id)); nomDisplayChapitreColumn.setCellValueFactory(cellData -> cellData.getValue().NomProperty()); numeroDisplayChapitreColumn.setCellValueFactory( cellData -> cellData.getValue().NumeroProperty().asString()); showChapitreDetails(null); chapitreDisplayChapitreTable .getSelectionModel() .selectedItemProperty() .addListener((observable, oldValue, newValue) -> showChapitreDetails(newValue)); }
public void searchBook() { // System.out.println("Books "); DataAccess access = new DataAccessFacade(); Book b = access.searchBook(txtSearch.getText()); List<Book> bookList = new ArrayList<Book>(); bookList.add(b); if (b != null) { // System.out.println(b.getIsbn()); // tblDataView.setItems(FXCollections.observableArrayList(b)); isbn.setCellValueFactory(new PropertyValueFactory<>("isbn")); title.setCellValueFactory(new PropertyValueFactory<>("title")); tblDataView.getItems().setAll(bookList); } }
@FXML private void initialize() { // Initialize the person table with the two columns. firstNameColumn.setCellValueFactory(cellData -> cellData.getValue().firstNameProperty()); lastNameColumn.setCellValueFactory(cellData -> cellData.getValue().lastNameProperty()); personTable .getSelectionModel() .selectedItemProperty() .addListener( (observable, oldValue, newValue) -> { showPersonDetails(newValue); }); }
public void setCrashReport(CrashReport crashReport) { stackTraceView.populateFromCrashReport(crashReport); termTreeView.populateFromTerm(crashReport.getProps()); Object[][] crashProps = { {"Pid", crashReport.getPid()}, {"Reg. Name", crashReport.getRegisteredName()}, { "Error", ErlyBerly.getTermFormatter() .exceptionToString(crashReport.getErrorClass(), crashReport.getErrorReason()) }, { "Initial Call", ErlyBerly.getTermFormatter() .modFuncArgsToString((OtpErlangTuple) crashReport.getProcessInitialCall()) } }; TableColumn<Object[], Object> keyColumn = new TableColumn<>("Key"); TableColumn<Object[], Object> valueColumn = new TableColumn<>("Value"); keyColumn.setCellValueFactory( new Callback<CellDataFeatures<Object[], Object>, ObservableValue<Object>>() { @Override public ObservableValue<Object> call(CellDataFeatures<Object[], Object> p) { return new SimpleObjectProperty<>((p.getValue()[0])); } }); valueColumn.setCellValueFactory( new Callback<CellDataFeatures<Object[], Object>, ObservableValue<Object>>() { @Override public ObservableValue<Object> call(CellDataFeatures<Object[], Object> p) { return new SimpleObjectProperty<>((p.getValue()[1])); } }); crashInfoTable.getColumns().add(keyColumn); crashInfoTable.getColumns().add(valueColumn); crashInfoTable.getItems().addAll(crashProps); crashReport .getCallArgs() .ifPresent( (callArgs) -> { argsTreeView.populateFromListContents(callArgs); }); }
@FXML private void initialize() { createListMyBox(); cbName.setPromptText("Выберите наименование..."); cbName.setItems(listMyBoxName.getListName()); tableColName.setCellValueFactory(new PropertyValueFactory<MyBox, String>("name")); tableColNumOfSubject.setCellValueFactory( new PropertyValueFactory<MyBox, Integer>("numberOfSubject")); tableColCount.setCellValueFactory(new PropertyValueFactory<MyBox, Integer>("countBox")); tableColVolume.setCellValueFactory(new PropertyValueFactory<MyBox, Double>("volume")); tableView.setItems(listMyBox.getListMyBox()); labelKoef.setText("Коэффициент заполнения: " + String.valueOf(koef * 100 + "%")); initLisners(); }
public void fillTableFromData() { try { ObservableList<EmployeeVO> employeeList = FXCollections.observableArrayList(); employeeList = helpDAO.getEmployees(); name.setCellValueFactory(new PropertyValueFactory<EmployeeVO, String>("name")); designation.setCellValueFactory(new PropertyValueFactory<EmployeeVO, String>("designation")); mobileNo.setCellValueFactory(new PropertyValueFactory<EmployeeVO, String>("mobileNo")); address.setCellValueFactory(new PropertyValueFactory<EmployeeVO, String>("address")); serviceRating.setCellValueFactory( new PropertyValueFactory<EmployeeVO, String>("serviceRating")); employeeTable.setItems(employeeList); } catch (Exception e) { e.printStackTrace(); } }
@Override public void initialize(URL location, ResourceBundle resources) { Clientes cl = new Clientes(); try { tcRfc.setCellValueFactory(c -> c.getValue().getF().Rfc); tcNombre.setCellValueFactory(c -> c.getValue().getF().Nombre); // tcNombre.setCellValueFactory(new PropertyValueFactory<Clientes, String>("F")); reci = cl.getReciclar(); tablaClientes.setItems(reci); } catch (Exception e) { System.out.println(e); e.printStackTrace(); } }
@FXML private void initialize() { name.setCellValueFactory(cellData -> cellData.getValue().nameProperty()); rule.setCellValueFactory(cellData -> cellData.getValue().ruleProperty()); status.setCellValueFactory(cellData -> cellData.getValue().statusProperty()); alertMessage.setCellValueFactory(cellData -> cellData.getValue().alertMessageProperty()); // add listener for change in table ruleTable .getSelectionModel() .selectedItemProperty() .addListener((observable, oldValue, newValue) -> ruleChanged(newValue)); ruleTable.setItems(DeviceOverviewController.hydraCN.getCEPRuleData()); }
@FXML private void initialize() { // Initialize the task table with the five columns. taskNumberColumn.setCellValueFactory(cellData -> cellData.getValue().taskNumberProperty()); taskNameColumn.setCellValueFactory(cellData -> cellData.getValue().taskNameProperty()); startTimeColumn.setCellValueFactory(cellData -> cellData.getValue().startTimeProperty()); endTimeColumn.setCellValueFactory(cellData -> cellData.getValue().endTimeProperty()); priority.setCellValueFactory(cellData -> cellData.getValue().priorityProperty()); }