Package javafx.scene.control

Examples of javafx.scene.control.TableColumn


        tableView.setItems(this.snapshots);
        return tableView;
    }

    private TableColumn createColumn(String name, String caption) {
        TableColumn column = new TableColumn(caption);
        column.setCellValueFactory(new PropertyValueFactory<Snapshot, String>(name));
        return column;
    }
View Full Code Here


        table = new TableView<Subtitle>();
        table.setEditable(false);
        table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
        table.setItems(data);
       
        TableColumn idCol = new TableColumn("ID");
        idCol.setCellValueFactory(new PropertyValueFactory<Subtitle, String>("id"));
        TableColumn titleCol = new TableColumn("Title");
        titleCol.setCellValueFactory(new PropertyValueFactory<Subtitle, String>("name"));
        TableColumn uploadedCol = new TableColumn("Uploaded");
        uploadedCol.setCellValueFactory(new PropertyValueFactory<Subtitle, String>("uploadedDate"));
        TableColumn yearReleasedCol = new TableColumn("Year Released");
        yearReleasedCol.setCellValueFactory(new PropertyValueFactory<Subtitle, String>("year"));
        TableColumn kindCol = new TableColumn("Kind");
        kindCol.setCellValueFactory(new PropertyValueFactory<Subtitle, String>("kind"));
        TableColumn seasonCol = new TableColumn("Season");
        seasonCol.setCellValueFactory(new PropertyValueFactory<Subtitle, String>("season"));
        TableColumn episodeCol = new TableColumn("Episode");
        episodeCol.setCellValueFactory(new PropertyValueFactory<Subtitle, String>("episode"));
       
        table.getColumns().addAll(idCol, titleCol, uploadedCol, yearReleasedCol, kindCol, seasonCol, episodeCol);
       
       
        linkField = new TextField("Download Link");
