Example usage for javafx.scene.control ScrollPane ScrollPane

List of usage examples for javafx.scene.control ScrollPane ScrollPane

Introduction

In this page you can find the example usage for javafx.scene.control ScrollPane ScrollPane.

Prototype

public ScrollPane() 

Source Link

Document

Creates a new ScrollPane.

Usage

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXParamListPane.java

public CFBamJavaFXParamListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamServerMethodObj argContainer, ICFBamParamObj argFocus,
        Collection<ICFBamParamObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) {
    super();/*from   w  ww . j  a  v a2  s .c  o m*/
    final String S_ProcName = "construct-schema-focus";
    if (formManager == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "formManager");
    }
    cfFormManager = formManager;
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2,
                "argSchema");
    }
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    javafxRefreshCallback = refreshCallback;
    javafxSortByChain = sortByChain;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamParamObj>();
    tableColumnId = new TableColumn<ICFBamParamObj, Long>("Id");
    tableColumnId
            .setCellValueFactory(new Callback<CellDataFeatures<ICFBamParamObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamParamObj, Long> p) {
                    ICFBamParamObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        long value = obj.getRequiredId();
                        Long wrapped = new Long(value);
                        ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnId
            .setCellFactory(new Callback<TableColumn<ICFBamParamObj, Long>, TableCell<ICFBamParamObj, Long>>() {
                @Override
                public TableCell<ICFBamParamObj, Long> call(TableColumn<ICFBamParamObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamParamObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamParamObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamParamObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamParamObj, String> p) {
                    ICFBamParamObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getRequiredName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnName.setCellFactory(
            new Callback<TableColumn<ICFBamParamObj, String>, TableCell<ICFBamParamObj, String>>() {
                @Override
                public TableCell<ICFBamParamObj, String> call(TableColumn<ICFBamParamObj, String> arg) {
                    return new CFStringTableCell<ICFBamParamObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortDescription = new TableColumn<ICFBamParamObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamParamObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamParamObj, String> p) {
                    ICFBamParamObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalShortDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnShortDescription.setCellFactory(
            new Callback<TableColumn<ICFBamParamObj, String>, TableCell<ICFBamParamObj, String>>() {
                @Override
                public TableCell<ICFBamParamObj, String> call(TableColumn<ICFBamParamObj, String> arg) {
                    return new CFStringTableCell<ICFBamParamObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamParamObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamParamObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamParamObj, String> p) {
                    ICFBamParamObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDescription.setCellFactory(
            new Callback<TableColumn<ICFBamParamObj, String>, TableCell<ICFBamParamObj, String>>() {
                @Override
                public TableCell<ICFBamParamObj, String> call(TableColumn<ICFBamParamObj, String> arg) {
                    return new CFStringTableCell<ICFBamParamObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamParamObj, Boolean>("IsNullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamParamObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamParamObj, Boolean> p) {
                    ICFBamParamObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredIsNullable();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnIsNullable.setCellFactory(
            new Callback<TableColumn<ICFBamParamObj, Boolean>, TableCell<ICFBamParamObj, Boolean>>() {
                @Override
                public TableCell<ICFBamParamObj, Boolean> call(TableColumn<ICFBamParamObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamParamObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnLookupDefSchema = new TableColumn<ICFBamParamObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamParamObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamParamObj, ICFBamSchemaDefObj> p) {
                    ICFBamParamObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema();
                        ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupDefSchema.setCellFactory(
            new Callback<TableColumn<ICFBamParamObj, ICFBamSchemaDefObj>, TableCell<ICFBamParamObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamParamObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamParamObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamParamObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    tableColumnLookupType = new TableColumn<ICFBamParamObj, ICFBamValueObj>("Type Specification");
    tableColumnLookupType.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamParamObj, ICFBamValueObj>, ObservableValue<ICFBamValueObj>>() {
                public ObservableValue<ICFBamValueObj> call(
                        CellDataFeatures<ICFBamParamObj, ICFBamValueObj> p) {
                    ICFBamParamObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamValueObj ref = obj.getRequiredLookupType();
                        ReadOnlyObjectWrapper<ICFBamValueObj> observable = new ReadOnlyObjectWrapper<ICFBamValueObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupType.setCellFactory(
            new Callback<TableColumn<ICFBamParamObj, ICFBamValueObj>, TableCell<ICFBamParamObj, ICFBamValueObj>>() {
                @Override
                public TableCell<ICFBamParamObj, ICFBamValueObj> call(
                        TableColumn<ICFBamParamObj, ICFBamValueObj> arg) {
                    return new CFReferenceTableCell<ICFBamParamObj, ICFBamValueObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupType);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamParamObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamParamObj> observable, ICFBamParamObj oldValue,
                ICFBamParamObj newValue) {
            setJavaFXFocus(newValue);
        }
    });

    scrollMenu = new ScrollPane();
    scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER);
    scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED);
    scrollMenu.setFitToHeight(true);
    scrollMenu.setContent(getPanelHBoxMenu());

    setTop(scrollMenu);
    setCenter(dataTable);
    javafxIsInitializing = false;
    if (observableListOfParam != null) {
        dataTable.setItems(observableListOfParam);
    }
    adjustListButtons();
}

From source file:ipat_fx.FXMLDocumentController.java

public TabPane getByImage(HashMap<String, ArrayList<GridPane>> map) {

    TabPane tabpane = new TabPane();
    Tab tabForImage;/*from   w ww.  j av a2  s . co  m*/
    FlowPane paneForImage;

    Iterator<String> iterator = map.keySet().iterator();
    while (iterator.hasNext()) {
        tabForImage = new Tab();
        paneForImage = new FlowPane();
        String nameOfArtefact = iterator.next();
        tabForImage.setId("li_" + nameOfArtefact);
        tabForImage.setText(nameOfArtefact);
        ArrayList<GridPane> cells = map.get(nameOfArtefact);
        for (GridPane cell1 : cells) {
            GridPane cell = cell1;
            //paneForImage.add(cell, 0, i);
            paneForImage.getChildren().add(cell);
        }
        ScrollPane scrollPane = new ScrollPane();
        scrollPane.setContent(paneForImage);
        tabForImage.setContent(scrollPane);
        tabpane.getTabs().add(tabForImage);
    }
    return tabpane;
}

From source file:ipat_fx.FXMLDocumentController.java

public TabPane getByProfile(HashMap<String, ArrayList<GridPane>> map, int noOfProfiles) {

    TabPane tabpane = new TabPane();
    Tab tabForProfile;/* ww  w. j a  va 2  s.c om*/
    FlowPane paneForProfile;

    for (int i = 0; i < noOfProfiles; i++) {
        tabForProfile = new Tab();
        paneForProfile = new FlowPane();
        tabForProfile.setId("li_Profile_" + i);
        tabForProfile.setText("Profile " + i);
        int j = 0;
        for (Iterator<String> iterator = map.keySet().iterator(); iterator.hasNext(); j++) {
            String nameOfArtefact = iterator.next();
            ArrayList<GridPane> cells = map.get(nameOfArtefact);
            paneForProfile.getChildren().add(cells.get(i));
        }
        ScrollPane scrollPane = new ScrollPane();
        scrollPane.setContent(paneForProfile);
        tabForProfile.setContent(scrollPane);
        tabpane.getTabs().add(tabForProfile);
    }
    return tabpane;
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXIndexColListPane.java

public CFBamJavaFXIndexColListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamIndexObj argContainer, ICFBamIndexColObj argFocus,
        Collection<ICFBamIndexColObj> argDataCollection, ICFRefreshCallback refreshCallback,
        boolean sortByChain) {
    super();/*from   w ww  .ja  v  a2 s.  c  o m*/
    final String S_ProcName = "construct-schema-focus";
    if (formManager == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "formManager");
    }
    cfFormManager = formManager;
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2,
                "argSchema");
    }
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    javafxRefreshCallback = refreshCallback;
    javafxSortByChain = sortByChain;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamIndexColObj>();
    tableColumnId = new TableColumn<ICFBamIndexColObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexColObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamIndexColObj, Long> p) {
                    ICFBamIndexColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        long value = obj.getRequiredId();
                        Long wrapped = new Long(value);
                        ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnId.setCellFactory(
            new Callback<TableColumn<ICFBamIndexColObj, Long>, TableCell<ICFBamIndexColObj, Long>>() {
                @Override
                public TableCell<ICFBamIndexColObj, Long> call(TableColumn<ICFBamIndexColObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamIndexColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamIndexColObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamIndexColObj, String> p) {
                    ICFBamIndexColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getRequiredName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnName.setCellFactory(
            new Callback<TableColumn<ICFBamIndexColObj, String>, TableCell<ICFBamIndexColObj, String>>() {
                @Override
                public TableCell<ICFBamIndexColObj, String> call(TableColumn<ICFBamIndexColObj, String> arg) {
                    return new CFStringTableCell<ICFBamIndexColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamIndexColObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamIndexColObj, String> p) {
                    ICFBamIndexColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalShortName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnShortName.setCellFactory(
            new Callback<TableColumn<ICFBamIndexColObj, String>, TableCell<ICFBamIndexColObj, String>>() {
                @Override
                public TableCell<ICFBamIndexColObj, String> call(TableColumn<ICFBamIndexColObj, String> arg) {
                    return new CFStringTableCell<ICFBamIndexColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamIndexColObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamIndexColObj, String> p) {
                    ICFBamIndexColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalLabel();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnLabel.setCellFactory(
            new Callback<TableColumn<ICFBamIndexColObj, String>, TableCell<ICFBamIndexColObj, String>>() {
                @Override
                public TableCell<ICFBamIndexColObj, String> call(TableColumn<ICFBamIndexColObj, String> arg) {
                    return new CFStringTableCell<ICFBamIndexColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamIndexColObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamIndexColObj, String> p) {
                    ICFBamIndexColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalShortDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnShortDescription.setCellFactory(
            new Callback<TableColumn<ICFBamIndexColObj, String>, TableCell<ICFBamIndexColObj, String>>() {
                @Override
                public TableCell<ICFBamIndexColObj, String> call(TableColumn<ICFBamIndexColObj, String> arg) {
                    return new CFStringTableCell<ICFBamIndexColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamIndexColObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamIndexColObj, String> p) {
                    ICFBamIndexColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDescription.setCellFactory(
            new Callback<TableColumn<ICFBamIndexColObj, String>, TableCell<ICFBamIndexColObj, String>>() {
                @Override
                public TableCell<ICFBamIndexColObj, String> call(TableColumn<ICFBamIndexColObj, String> arg) {
                    return new CFStringTableCell<ICFBamIndexColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsAscending = new TableColumn<ICFBamIndexColObj, Boolean>("IsAscending");
    tableColumnIsAscending.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamIndexColObj, Boolean> p) {
                    ICFBamIndexColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredIsAscending();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnIsAscending.setCellFactory(
            new Callback<TableColumn<ICFBamIndexColObj, Boolean>, TableCell<ICFBamIndexColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamIndexColObj, Boolean> call(TableColumn<ICFBamIndexColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamIndexColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsAscending);
    tableColumnDefaultVisibility = new TableColumn<ICFBamIndexColObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamIndexColObj, Boolean> p) {
                    ICFBamIndexColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredDefaultVisibility();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnDefaultVisibility.setCellFactory(
            new Callback<TableColumn<ICFBamIndexColObj, Boolean>, TableCell<ICFBamIndexColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamIndexColObj, Boolean> call(TableColumn<ICFBamIndexColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamIndexColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnLookupDefSchema = new TableColumn<ICFBamIndexColObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamIndexColObj, ICFBamSchemaDefObj> p) {
                    ICFBamIndexColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema();
                        ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupDefSchema.setCellFactory(
            new Callback<TableColumn<ICFBamIndexColObj, ICFBamSchemaDefObj>, TableCell<ICFBamIndexColObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamIndexColObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamIndexColObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamIndexColObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    tableColumnLookupColumn = new TableColumn<ICFBamIndexColObj, ICFBamValueObj>("Column");
    tableColumnLookupColumn.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexColObj, ICFBamValueObj>, ObservableValue<ICFBamValueObj>>() {
                public ObservableValue<ICFBamValueObj> call(
                        CellDataFeatures<ICFBamIndexColObj, ICFBamValueObj> p) {
                    ICFBamIndexColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamValueObj ref = obj.getRequiredLookupColumn();
                        ReadOnlyObjectWrapper<ICFBamValueObj> observable = new ReadOnlyObjectWrapper<ICFBamValueObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupColumn.setCellFactory(
            new Callback<TableColumn<ICFBamIndexColObj, ICFBamValueObj>, TableCell<ICFBamIndexColObj, ICFBamValueObj>>() {
                @Override
                public TableCell<ICFBamIndexColObj, ICFBamValueObj> call(
                        TableColumn<ICFBamIndexColObj, ICFBamValueObj> arg) {
                    return new CFReferenceTableCell<ICFBamIndexColObj, ICFBamValueObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupColumn);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamIndexColObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamIndexColObj> observable, ICFBamIndexColObj oldValue,
                ICFBamIndexColObj newValue) {
            setJavaFXFocus(newValue);
        }
    });

    scrollMenu = new ScrollPane();
    scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER);
    scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED);
    scrollMenu.setFitToHeight(true);
    scrollMenu.setContent(getPanelHBoxMenu());

    setTop(scrollMenu);
    setCenter(dataTable);
    javafxIsInitializing = false;
    if (observableListOfIndexCol != null) {
        dataTable.setItems(observableListOfIndexCol);
    }
    adjustListButtons();
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXRelationColListPane.java

public CFBamJavaFXRelationColListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamRelationObj argContainer, ICFBamRelationColObj argFocus,
        Collection<ICFBamRelationColObj> argDataCollection, ICFRefreshCallback refreshCallback,
        boolean sortByChain) {
    super();//w w  w. ja v a2  s.  c  o m
    final String S_ProcName = "construct-schema-focus";
    if (formManager == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "formManager");
    }
    cfFormManager = formManager;
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2,
                "argSchema");
    }
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    javafxRefreshCallback = refreshCallback;
    javafxSortByChain = sortByChain;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamRelationColObj>();
    tableColumnId = new TableColumn<ICFBamRelationColObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationColObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamRelationColObj, Long> p) {
                    ICFBamRelationColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        long value = obj.getRequiredId();
                        Long wrapped = new Long(value);
                        ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnId.setCellFactory(
            new Callback<TableColumn<ICFBamRelationColObj, Long>, TableCell<ICFBamRelationColObj, Long>>() {
                @Override
                public TableCell<ICFBamRelationColObj, Long> call(TableColumn<ICFBamRelationColObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamRelationColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamRelationColObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamRelationColObj, String> p) {
                    ICFBamRelationColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getRequiredName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnName.setCellFactory(
            new Callback<TableColumn<ICFBamRelationColObj, String>, TableCell<ICFBamRelationColObj, String>>() {
                @Override
                public TableCell<ICFBamRelationColObj, String> call(
                        TableColumn<ICFBamRelationColObj, String> arg) {
                    return new CFStringTableCell<ICFBamRelationColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamRelationColObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamRelationColObj, String> p) {
                    ICFBamRelationColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalShortName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnShortName.setCellFactory(
            new Callback<TableColumn<ICFBamRelationColObj, String>, TableCell<ICFBamRelationColObj, String>>() {
                @Override
                public TableCell<ICFBamRelationColObj, String> call(
                        TableColumn<ICFBamRelationColObj, String> arg) {
                    return new CFStringTableCell<ICFBamRelationColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamRelationColObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamRelationColObj, String> p) {
                    ICFBamRelationColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalLabel();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnLabel.setCellFactory(
            new Callback<TableColumn<ICFBamRelationColObj, String>, TableCell<ICFBamRelationColObj, String>>() {
                @Override
                public TableCell<ICFBamRelationColObj, String> call(
                        TableColumn<ICFBamRelationColObj, String> arg) {
                    return new CFStringTableCell<ICFBamRelationColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamRelationColObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamRelationColObj, String> p) {
                    ICFBamRelationColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalShortDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnShortDescription.setCellFactory(
            new Callback<TableColumn<ICFBamRelationColObj, String>, TableCell<ICFBamRelationColObj, String>>() {
                @Override
                public TableCell<ICFBamRelationColObj, String> call(
                        TableColumn<ICFBamRelationColObj, String> arg) {
                    return new CFStringTableCell<ICFBamRelationColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamRelationColObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamRelationColObj, String> p) {
                    ICFBamRelationColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDescription.setCellFactory(
            new Callback<TableColumn<ICFBamRelationColObj, String>, TableCell<ICFBamRelationColObj, String>>() {
                @Override
                public TableCell<ICFBamRelationColObj, String> call(
                        TableColumn<ICFBamRelationColObj, String> arg) {
                    return new CFStringTableCell<ICFBamRelationColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnDefaultVisibility = new TableColumn<ICFBamRelationColObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamRelationColObj, Boolean> p) {
                    ICFBamRelationColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredDefaultVisibility();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnDefaultVisibility.setCellFactory(
            new Callback<TableColumn<ICFBamRelationColObj, Boolean>, TableCell<ICFBamRelationColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamRelationColObj, Boolean> call(
                        TableColumn<ICFBamRelationColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamRelationColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnLookupDefSchema = new TableColumn<ICFBamRelationColObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamRelationColObj, ICFBamSchemaDefObj> p) {
                    ICFBamRelationColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema();
                        ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupDefSchema.setCellFactory(
            new Callback<TableColumn<ICFBamRelationColObj, ICFBamSchemaDefObj>, TableCell<ICFBamRelationColObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamRelationColObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamRelationColObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamRelationColObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    tableColumnLookupFromCol = new TableColumn<ICFBamRelationColObj, ICFBamIndexColObj>("From Column");
    tableColumnLookupFromCol.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationColObj, ICFBamIndexColObj>, ObservableValue<ICFBamIndexColObj>>() {
                public ObservableValue<ICFBamIndexColObj> call(
                        CellDataFeatures<ICFBamRelationColObj, ICFBamIndexColObj> p) {
                    ICFBamRelationColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamIndexColObj ref = obj.getRequiredLookupFromCol();
                        ReadOnlyObjectWrapper<ICFBamIndexColObj> observable = new ReadOnlyObjectWrapper<ICFBamIndexColObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupFromCol.setCellFactory(
            new Callback<TableColumn<ICFBamRelationColObj, ICFBamIndexColObj>, TableCell<ICFBamRelationColObj, ICFBamIndexColObj>>() {
                @Override
                public TableCell<ICFBamRelationColObj, ICFBamIndexColObj> call(
                        TableColumn<ICFBamRelationColObj, ICFBamIndexColObj> arg) {
                    return new CFReferenceTableCell<ICFBamRelationColObj, ICFBamIndexColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupFromCol);
    tableColumnLookupToCol = new TableColumn<ICFBamRelationColObj, ICFBamIndexColObj>("To Column");
    tableColumnLookupToCol.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationColObj, ICFBamIndexColObj>, ObservableValue<ICFBamIndexColObj>>() {
                public ObservableValue<ICFBamIndexColObj> call(
                        CellDataFeatures<ICFBamRelationColObj, ICFBamIndexColObj> p) {
                    ICFBamRelationColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamIndexColObj ref = obj.getRequiredLookupToCol();
                        ReadOnlyObjectWrapper<ICFBamIndexColObj> observable = new ReadOnlyObjectWrapper<ICFBamIndexColObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupToCol.setCellFactory(
            new Callback<TableColumn<ICFBamRelationColObj, ICFBamIndexColObj>, TableCell<ICFBamRelationColObj, ICFBamIndexColObj>>() {
                @Override
                public TableCell<ICFBamRelationColObj, ICFBamIndexColObj> call(
                        TableColumn<ICFBamRelationColObj, ICFBamIndexColObj> arg) {
                    return new CFReferenceTableCell<ICFBamRelationColObj, ICFBamIndexColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupToCol);
    dataTable.getSelectionModel().selectedItemProperty()
            .addListener(new ChangeListener<ICFBamRelationColObj>() {
                @Override
                public void changed(ObservableValue<? extends ICFBamRelationColObj> observable,
                        ICFBamRelationColObj oldValue, ICFBamRelationColObj newValue) {
                    setJavaFXFocus(newValue);
                }
            });

    scrollMenu = new ScrollPane();
    scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER);
    scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED);
    scrollMenu.setFitToHeight(true);
    scrollMenu.setContent(getPanelHBoxMenu());

    setTop(scrollMenu);
    setCenter(dataTable);
    javafxIsInitializing = false;
    if (observableListOfRelationCol != null) {
        dataTable.setItems(observableListOfRelationCol);
    }
    adjustListButtons();
}

From source file:net.sourceforge.msscodefactory.cfbamcustom.v2_7.CFBamCustomEditor.CFBamCustomEditorRelationColListPane.java

public CFBamCustomEditorRelationColListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamRelationObj argContainer, ICFBamRelationColObj argFocus,
        Collection<ICFBamRelationColObj> argDataCollection, ICFRefreshCallback refreshCallback,
        boolean sortByChain) {
    super();/*  w  w w.  ja  va 2 s  .  c o m*/
    final String S_ProcName = "construct-schema-focus";
    if (formManager == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "formManager");
    }
    cfFormManager = formManager;
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2,
                "argSchema");
    }
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    javafxRefreshCallback = refreshCallback;
    javafxSortByChain = sortByChain;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamRelationColObj>();
    tableColumnId = new TableColumn<ICFBamRelationColObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationColObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamRelationColObj, Long> p) {
                    ICFBamRelationColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        long value = obj.getRequiredId();
                        Long wrapped = new Long(value);
                        ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnId.setCellFactory(
            new Callback<TableColumn<ICFBamRelationColObj, Long>, TableCell<ICFBamRelationColObj, Long>>() {
                @Override
                public TableCell<ICFBamRelationColObj, Long> call(TableColumn<ICFBamRelationColObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamRelationColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamRelationColObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamRelationColObj, String> p) {
                    ICFBamRelationColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getRequiredName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnName.setCellFactory(
            new Callback<TableColumn<ICFBamRelationColObj, String>, TableCell<ICFBamRelationColObj, String>>() {
                @Override
                public TableCell<ICFBamRelationColObj, String> call(
                        TableColumn<ICFBamRelationColObj, String> arg) {
                    return new CFStringTableCell<ICFBamRelationColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnLookupDefSchema = new TableColumn<ICFBamRelationColObj, ICFBamSchemaDefObj>("Defining Schema");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamRelationColObj, ICFBamSchemaDefObj> p) {
                    ICFBamRelationColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema();
                        ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupDefSchema.setCellFactory(
            new Callback<TableColumn<ICFBamRelationColObj, ICFBamSchemaDefObj>, TableCell<ICFBamRelationColObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamRelationColObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamRelationColObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamRelationColObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    tableColumnShortName = new TableColumn<ICFBamRelationColObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamRelationColObj, String> p) {
                    ICFBamRelationColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalShortName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnShortName.setCellFactory(
            new Callback<TableColumn<ICFBamRelationColObj, String>, TableCell<ICFBamRelationColObj, String>>() {
                @Override
                public TableCell<ICFBamRelationColObj, String> call(
                        TableColumn<ICFBamRelationColObj, String> arg) {
                    return new CFStringTableCell<ICFBamRelationColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnDescription = new TableColumn<ICFBamRelationColObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamRelationColObj, String> p) {
                    ICFBamRelationColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDescription.setCellFactory(
            new Callback<TableColumn<ICFBamRelationColObj, String>, TableCell<ICFBamRelationColObj, String>>() {
                @Override
                public TableCell<ICFBamRelationColObj, String> call(
                        TableColumn<ICFBamRelationColObj, String> arg) {
                    return new CFStringTableCell<ICFBamRelationColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnShortDescription = new TableColumn<ICFBamRelationColObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamRelationColObj, String> p) {
                    ICFBamRelationColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalShortDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnShortDescription.setCellFactory(
            new Callback<TableColumn<ICFBamRelationColObj, String>, TableCell<ICFBamRelationColObj, String>>() {
                @Override
                public TableCell<ICFBamRelationColObj, String> call(
                        TableColumn<ICFBamRelationColObj, String> arg) {
                    return new CFStringTableCell<ICFBamRelationColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnLabel = new TableColumn<ICFBamRelationColObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamRelationColObj, String> p) {
                    ICFBamRelationColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalLabel();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnLabel.setCellFactory(
            new Callback<TableColumn<ICFBamRelationColObj, String>, TableCell<ICFBamRelationColObj, String>>() {
                @Override
                public TableCell<ICFBamRelationColObj, String> call(
                        TableColumn<ICFBamRelationColObj, String> arg) {
                    return new CFStringTableCell<ICFBamRelationColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnDefaultVisibility = new TableColumn<ICFBamRelationColObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamRelationColObj, Boolean> p) {
                    ICFBamRelationColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredDefaultVisibility();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnDefaultVisibility.setCellFactory(
            new Callback<TableColumn<ICFBamRelationColObj, Boolean>, TableCell<ICFBamRelationColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamRelationColObj, Boolean> call(
                        TableColumn<ICFBamRelationColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamRelationColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnLookupFromCol = new TableColumn<ICFBamRelationColObj, ICFBamIndexColObj>("From Column");
    tableColumnLookupFromCol.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationColObj, ICFBamIndexColObj>, ObservableValue<ICFBamIndexColObj>>() {
                public ObservableValue<ICFBamIndexColObj> call(
                        CellDataFeatures<ICFBamRelationColObj, ICFBamIndexColObj> p) {
                    ICFBamRelationColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamIndexColObj ref = obj.getRequiredLookupFromCol();
                        ReadOnlyObjectWrapper<ICFBamIndexColObj> observable = new ReadOnlyObjectWrapper<ICFBamIndexColObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupFromCol.setCellFactory(
            new Callback<TableColumn<ICFBamRelationColObj, ICFBamIndexColObj>, TableCell<ICFBamRelationColObj, ICFBamIndexColObj>>() {
                @Override
                public TableCell<ICFBamRelationColObj, ICFBamIndexColObj> call(
                        TableColumn<ICFBamRelationColObj, ICFBamIndexColObj> arg) {
                    return new CFReferenceTableCell<ICFBamRelationColObj, ICFBamIndexColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupFromCol);
    tableColumnLookupToCol = new TableColumn<ICFBamRelationColObj, ICFBamIndexColObj>("To Column");
    tableColumnLookupToCol.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationColObj, ICFBamIndexColObj>, ObservableValue<ICFBamIndexColObj>>() {
                public ObservableValue<ICFBamIndexColObj> call(
                        CellDataFeatures<ICFBamRelationColObj, ICFBamIndexColObj> p) {
                    ICFBamRelationColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamIndexColObj ref = obj.getRequiredLookupToCol();
                        ReadOnlyObjectWrapper<ICFBamIndexColObj> observable = new ReadOnlyObjectWrapper<ICFBamIndexColObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupToCol.setCellFactory(
            new Callback<TableColumn<ICFBamRelationColObj, ICFBamIndexColObj>, TableCell<ICFBamRelationColObj, ICFBamIndexColObj>>() {
                @Override
                public TableCell<ICFBamRelationColObj, ICFBamIndexColObj> call(
                        TableColumn<ICFBamRelationColObj, ICFBamIndexColObj> arg) {
                    return new CFReferenceTableCell<ICFBamRelationColObj, ICFBamIndexColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupToCol);
    dataTable.getSelectionModel().selectedItemProperty()
            .addListener(new ChangeListener<ICFBamRelationColObj>() {
                @Override
                public void changed(ObservableValue<? extends ICFBamRelationColObj> observable,
                        ICFBamRelationColObj oldValue, ICFBamRelationColObj newValue) {
                    setJavaFXFocus(newValue);
                }
            });

    scrollMenu = new ScrollPane();
    scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER);
    scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED);
    scrollMenu.setFitToHeight(true);
    scrollMenu.setContent(getPanelHBoxMenu());

    setTop(scrollMenu);
    setCenter(dataTable);
    javafxIsInitializing = false;
    if (observableListOfRelationCol != null) {
        dataTable.setItems(observableListOfRelationCol);
    }
    adjustListButtons();
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXChainListPane.java

public CFBamJavaFXChainListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamTableObj argContainer, ICFBamChainObj argFocus, Collection<ICFBamChainObj> argDataCollection,
        ICFRefreshCallback refreshCallback, boolean sortByChain) {
    super();//w  w w  .  ja  v  a 2s  .  co  m
    final String S_ProcName = "construct-schema-focus";
    if (formManager == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "formManager");
    }
    cfFormManager = formManager;
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2,
                "argSchema");
    }
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    javafxRefreshCallback = refreshCallback;
    javafxSortByChain = sortByChain;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamChainObj>();
    tableColumnId = new TableColumn<ICFBamChainObj, Long>("Id");
    tableColumnId
            .setCellValueFactory(new Callback<CellDataFeatures<ICFBamChainObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamChainObj, Long> p) {
                    ICFBamChainObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        long value = obj.getRequiredId();
                        Long wrapped = new Long(value);
                        ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnId
            .setCellFactory(new Callback<TableColumn<ICFBamChainObj, Long>, TableCell<ICFBamChainObj, Long>>() {
                @Override
                public TableCell<ICFBamChainObj, Long> call(TableColumn<ICFBamChainObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamChainObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamChainObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamChainObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamChainObj, String> p) {
                    ICFBamChainObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getRequiredName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnName.setCellFactory(
            new Callback<TableColumn<ICFBamChainObj, String>, TableCell<ICFBamChainObj, String>>() {
                @Override
                public TableCell<ICFBamChainObj, String> call(TableColumn<ICFBamChainObj, String> arg) {
                    return new CFStringTableCell<ICFBamChainObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamChainObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamChainObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamChainObj, String> p) {
                    ICFBamChainObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalShortName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnShortName.setCellFactory(
            new Callback<TableColumn<ICFBamChainObj, String>, TableCell<ICFBamChainObj, String>>() {
                @Override
                public TableCell<ICFBamChainObj, String> call(TableColumn<ICFBamChainObj, String> arg) {
                    return new CFStringTableCell<ICFBamChainObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamChainObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamChainObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamChainObj, String> p) {
                    ICFBamChainObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalLabel();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnLabel.setCellFactory(
            new Callback<TableColumn<ICFBamChainObj, String>, TableCell<ICFBamChainObj, String>>() {
                @Override
                public TableCell<ICFBamChainObj, String> call(TableColumn<ICFBamChainObj, String> arg) {
                    return new CFStringTableCell<ICFBamChainObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamChainObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamChainObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamChainObj, String> p) {
                    ICFBamChainObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalShortDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnShortDescription.setCellFactory(
            new Callback<TableColumn<ICFBamChainObj, String>, TableCell<ICFBamChainObj, String>>() {
                @Override
                public TableCell<ICFBamChainObj, String> call(TableColumn<ICFBamChainObj, String> arg) {
                    return new CFStringTableCell<ICFBamChainObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamChainObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamChainObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamChainObj, String> p) {
                    ICFBamChainObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDescription.setCellFactory(
            new Callback<TableColumn<ICFBamChainObj, String>, TableCell<ICFBamChainObj, String>>() {
                @Override
                public TableCell<ICFBamChainObj, String> call(TableColumn<ICFBamChainObj, String> arg) {
                    return new CFStringTableCell<ICFBamChainObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnSuffix = new TableColumn<ICFBamChainObj, String>("Suffix");
    tableColumnSuffix.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamChainObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamChainObj, String> p) {
                    ICFBamChainObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalSuffix();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnSuffix.setCellFactory(
            new Callback<TableColumn<ICFBamChainObj, String>, TableCell<ICFBamChainObj, String>>() {
                @Override
                public TableCell<ICFBamChainObj, String> call(TableColumn<ICFBamChainObj, String> arg) {
                    return new CFStringTableCell<ICFBamChainObj>();
                }
            });
    dataTable.getColumns().add(tableColumnSuffix);
    tableColumnDefaultVisibility = new TableColumn<ICFBamChainObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamChainObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamChainObj, Boolean> p) {
                    ICFBamChainObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredDefaultVisibility();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnDefaultVisibility.setCellFactory(
            new Callback<TableColumn<ICFBamChainObj, Boolean>, TableCell<ICFBamChainObj, Boolean>>() {
                @Override
                public TableCell<ICFBamChainObj, Boolean> call(TableColumn<ICFBamChainObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamChainObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnLookupDefSchema = new TableColumn<ICFBamChainObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamChainObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamChainObj, ICFBamSchemaDefObj> p) {
                    ICFBamChainObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema();
                        ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupDefSchema.setCellFactory(
            new Callback<TableColumn<ICFBamChainObj, ICFBamSchemaDefObj>, TableCell<ICFBamChainObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamChainObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamChainObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamChainObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    tableColumnLookupPrevRel = new TableColumn<ICFBamChainObj, ICFBamRelationObj>("Previous Relation");
    tableColumnLookupPrevRel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamChainObj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() {
                public ObservableValue<ICFBamRelationObj> call(
                        CellDataFeatures<ICFBamChainObj, ICFBamRelationObj> p) {
                    ICFBamChainObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamRelationObj ref = obj.getRequiredLookupPrevRel();
                        ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupPrevRel.setCellFactory(
            new Callback<TableColumn<ICFBamChainObj, ICFBamRelationObj>, TableCell<ICFBamChainObj, ICFBamRelationObj>>() {
                @Override
                public TableCell<ICFBamChainObj, ICFBamRelationObj> call(
                        TableColumn<ICFBamChainObj, ICFBamRelationObj> arg) {
                    return new CFReferenceTableCell<ICFBamChainObj, ICFBamRelationObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupPrevRel);
    tableColumnLookupNextRel = new TableColumn<ICFBamChainObj, ICFBamRelationObj>("Next Relation");
    tableColumnLookupNextRel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamChainObj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() {
                public ObservableValue<ICFBamRelationObj> call(
                        CellDataFeatures<ICFBamChainObj, ICFBamRelationObj> p) {
                    ICFBamChainObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamRelationObj ref = obj.getRequiredLookupNextRel();
                        ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupNextRel.setCellFactory(
            new Callback<TableColumn<ICFBamChainObj, ICFBamRelationObj>, TableCell<ICFBamChainObj, ICFBamRelationObj>>() {
                @Override
                public TableCell<ICFBamChainObj, ICFBamRelationObj> call(
                        TableColumn<ICFBamChainObj, ICFBamRelationObj> arg) {
                    return new CFReferenceTableCell<ICFBamChainObj, ICFBamRelationObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupNextRel);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamChainObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamChainObj> observable, ICFBamChainObj oldValue,
                ICFBamChainObj newValue) {
            setJavaFXFocus(newValue);
        }
    });

    scrollMenu = new ScrollPane();
    scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER);
    scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED);
    scrollMenu.setFitToHeight(true);
    scrollMenu.setContent(getPanelHBoxMenu());

    setTop(scrollMenu);
    setCenter(dataTable);
    javafxIsInitializing = false;
    if (observableListOfChain != null) {
        dataTable.setItems(observableListOfChain);
    }
    adjustListButtons();
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXIndexListPane.java

public CFBamJavaFXIndexListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamTableObj argContainer, ICFBamIndexObj argFocus, Collection<ICFBamIndexObj> argDataCollection,
        ICFRefreshCallback refreshCallback, boolean sortByChain) {
    super();/*w  ww  .  jav  a 2  s  .c  o  m*/
    final String S_ProcName = "construct-schema-focus";
    if (formManager == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "formManager");
    }
    cfFormManager = formManager;
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2,
                "argSchema");
    }
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    javafxRefreshCallback = refreshCallback;
    javafxSortByChain = sortByChain;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamIndexObj>();
    tableColumnId = new TableColumn<ICFBamIndexObj, Long>("Id");
    tableColumnId
            .setCellValueFactory(new Callback<CellDataFeatures<ICFBamIndexObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamIndexObj, Long> p) {
                    ICFBamScopeObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        long value = obj.getRequiredId();
                        Long wrapped = new Long(value);
                        ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnId
            .setCellFactory(new Callback<TableColumn<ICFBamIndexObj, Long>, TableCell<ICFBamIndexObj, Long>>() {
                @Override
                public TableCell<ICFBamIndexObj, Long> call(TableColumn<ICFBamIndexObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamIndexObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamIndexObj, String> p) {
                    ICFBamIndexObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getRequiredName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnName.setCellFactory(
            new Callback<TableColumn<ICFBamIndexObj, String>, TableCell<ICFBamIndexObj, String>>() {
                @Override
                public TableCell<ICFBamIndexObj, String> call(TableColumn<ICFBamIndexObj, String> arg) {
                    return new CFStringTableCell<ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamIndexObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamIndexObj, String> p) {
                    ICFBamIndexObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalShortName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnShortName.setCellFactory(
            new Callback<TableColumn<ICFBamIndexObj, String>, TableCell<ICFBamIndexObj, String>>() {
                @Override
                public TableCell<ICFBamIndexObj, String> call(TableColumn<ICFBamIndexObj, String> arg) {
                    return new CFStringTableCell<ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamIndexObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamIndexObj, String> p) {
                    ICFBamIndexObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalLabel();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnLabel.setCellFactory(
            new Callback<TableColumn<ICFBamIndexObj, String>, TableCell<ICFBamIndexObj, String>>() {
                @Override
                public TableCell<ICFBamIndexObj, String> call(TableColumn<ICFBamIndexObj, String> arg) {
                    return new CFStringTableCell<ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamIndexObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamIndexObj, String> p) {
                    ICFBamIndexObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalShortDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnShortDescription.setCellFactory(
            new Callback<TableColumn<ICFBamIndexObj, String>, TableCell<ICFBamIndexObj, String>>() {
                @Override
                public TableCell<ICFBamIndexObj, String> call(TableColumn<ICFBamIndexObj, String> arg) {
                    return new CFStringTableCell<ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamIndexObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamIndexObj, String> p) {
                    ICFBamIndexObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDescription.setCellFactory(
            new Callback<TableColumn<ICFBamIndexObj, String>, TableCell<ICFBamIndexObj, String>>() {
                @Override
                public TableCell<ICFBamIndexObj, String> call(TableColumn<ICFBamIndexObj, String> arg) {
                    return new CFStringTableCell<ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnDbName = new TableColumn<ICFBamIndexObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamIndexObj, String> p) {
                    ICFBamIndexObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalDbName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDbName.setCellFactory(
            new Callback<TableColumn<ICFBamIndexObj, String>, TableCell<ICFBamIndexObj, String>>() {
                @Override
                public TableCell<ICFBamIndexObj, String> call(TableColumn<ICFBamIndexObj, String> arg) {
                    return new CFStringTableCell<ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnSuffix = new TableColumn<ICFBamIndexObj, String>("Suffix");
    tableColumnSuffix.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamIndexObj, String> p) {
                    ICFBamIndexObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalSuffix();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnSuffix.setCellFactory(
            new Callback<TableColumn<ICFBamIndexObj, String>, TableCell<ICFBamIndexObj, String>>() {
                @Override
                public TableCell<ICFBamIndexObj, String> call(TableColumn<ICFBamIndexObj, String> arg) {
                    return new CFStringTableCell<ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnSuffix);
    tableColumnIsUnique = new TableColumn<ICFBamIndexObj, Boolean>("Is Unique");
    tableColumnIsUnique.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamIndexObj, Boolean> p) {
                    ICFBamIndexObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredIsUnique();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnIsUnique.setCellFactory(
            new Callback<TableColumn<ICFBamIndexObj, Boolean>, TableCell<ICFBamIndexObj, Boolean>>() {
                @Override
                public TableCell<ICFBamIndexObj, Boolean> call(TableColumn<ICFBamIndexObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsUnique);
    tableColumnIsDbMapped = new TableColumn<ICFBamIndexObj, Boolean>("Is Db Mapped");
    tableColumnIsDbMapped.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamIndexObj, Boolean> p) {
                    ICFBamIndexObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredIsDbMapped();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnIsDbMapped.setCellFactory(
            new Callback<TableColumn<ICFBamIndexObj, Boolean>, TableCell<ICFBamIndexObj, Boolean>>() {
                @Override
                public TableCell<ICFBamIndexObj, Boolean> call(TableColumn<ICFBamIndexObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsDbMapped);
    tableColumnDefaultVisibility = new TableColumn<ICFBamIndexObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamIndexObj, Boolean> p) {
                    ICFBamIndexObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredDefaultVisibility();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnDefaultVisibility.setCellFactory(
            new Callback<TableColumn<ICFBamIndexObj, Boolean>, TableCell<ICFBamIndexObj, Boolean>>() {
                @Override
                public TableCell<ICFBamIndexObj, Boolean> call(TableColumn<ICFBamIndexObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnLookupDefSchema = new TableColumn<ICFBamIndexObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamIndexObj, ICFBamSchemaDefObj> p) {
                    ICFBamIndexObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema();
                        ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupDefSchema.setCellFactory(
            new Callback<TableColumn<ICFBamIndexObj, ICFBamSchemaDefObj>, TableCell<ICFBamIndexObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamIndexObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamIndexObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamIndexObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamIndexObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamIndexObj> observable, ICFBamIndexObj oldValue,
                ICFBamIndexObj newValue) {
            setJavaFXFocus(newValue);
        }
    });

    scrollMenu = new ScrollPane();
    scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER);
    scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED);
    scrollMenu.setFitToHeight(true);
    scrollMenu.setContent(getPanelHBoxMenu());

    setTop(scrollMenu);
    setCenter(dataTable);
    javafxIsInitializing = false;
    if (observableListOfIndex != null) {
        dataTable.setItems(observableListOfIndex);
    }
    adjustListButtons();
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXBlobColListPane.java

public CFBamJavaFXBlobColListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamTableObj argContainer, ICFBamBlobColObj argFocus, Collection<ICFBamBlobColObj> argDataCollection,
        ICFRefreshCallback refreshCallback, boolean sortByChain) {
    super();//from  w w w .  j  av a2  s  .  c om
    final String S_ProcName = "construct-schema-focus";
    if (formManager == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "formManager");
    }
    cfFormManager = formManager;
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2,
                "argSchema");
    }
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    javafxRefreshCallback = refreshCallback;
    javafxSortByChain = sortByChain;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamBlobColObj>();
    tableColumnId = new TableColumn<ICFBamBlobColObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamBlobColObj, Long> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        long value = obj.getRequiredId();
                        Long wrapped = new Long(value);
                        ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnId.setCellFactory(
            new Callback<TableColumn<ICFBamBlobColObj, Long>, TableCell<ICFBamBlobColObj, Long>>() {
                @Override
                public TableCell<ICFBamBlobColObj, Long> call(TableColumn<ICFBamBlobColObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamBlobColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamBlobColObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobColObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getRequiredName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnName.setCellFactory(
            new Callback<TableColumn<ICFBamBlobColObj, String>, TableCell<ICFBamBlobColObj, String>>() {
                @Override
                public TableCell<ICFBamBlobColObj, String> call(TableColumn<ICFBamBlobColObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamBlobColObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobColObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalShortName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnShortName.setCellFactory(
            new Callback<TableColumn<ICFBamBlobColObj, String>, TableCell<ICFBamBlobColObj, String>>() {
                @Override
                public TableCell<ICFBamBlobColObj, String> call(TableColumn<ICFBamBlobColObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamBlobColObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobColObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalLabel();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnLabel.setCellFactory(
            new Callback<TableColumn<ICFBamBlobColObj, String>, TableCell<ICFBamBlobColObj, String>>() {
                @Override
                public TableCell<ICFBamBlobColObj, String> call(TableColumn<ICFBamBlobColObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamBlobColObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobColObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalShortDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnShortDescription.setCellFactory(
            new Callback<TableColumn<ICFBamBlobColObj, String>, TableCell<ICFBamBlobColObj, String>>() {
                @Override
                public TableCell<ICFBamBlobColObj, String> call(TableColumn<ICFBamBlobColObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamBlobColObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobColObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDescription.setCellFactory(
            new Callback<TableColumn<ICFBamBlobColObj, String>, TableCell<ICFBamBlobColObj, String>>() {
                @Override
                public TableCell<ICFBamBlobColObj, String> call(TableColumn<ICFBamBlobColObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamBlobColObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBlobColObj, Boolean> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredIsNullable();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnIsNullable.setCellFactory(
            new Callback<TableColumn<ICFBamBlobColObj, Boolean>, TableCell<ICFBamBlobColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamBlobColObj, Boolean> call(TableColumn<ICFBamBlobColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamBlobColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamBlobColObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBlobColObj, Boolean> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Boolean value = obj.getOptionalGenerateId();
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnGenerateId.setCellFactory(
            new Callback<TableColumn<ICFBamBlobColObj, Boolean>, TableCell<ICFBamBlobColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamBlobColObj, Boolean> call(TableColumn<ICFBamBlobColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamBlobColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamBlobColObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBlobColObj, Boolean> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredDefaultVisibility();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnDefaultVisibility.setCellFactory(
            new Callback<TableColumn<ICFBamBlobColObj, Boolean>, TableCell<ICFBamBlobColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamBlobColObj, Boolean> call(TableColumn<ICFBamBlobColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamBlobColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamBlobColObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobColObj, String> p) {
                    ICFBamAtomObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalDbName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDbName.setCellFactory(
            new Callback<TableColumn<ICFBamBlobColObj, String>, TableCell<ICFBamBlobColObj, String>>() {
                @Override
                public TableCell<ICFBamBlobColObj, String> call(TableColumn<ICFBamBlobColObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnMaxLen = new TableColumn<ICFBamBlobColObj, Integer>("Max. Length");
    tableColumnMaxLen.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, Integer>, ObservableValue<Integer>>() {
                public ObservableValue<Integer> call(CellDataFeatures<ICFBamBlobColObj, Integer> p) {
                    ICFBamBlobDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        int value = obj.getRequiredMaxLen();
                        Integer wrapped = new Integer(value);
                        ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnMaxLen.setCellFactory(
            new Callback<TableColumn<ICFBamBlobColObj, Integer>, TableCell<ICFBamBlobColObj, Integer>>() {
                @Override
                public TableCell<ICFBamBlobColObj, Integer> call(TableColumn<ICFBamBlobColObj, Integer> arg) {
                    return new CFInt32TableCell<ICFBamBlobColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMaxLen);
    tableColumnLookupDefSchema = new TableColumn<ICFBamBlobColObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamBlobColObj, ICFBamSchemaDefObj> p) {
                    ICFBamBlobColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema();
                        ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupDefSchema.setCellFactory(
            new Callback<TableColumn<ICFBamBlobColObj, ICFBamSchemaDefObj>, TableCell<ICFBamBlobColObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamBlobColObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamBlobColObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamBlobColObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamBlobColObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamBlobColObj> observable, ICFBamBlobColObj oldValue,
                ICFBamBlobColObj newValue) {
            setJavaFXFocus(newValue);
        }
    });

    scrollMenu = new ScrollPane();
    scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER);
    scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED);
    scrollMenu.setFitToHeight(true);
    scrollMenu.setContent(getPanelHBoxMenu());

    setTop(scrollMenu);
    setCenter(dataTable);
    javafxIsInitializing = false;
    if (observableListOfBlobCol != null) {
        dataTable.setItems(observableListOfBlobCol);
    }
    adjustListButtons();
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXBlobTypeListPane.java

public CFBamJavaFXBlobTypeListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamSchemaDefObj argContainer, ICFBamBlobTypeObj argFocus,
        Collection<ICFBamBlobTypeObj> argDataCollection, ICFRefreshCallback refreshCallback,
        boolean sortByChain) {
    super();/*from  www  .j  av  a2  s  .c om*/
    final String S_ProcName = "construct-schema-focus";
    if (formManager == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "formManager");
    }
    cfFormManager = formManager;
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2,
                "argSchema");
    }
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    javafxRefreshCallback = refreshCallback;
    javafxSortByChain = sortByChain;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamBlobTypeObj>();
    tableColumnId = new TableColumn<ICFBamBlobTypeObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamBlobTypeObj, Long> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        long value = obj.getRequiredId();
                        Long wrapped = new Long(value);
                        ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnId.setCellFactory(
            new Callback<TableColumn<ICFBamBlobTypeObj, Long>, TableCell<ICFBamBlobTypeObj, Long>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, Long> call(TableColumn<ICFBamBlobTypeObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamBlobTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamBlobTypeObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobTypeObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getRequiredName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnName.setCellFactory(
            new Callback<TableColumn<ICFBamBlobTypeObj, String>, TableCell<ICFBamBlobTypeObj, String>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, String> call(TableColumn<ICFBamBlobTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamBlobTypeObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobTypeObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalShortName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnShortName.setCellFactory(
            new Callback<TableColumn<ICFBamBlobTypeObj, String>, TableCell<ICFBamBlobTypeObj, String>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, String> call(TableColumn<ICFBamBlobTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamBlobTypeObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobTypeObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalLabel();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnLabel.setCellFactory(
            new Callback<TableColumn<ICFBamBlobTypeObj, String>, TableCell<ICFBamBlobTypeObj, String>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, String> call(TableColumn<ICFBamBlobTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamBlobTypeObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobTypeObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalShortDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnShortDescription.setCellFactory(
            new Callback<TableColumn<ICFBamBlobTypeObj, String>, TableCell<ICFBamBlobTypeObj, String>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, String> call(TableColumn<ICFBamBlobTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamBlobTypeObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobTypeObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDescription.setCellFactory(
            new Callback<TableColumn<ICFBamBlobTypeObj, String>, TableCell<ICFBamBlobTypeObj, String>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, String> call(TableColumn<ICFBamBlobTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamBlobTypeObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBlobTypeObj, Boolean> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredIsNullable();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnIsNullable.setCellFactory(
            new Callback<TableColumn<ICFBamBlobTypeObj, Boolean>, TableCell<ICFBamBlobTypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, Boolean> call(TableColumn<ICFBamBlobTypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamBlobTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamBlobTypeObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBlobTypeObj, Boolean> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Boolean value = obj.getOptionalGenerateId();
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnGenerateId.setCellFactory(
            new Callback<TableColumn<ICFBamBlobTypeObj, Boolean>, TableCell<ICFBamBlobTypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, Boolean> call(TableColumn<ICFBamBlobTypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamBlobTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamBlobTypeObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBlobTypeObj, Boolean> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredDefaultVisibility();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnDefaultVisibility.setCellFactory(
            new Callback<TableColumn<ICFBamBlobTypeObj, Boolean>, TableCell<ICFBamBlobTypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, Boolean> call(TableColumn<ICFBamBlobTypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamBlobTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamBlobTypeObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobTypeObj, String> p) {
                    ICFBamAtomObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalDbName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDbName.setCellFactory(
            new Callback<TableColumn<ICFBamBlobTypeObj, String>, TableCell<ICFBamBlobTypeObj, String>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, String> call(TableColumn<ICFBamBlobTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnMaxLen = new TableColumn<ICFBamBlobTypeObj, Integer>("Max. Length");
    tableColumnMaxLen.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, Integer>, ObservableValue<Integer>>() {
                public ObservableValue<Integer> call(CellDataFeatures<ICFBamBlobTypeObj, Integer> p) {
                    ICFBamBlobDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        int value = obj.getRequiredMaxLen();
                        Integer wrapped = new Integer(value);
                        ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnMaxLen.setCellFactory(
            new Callback<TableColumn<ICFBamBlobTypeObj, Integer>, TableCell<ICFBamBlobTypeObj, Integer>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, Integer> call(TableColumn<ICFBamBlobTypeObj, Integer> arg) {
                    return new CFInt32TableCell<ICFBamBlobTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMaxLen);
    tableColumnLookupDefSchema = new TableColumn<ICFBamBlobTypeObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamBlobTypeObj, ICFBamSchemaDefObj> p) {
                    ICFBamBlobTypeObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema();
                        ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupDefSchema.setCellFactory(
            new Callback<TableColumn<ICFBamBlobTypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamBlobTypeObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamBlobTypeObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamBlobTypeObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamBlobTypeObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamBlobTypeObj> observable, ICFBamBlobTypeObj oldValue,
                ICFBamBlobTypeObj newValue) {
            setJavaFXFocus(newValue);
        }
    });

    scrollMenu = new ScrollPane();
    scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER);
    scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED);
    scrollMenu.setFitToHeight(true);
    scrollMenu.setContent(getPanelHBoxMenu());

    setTop(scrollMenu);
    setCenter(dataTable);
    javafxIsInitializing = false;
    if (observableListOfBlobType != null) {
        dataTable.setItems(observableListOfBlobType);
    }
    adjustListButtons();
}