View Full Code Here

    }

    @Deprecated
    private void initializeColumns_OLD(@Nonnull final List<Double> prefWidth) {

        TableColumn title_priority = new TableColumn(RBLoader.ll("Priority"));
        TableColumn title_name = new TableColumn(RBLoader.ll("Name"));
        TableColumn title_fdir = new TableColumn(RBLoader.ll("Source"));
        TableColumn title_action = new TableColumn(RBLoader.ll("Action"));
        TableColumn title_dest = new TableColumn(RBLoader.ll("Destination"));
        TableColumn title_status = new TableColumn(RBLoader.ll("Status"));

        table.getColumns().addAll(title_priority, title_name, title_fdir,
                title_action, title_dest, title_status);

        PropertyValueFactory pvf = new PropertyValueFactory<>("node");

        title_priority.setCellValueFactory(pvf);
        title_name.setCellValueFactory(pvf);
        title_fdir.setCellValueFactory(pvf);
        title_action.setCellValueFactory(pvf);
        title_dest.setCellValueFactory(pvf);
        title_status.setCellValueFactory(pvf);

        title_priority.setCellFactory(new TableCellValue(0));
        title_name.setCellFactory(new TableCellValue(1));
        title_fdir.setCellFactory(new TableCellValue(2));
        title_action.setCellFactory(new TableCellValue(3));
        title_dest.setCellFactory(new TableCellValue(4));
        title_status.setCellFactory(new TableCellValue(5));

        try {
            if (prefWidth != null && !prefWidth.isEmpty() && prefWidth.size() == table.getColumns().size()) {
                for (int i = 0; i < prefWidth.size(); i++) {
                    Object t = table.getColumns().get(i);
                    if (t instanceof TableColumn) {
                        TableColumn tc = (TableColumn) t;
                        tc.setPrefWidth(prefWidth.get(i));
                    }
                }
            } else {
                title_priority.setPrefWidth(70.0);
                title_name.setPrefWidth(100.0);
View Full Code Here

            return null;
        }

        List<TableColumn> cols = new ArrayList<>();
        for (String name : columns) {
            cols.add(new TableColumn(RBLoader.ll(name)));
        }

        table.getColumns().addAll(cols);

        PropertyValueFactory pvf = new PropertyValueFactory<>(pvfValue);

        int j = 0;
        for (TableColumn col : cols) {
            col.setCellValueFactory(pvf);
            col.setCellFactory(listCalls.get(j++));
        }

        try {
            if (prefWidth != null && !prefWidth.isEmpty() && prefWidth.size() == table.getColumns().size()) {
                for (int i = 0; i < prefWidth.size(); i++) {
                    Object t = table.getColumns().get(i);
                    if (t instanceof TableColumn) {
                        TableColumn tc = (TableColumn) t;
                        tc.setPrefWidth(prefWidth.get(i));
                    }
                }
            } else {
                setDefaultColumnsWidth(cols);
            }
View Full Code Here

            return null;
        }

        List<TableColumn> cols = new ArrayList<>();
        for (String name : columns) {
            cols.add(new TableColumn(RBLoader.ll(name)));
        }

        table.getColumns().addAll(cols);

        PropertyValueFactory pvf = new PropertyValueFactory<>(pvfValue);

        int j = 0;
        for (TableColumn col : cols) {
            col.setCellValueFactory(pvf);
            col.setCellFactory(listCalls.get(j++));
        }

        try {
            if (prefWidth != null && !prefWidth.isEmpty() && prefWidth.size() == table.getColumns().size()) {
                for (int i = 0; i < prefWidth.size(); i++) {
                    Object t = table.getColumns().get(i);
                    if (t instanceof TableColumn) {
                        TableColumn tc = (TableColumn) t;
                        tc.setPrefWidth(prefWidth.get(i));
                    }
                }
            } else {
                setDefaultColumnsWidth(cols);
            }
View Full Code Here

    }

    @Deprecated
    private void initializeColumns_OLD(@Nonnull final List<Double> prefWidth) {

        TableColumn title_priority = new TableColumn(RBLoader.ll("Priority"));
        TableColumn title_name = new TableColumn(RBLoader.ll("Name"));
        TableColumn title_fdir = new TableColumn(RBLoader.ll("Source"));
        TableColumn title_action = new TableColumn(RBLoader.ll("Action"));
        TableColumn title_dest = new TableColumn(RBLoader.ll("Destination"));
        TableColumn title_status = new TableColumn(RBLoader.ll("Status"));

        table.getColumns().addAll(title_priority, title_name, title_fdir,
                title_action, title_dest, title_status);

        PropertyValueFactory pvf = new PropertyValueFactory<>("node");

        title_priority.setCellValueFactory(pvf);
        title_name.setCellValueFactory(pvf);
        title_fdir.setCellValueFactory(pvf);
        title_action.setCellValueFactory(pvf);
        title_dest.setCellValueFactory(pvf);
        title_status.setCellValueFactory(pvf);

        title_priority.setCellFactory(new TableCellValue(0));
        title_name.setCellFactory(new TableCellValue(1));
        title_fdir.setCellFactory(new TableCellValue(2));
        title_action.setCellFactory(new TableCellValue(3));
        title_dest.setCellFactory(new TableCellValue(4));
        title_status.setCellFactory(new TableCellValue(5));

        try {
            if (prefWidth != null && !prefWidth.isEmpty() && prefWidth.size() == table.getColumns().size()) {
                for (int i = 0; i < prefWidth.size(); i++) {
                    Object t = table.getColumns().get(i);
                    if (t instanceof TableColumn) {
                        TableColumn tc = (TableColumn) t;
                        tc.setPrefWidth(prefWidth.get(i));
                    }
                }
            } else {
                title_priority.setPrefWidth(70.0);
                title_name.setPrefWidth(100.0);
View Full Code Here

    }

    @Deprecated
    private void initializeColumns_OLD(@Nonnull final List<Double> prefWidth) {

        TableColumn title_priority = new TableColumn(RBLoader.ll("Priority"));
        TableColumn title_name = new TableColumn(RBLoader.ll("Name"));
        TableColumn title_fdir = new TableColumn(RBLoader.ll("Source"));
        TableColumn title_action = new TableColumn(RBLoader.ll("Action"));
        TableColumn title_dest = new TableColumn(RBLoader.ll("Destination"));
        TableColumn title_status = new TableColumn(RBLoader.ll("Status"));

        table.getColumns().addAll(title_priority, title_name, title_fdir,
                title_action, title_dest, title_status);

        PropertyValueFactory pvf = new PropertyValueFactory<>("node");

        title_priority.setCellValueFactory(pvf);
        title_name.setCellValueFactory(pvf);
        title_fdir.setCellValueFactory(pvf);
        title_action.setCellValueFactory(pvf);
        title_dest.setCellValueFactory(pvf);
        title_status.setCellValueFactory(pvf);

        title_priority.setCellFactory(new TableCellValue(0));
        title_name.setCellFactory(new TableCellValue(1));
        title_fdir.setCellFactory(new TableCellValue(2));
        title_action.setCellFactory(new TableCellValue(3));
        title_dest.setCellFactory(new TableCellValue(4));
        title_status.setCellFactory(new TableCellValue(5));

        try {
            if (prefWidth != null && !prefWidth.isEmpty() && prefWidth.size() == table.getColumns().size()) {
                for (int i = 0; i < prefWidth.size(); i++) {
                    Object t = table.getColumns().get(i);
                    if (t instanceof TableColumn) {
                        TableColumn tc = (TableColumn) t;
                        tc.setPrefWidth(prefWidth.get(i));
                    }
                }
            } else {
                title_priority.setPrefWidth(70.0);
                title_name.setPrefWidth(100.0);
View Full Code Here

            return null;
        }

        List<TableColumn> cols = new ArrayList<>();
        for (String name : columns) {
            cols.add(new TableColumn(RBLoader.ll(name)));
        }

        table.getColumns().addAll(cols);

        PropertyValueFactory pvf = new PropertyValueFactory<>(pvfValue);

        int j = 0;
        for (TableColumn col : cols) {
            col.setCellValueFactory(pvf);
            col.setCellFactory(listCalls.get(j++));
        }

        try {
            if (prefWidth != null && !prefWidth.isEmpty() && prefWidth.size() == table.getColumns().size()) {
                for (int i = 0; i < prefWidth.size(); i++) {
                    Object t = table.getColumns().get(i);
                    if (t instanceof TableColumn) {
                        TableColumn tc = (TableColumn) t;
                        tc.setPrefWidth(prefWidth.get(i));
                    }
                }
            } else {
                setDefaultColumnsWidth(cols);
            }
View Full Code Here

            }
        };

        table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);

        TableColumn firstNameCol = new TableColumn("Credentials");
        //firstNameCol.setPrefWidth(300);
        firstNameCol.setMinWidth(50);
        //firstNameCol.prefWidthProperty().bind(table.widthProperty().divide(2)); // w * 1/2

        firstNameCol.setCellValueFactory(new PropertyValueFactory<>("firstName"));
        firstNameCol.setCellFactory(cellFactory);
        firstNameCol.setOnEditCommit(
                new EventHandler<CellEditEvent<Person, String>>()
                {
                    @Override
                    public void handle(CellEditEvent<Person, String> t)
                    {
                        ((Person) t.getTableView().getItems().get(
                                t.getTablePosition().getRow())).setFirstName(t.getNewValue());
                    }
                }
        );

        TableColumn lastNameCol = new TableColumn("Value");
        //lastNameCol.setPrefWidth(300);
        lastNameCol.setMinWidth(50);
        //lastNameCol.prefWidthProperty().bind(table.widthProperty().divide(2));  // w * 1/2

        lastNameCol.setCellValueFactory(new PropertyValueFactory<>("lastName"));
        lastNameCol.setCellFactory(cellFactory);
        lastNameCol.setOnEditCommit(
                new EventHandler<CellEditEvent<Person, String>>()
                {
                    @Override
                    public void handle(CellEditEvent<Person, String> t)
                    {
View Full Code Here

   
    private void intializeBooksTableView(){
        // Tässä alustetaan taulukkonäkymä datalla, tätä kutsutaan tyypillisesti vain kerran kun ohjainta ollaan alustamassa
        //Book fields: name, creator, yearPublished, ISBN, units
       
        TableColumn nameColumn = new TableColumn("Nimi");
        nameColumn.setCellValueFactory(new PropertyValueFactory<Book, String>("name"));
       
        TableColumn creatorColumn = new TableColumn("Tekijä");
        creatorColumn.setCellValueFactory(new PropertyValueFactory<Book, String>("creator"));
   
        booksTableView.setItems(this.dataController.getBooks());
        booksTableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
        booksTableView.getColumns().addAll(nameColumn, creatorColumn);
    }
View Full Code Here

TOP

Related Classes of javafx.scene.control.TableColumn

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.