List of usage examples for javafx.util Callback Callback
Callback
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXInt32TypeListPane.java
public CFBamJavaFXInt32TypeListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamSchemaDefObj argContainer, ICFBamInt32TypeObj argFocus, Collection<ICFBamInt32TypeObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/*from w w w .ja va2 s . 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<ICFBamInt32TypeObj>(); tableColumnObjKind = new TableColumn<ICFBamInt32TypeObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32TypeObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamInt32TypeObj, String> p) { ICFBamInt32TypeObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamInt32TypeObj, String>, TableCell<ICFBamInt32TypeObj, String>>() { @Override public TableCell<ICFBamInt32TypeObj, String> call(TableColumn<ICFBamInt32TypeObj, String> arg) { return new CFStringTableCell<ICFBamInt32TypeObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamInt32TypeObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32TypeObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamInt32TypeObj, 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<ICFBamInt32TypeObj, Long>, TableCell<ICFBamInt32TypeObj, Long>>() { @Override public TableCell<ICFBamInt32TypeObj, Long> call(TableColumn<ICFBamInt32TypeObj, Long> arg) { return new CFInt64TableCell<ICFBamInt32TypeObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamInt32TypeObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32TypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt32TypeObj, 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<ICFBamInt32TypeObj, String>, TableCell<ICFBamInt32TypeObj, String>>() { @Override public TableCell<ICFBamInt32TypeObj, String> call(TableColumn<ICFBamInt32TypeObj, String> arg) { return new CFStringTableCell<ICFBamInt32TypeObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamInt32TypeObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32TypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt32TypeObj, 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<ICFBamInt32TypeObj, String>, TableCell<ICFBamInt32TypeObj, String>>() { @Override public TableCell<ICFBamInt32TypeObj, String> call(TableColumn<ICFBamInt32TypeObj, String> arg) { return new CFStringTableCell<ICFBamInt32TypeObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamInt32TypeObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32TypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt32TypeObj, 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<ICFBamInt32TypeObj, String>, TableCell<ICFBamInt32TypeObj, String>>() { @Override public TableCell<ICFBamInt32TypeObj, String> call(TableColumn<ICFBamInt32TypeObj, String> arg) { return new CFStringTableCell<ICFBamInt32TypeObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamInt32TypeObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32TypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt32TypeObj, 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<ICFBamInt32TypeObj, String>, TableCell<ICFBamInt32TypeObj, String>>() { @Override public TableCell<ICFBamInt32TypeObj, String> call(TableColumn<ICFBamInt32TypeObj, String> arg) { return new CFStringTableCell<ICFBamInt32TypeObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamInt32TypeObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32TypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt32TypeObj, 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<ICFBamInt32TypeObj, String>, TableCell<ICFBamInt32TypeObj, String>>() { @Override public TableCell<ICFBamInt32TypeObj, String> call(TableColumn<ICFBamInt32TypeObj, String> arg) { return new CFStringTableCell<ICFBamInt32TypeObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamInt32TypeObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32TypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt32TypeObj, 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<ICFBamInt32TypeObj, Boolean>, TableCell<ICFBamInt32TypeObj, Boolean>>() { @Override public TableCell<ICFBamInt32TypeObj, Boolean> call( TableColumn<ICFBamInt32TypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt32TypeObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamInt32TypeObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32TypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt32TypeObj, 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<ICFBamInt32TypeObj, Boolean>, TableCell<ICFBamInt32TypeObj, Boolean>>() { @Override public TableCell<ICFBamInt32TypeObj, Boolean> call( TableColumn<ICFBamInt32TypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt32TypeObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamInt32TypeObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32TypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt32TypeObj, 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<ICFBamInt32TypeObj, Boolean>, TableCell<ICFBamInt32TypeObj, Boolean>>() { @Override public TableCell<ICFBamInt32TypeObj, Boolean> call( TableColumn<ICFBamInt32TypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt32TypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamInt32TypeObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32TypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt32TypeObj, 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<ICFBamInt32TypeObj, String>, TableCell<ICFBamInt32TypeObj, String>>() { @Override public TableCell<ICFBamInt32TypeObj, String> call(TableColumn<ICFBamInt32TypeObj, String> arg) { return new CFStringTableCell<ICFBamInt32TypeObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamInt32TypeObj, Integer>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32TypeObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32TypeObj, Integer> p) { ICFBamInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamInt32TypeObj, Integer>, TableCell<ICFBamInt32TypeObj, Integer>>() { @Override public TableCell<ICFBamInt32TypeObj, Integer> call( TableColumn<ICFBamInt32TypeObj, Integer> arg) { return new CFInt32TableCell<ICFBamInt32TypeObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamInt32TypeObj, Integer>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32TypeObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32TypeObj, Integer> p) { ICFBamInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamInt32TypeObj, Integer>, TableCell<ICFBamInt32TypeObj, Integer>>() { @Override public TableCell<ICFBamInt32TypeObj, Integer> call( TableColumn<ICFBamInt32TypeObj, Integer> arg) { return new CFInt32TableCell<ICFBamInt32TypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamInt32TypeObj, Integer>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32TypeObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32TypeObj, Integer> p) { ICFBamInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamInt32TypeObj, Integer>, TableCell<ICFBamInt32TypeObj, Integer>>() { @Override public TableCell<ICFBamInt32TypeObj, Integer> call( TableColumn<ICFBamInt32TypeObj, Integer> arg) { return new CFInt32TableCell<ICFBamInt32TypeObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamInt32TypeObj, Integer>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32TypeObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32TypeObj, Integer> p) { ICFBamInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamInt32TypeObj, Integer>, TableCell<ICFBamInt32TypeObj, Integer>>() { @Override public TableCell<ICFBamInt32TypeObj, Integer> call( TableColumn<ICFBamInt32TypeObj, Integer> arg) { return new CFInt32TableCell<ICFBamInt32TypeObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamInt32TypeObj, Integer>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32TypeObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32TypeObj, Integer> p) { ICFBamInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamInt32TypeObj, Integer>, TableCell<ICFBamInt32TypeObj, Integer>>() { @Override public TableCell<ICFBamInt32TypeObj, Integer> call( TableColumn<ICFBamInt32TypeObj, Integer> arg) { return new CFInt32TableCell<ICFBamInt32TypeObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamInt32TypeObj, Integer>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32TypeObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32TypeObj, Integer> p) { ICFBamInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamInt32TypeObj, Integer>, TableCell<ICFBamInt32TypeObj, Integer>>() { @Override public TableCell<ICFBamInt32TypeObj, Integer> call( TableColumn<ICFBamInt32TypeObj, Integer> arg) { return new CFInt32TableCell<ICFBamInt32TypeObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamInt32TypeObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32TypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamInt32TypeObj, ICFBamSchemaDefObj> p) { ICFBamInt32TypeObj 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<ICFBamInt32TypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamInt32TypeObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamInt32TypeObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamInt32TypeObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamInt32TypeObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamInt32TypeObj>() { @Override public void changed(ObservableValue<? extends ICFBamInt32TypeObj> observable, ICFBamInt32TypeObj oldValue, ICFBamInt32TypeObj 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 (observableListOfInt32Type != null) { dataTable.setItems(observableListOfInt32Type); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXUInt16DefListPane.java
public CFBamJavaFXUInt16DefListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argContainer, ICFBamUInt16DefObj argFocus, Collection<ICFBamUInt16DefObj> 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<ICFBamUInt16DefObj>(); tableColumnObjKind = new TableColumn<ICFBamUInt16DefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamUInt16DefObj, String> p) { ICFBamUInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamUInt16DefObj, String>, TableCell<ICFBamUInt16DefObj, String>>() { @Override public TableCell<ICFBamUInt16DefObj, String> call(TableColumn<ICFBamUInt16DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamUInt16DefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, Long>, TableCell<ICFBamUInt16DefObj, Long>>() { @Override public TableCell<ICFBamUInt16DefObj, Long> call(TableColumn<ICFBamUInt16DefObj, Long> arg) { return new CFInt64TableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamUInt16DefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, String>, TableCell<ICFBamUInt16DefObj, String>>() { @Override public TableCell<ICFBamUInt16DefObj, String> call(TableColumn<ICFBamUInt16DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamUInt16DefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, String>, TableCell<ICFBamUInt16DefObj, String>>() { @Override public TableCell<ICFBamUInt16DefObj, String> call(TableColumn<ICFBamUInt16DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamUInt16DefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, String>, TableCell<ICFBamUInt16DefObj, String>>() { @Override public TableCell<ICFBamUInt16DefObj, String> call(TableColumn<ICFBamUInt16DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamUInt16DefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, String>, TableCell<ICFBamUInt16DefObj, String>>() { @Override public TableCell<ICFBamUInt16DefObj, String> call(TableColumn<ICFBamUInt16DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamUInt16DefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, String>, TableCell<ICFBamUInt16DefObj, String>>() { @Override public TableCell<ICFBamUInt16DefObj, String> call(TableColumn<ICFBamUInt16DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamUInt16DefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, Boolean>, TableCell<ICFBamUInt16DefObj, Boolean>>() { @Override public TableCell<ICFBamUInt16DefObj, Boolean> call( TableColumn<ICFBamUInt16DefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamUInt16DefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, Boolean>, TableCell<ICFBamUInt16DefObj, Boolean>>() { @Override public TableCell<ICFBamUInt16DefObj, Boolean> call( TableColumn<ICFBamUInt16DefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamUInt16DefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, Boolean>, TableCell<ICFBamUInt16DefObj, Boolean>>() { @Override public TableCell<ICFBamUInt16DefObj, Boolean> call( TableColumn<ICFBamUInt16DefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamUInt16DefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, String>, TableCell<ICFBamUInt16DefObj, String>>() { @Override public TableCell<ICFBamUInt16DefObj, String> call(TableColumn<ICFBamUInt16DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamUInt16DefObj, Integer>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamUInt16DefObj, Integer> p) { ICFBamUInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamUInt16DefObj, Integer>, TableCell<ICFBamUInt16DefObj, Integer>>() { @Override public TableCell<ICFBamUInt16DefObj, Integer> call( TableColumn<ICFBamUInt16DefObj, Integer> arg) { return new CFUInt16TableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamUInt16DefObj, Integer>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamUInt16DefObj, Integer> p) { ICFBamUInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamUInt16DefObj, Integer>, TableCell<ICFBamUInt16DefObj, Integer>>() { @Override public TableCell<ICFBamUInt16DefObj, Integer> call( TableColumn<ICFBamUInt16DefObj, Integer> arg) { return new CFUInt16TableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamUInt16DefObj, Integer>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamUInt16DefObj, Integer> p) { ICFBamUInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamUInt16DefObj, Integer>, TableCell<ICFBamUInt16DefObj, Integer>>() { @Override public TableCell<ICFBamUInt16DefObj, Integer> call( TableColumn<ICFBamUInt16DefObj, Integer> arg) { return new CFUInt16TableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamUInt16DefObj, Integer>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamUInt16DefObj, Integer> p) { ICFBamUInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamUInt16DefObj, Integer>, TableCell<ICFBamUInt16DefObj, Integer>>() { @Override public TableCell<ICFBamUInt16DefObj, Integer> call( TableColumn<ICFBamUInt16DefObj, Integer> arg) { return new CFUInt16TableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamUInt16DefObj, Integer>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamUInt16DefObj, Integer> p) { ICFBamUInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamUInt16DefObj, Integer>, TableCell<ICFBamUInt16DefObj, Integer>>() { @Override public TableCell<ICFBamUInt16DefObj, Integer> call( TableColumn<ICFBamUInt16DefObj, Integer> arg) { return new CFUInt16TableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamUInt16DefObj, Integer>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamUInt16DefObj, Integer> p) { ICFBamUInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamUInt16DefObj, Integer>, TableCell<ICFBamUInt16DefObj, Integer>>() { @Override public TableCell<ICFBamUInt16DefObj, Integer> call( TableColumn<ICFBamUInt16DefObj, Integer> arg) { return new CFUInt16TableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamUInt16DefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamUInt16DefObj, ICFBamSchemaDefObj> p) { ICFBamUInt16DefObj 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<ICFBamUInt16DefObj, ICFBamSchemaDefObj>, TableCell<ICFBamUInt16DefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamUInt16DefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamUInt16DefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamUInt16DefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamUInt16DefObj>() { @Override public void changed(ObservableValue<? extends ICFBamUInt16DefObj> observable, ICFBamUInt16DefObj oldValue, ICFBamUInt16DefObj 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 (observableListOfUInt16Def != null) { dataTable.setItems(observableListOfUInt16Def); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTZDateDefListPane.java
public CFBamJavaFXTZDateDefListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argContainer, ICFBamTZDateDefObj argFocus, Collection<ICFBamTZDateDefObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();// w w w . j ava 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<ICFBamTZDateDefObj>(); tableColumnObjKind = new TableColumn<ICFBamTZDateDefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamTZDateDefObj, String> p) { ICFBamTZDateDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamTZDateDefObj, String>, TableCell<ICFBamTZDateDefObj, String>>() { @Override public TableCell<ICFBamTZDateDefObj, String> call(TableColumn<ICFBamTZDateDefObj, String> arg) { return new CFStringTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamTZDateDefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, Long>, TableCell<ICFBamTZDateDefObj, Long>>() { @Override public TableCell<ICFBamTZDateDefObj, Long> call(TableColumn<ICFBamTZDateDefObj, Long> arg) { return new CFInt64TableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamTZDateDefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, String>, TableCell<ICFBamTZDateDefObj, String>>() { @Override public TableCell<ICFBamTZDateDefObj, String> call(TableColumn<ICFBamTZDateDefObj, String> arg) { return new CFStringTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamTZDateDefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, String>, TableCell<ICFBamTZDateDefObj, String>>() { @Override public TableCell<ICFBamTZDateDefObj, String> call(TableColumn<ICFBamTZDateDefObj, String> arg) { return new CFStringTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamTZDateDefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, String>, TableCell<ICFBamTZDateDefObj, String>>() { @Override public TableCell<ICFBamTZDateDefObj, String> call(TableColumn<ICFBamTZDateDefObj, String> arg) { return new CFStringTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamTZDateDefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, String>, TableCell<ICFBamTZDateDefObj, String>>() { @Override public TableCell<ICFBamTZDateDefObj, String> call(TableColumn<ICFBamTZDateDefObj, String> arg) { return new CFStringTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamTZDateDefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, String>, TableCell<ICFBamTZDateDefObj, String>>() { @Override public TableCell<ICFBamTZDateDefObj, String> call(TableColumn<ICFBamTZDateDefObj, String> arg) { return new CFStringTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamTZDateDefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, Boolean>, TableCell<ICFBamTZDateDefObj, Boolean>>() { @Override public TableCell<ICFBamTZDateDefObj, Boolean> call( TableColumn<ICFBamTZDateDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamTZDateDefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, Boolean>, TableCell<ICFBamTZDateDefObj, Boolean>>() { @Override public TableCell<ICFBamTZDateDefObj, Boolean> call( TableColumn<ICFBamTZDateDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamTZDateDefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, Boolean>, TableCell<ICFBamTZDateDefObj, Boolean>>() { @Override public TableCell<ICFBamTZDateDefObj, Boolean> call( TableColumn<ICFBamTZDateDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamTZDateDefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, String>, TableCell<ICFBamTZDateDefObj, String>>() { @Override public TableCell<ICFBamTZDateDefObj, String> call(TableColumn<ICFBamTZDateDefObj, String> arg) { return new CFStringTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamTZDateDefObj, Calendar>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZDateDefObj, Calendar> p) { ICFBamTZDateDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamTZDateDefObj, Calendar>, TableCell<ICFBamTZDateDefObj, Calendar>>() { @Override public TableCell<ICFBamTZDateDefObj, Calendar> call( TableColumn<ICFBamTZDateDefObj, Calendar> arg) { return new CFTZDateTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamTZDateDefObj, Calendar>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZDateDefObj, Calendar> p) { ICFBamTZDateDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamTZDateDefObj, Calendar>, TableCell<ICFBamTZDateDefObj, Calendar>>() { @Override public TableCell<ICFBamTZDateDefObj, Calendar> call( TableColumn<ICFBamTZDateDefObj, Calendar> arg) { return new CFTZDateTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamTZDateDefObj, Calendar>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZDateDefObj, Calendar> p) { ICFBamTZDateDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamTZDateDefObj, Calendar>, TableCell<ICFBamTZDateDefObj, Calendar>>() { @Override public TableCell<ICFBamTZDateDefObj, Calendar> call( TableColumn<ICFBamTZDateDefObj, Calendar> arg) { return new CFTZDateTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamTZDateDefObj, Calendar>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZDateDefObj, Calendar> p) { ICFBamTZDateDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamTZDateDefObj, Calendar>, TableCell<ICFBamTZDateDefObj, Calendar>>() { @Override public TableCell<ICFBamTZDateDefObj, Calendar> call( TableColumn<ICFBamTZDateDefObj, Calendar> arg) { return new CFTZDateTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamTZDateDefObj, Calendar>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZDateDefObj, Calendar> p) { ICFBamTZDateDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamTZDateDefObj, Calendar>, TableCell<ICFBamTZDateDefObj, Calendar>>() { @Override public TableCell<ICFBamTZDateDefObj, Calendar> call( TableColumn<ICFBamTZDateDefObj, Calendar> arg) { return new CFTZDateTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamTZDateDefObj, Calendar>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZDateDefObj, Calendar> p) { ICFBamTZDateDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamTZDateDefObj, Calendar>, TableCell<ICFBamTZDateDefObj, Calendar>>() { @Override public TableCell<ICFBamTZDateDefObj, Calendar> call( TableColumn<ICFBamTZDateDefObj, Calendar> arg) { return new CFTZDateTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamTZDateDefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamTZDateDefObj, ICFBamSchemaDefObj> p) { ICFBamTZDateDefObj 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<ICFBamTZDateDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamTZDateDefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamTZDateDefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamTZDateDefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamTZDateDefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamTZDateDefObj>() { @Override public void changed(ObservableValue<? extends ICFBamTZDateDefObj> observable, ICFBamTZDateDefObj oldValue, ICFBamTZDateDefObj 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 (observableListOfTZDateDef != null) { dataTable.setItems(observableListOfTZDateDef); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXUInt64DefListPane.java
public CFBamJavaFXUInt64DefListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argContainer, ICFBamUInt64DefObj argFocus, Collection<ICFBamUInt64DefObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();//from w w w . j av a 2s. 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<ICFBamUInt64DefObj>(); tableColumnObjKind = new TableColumn<ICFBamUInt64DefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamUInt64DefObj, String> p) { ICFBamUInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamUInt64DefObj, String>, TableCell<ICFBamUInt64DefObj, String>>() { @Override public TableCell<ICFBamUInt64DefObj, String> call(TableColumn<ICFBamUInt64DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamUInt64DefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamUInt64DefObj, 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<ICFBamUInt64DefObj, Long>, TableCell<ICFBamUInt64DefObj, Long>>() { @Override public TableCell<ICFBamUInt64DefObj, Long> call(TableColumn<ICFBamUInt64DefObj, Long> arg) { return new CFInt64TableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamUInt64DefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt64DefObj, 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<ICFBamUInt64DefObj, String>, TableCell<ICFBamUInt64DefObj, String>>() { @Override public TableCell<ICFBamUInt64DefObj, String> call(TableColumn<ICFBamUInt64DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamUInt64DefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt64DefObj, 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<ICFBamUInt64DefObj, String>, TableCell<ICFBamUInt64DefObj, String>>() { @Override public TableCell<ICFBamUInt64DefObj, String> call(TableColumn<ICFBamUInt64DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamUInt64DefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt64DefObj, 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<ICFBamUInt64DefObj, String>, TableCell<ICFBamUInt64DefObj, String>>() { @Override public TableCell<ICFBamUInt64DefObj, String> call(TableColumn<ICFBamUInt64DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamUInt64DefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt64DefObj, 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<ICFBamUInt64DefObj, String>, TableCell<ICFBamUInt64DefObj, String>>() { @Override public TableCell<ICFBamUInt64DefObj, String> call(TableColumn<ICFBamUInt64DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamUInt64DefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt64DefObj, 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<ICFBamUInt64DefObj, String>, TableCell<ICFBamUInt64DefObj, String>>() { @Override public TableCell<ICFBamUInt64DefObj, String> call(TableColumn<ICFBamUInt64DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamUInt64DefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUInt64DefObj, 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<ICFBamUInt64DefObj, Boolean>, TableCell<ICFBamUInt64DefObj, Boolean>>() { @Override public TableCell<ICFBamUInt64DefObj, Boolean> call( TableColumn<ICFBamUInt64DefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamUInt64DefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUInt64DefObj, 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<ICFBamUInt64DefObj, Boolean>, TableCell<ICFBamUInt64DefObj, Boolean>>() { @Override public TableCell<ICFBamUInt64DefObj, Boolean> call( TableColumn<ICFBamUInt64DefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamUInt64DefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUInt64DefObj, 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<ICFBamUInt64DefObj, Boolean>, TableCell<ICFBamUInt64DefObj, Boolean>>() { @Override public TableCell<ICFBamUInt64DefObj, Boolean> call( TableColumn<ICFBamUInt64DefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamUInt64DefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt64DefObj, 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<ICFBamUInt64DefObj, String>, TableCell<ICFBamUInt64DefObj, String>>() { @Override public TableCell<ICFBamUInt64DefObj, String> call(TableColumn<ICFBamUInt64DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamUInt64DefObj, BigDecimal>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamUInt64DefObj, BigDecimal> p) { ICFBamUInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamUInt64DefObj, BigDecimal>, TableCell<ICFBamUInt64DefObj, BigDecimal>>() { @Override public TableCell<ICFBamUInt64DefObj, BigDecimal> call( TableColumn<ICFBamUInt64DefObj, BigDecimal> arg) { return new CFUInt64TableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamUInt64DefObj, BigDecimal>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamUInt64DefObj, BigDecimal> p) { ICFBamUInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamUInt64DefObj, BigDecimal>, TableCell<ICFBamUInt64DefObj, BigDecimal>>() { @Override public TableCell<ICFBamUInt64DefObj, BigDecimal> call( TableColumn<ICFBamUInt64DefObj, BigDecimal> arg) { return new CFUInt64TableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamUInt64DefObj, BigDecimal>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamUInt64DefObj, BigDecimal> p) { ICFBamUInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamUInt64DefObj, BigDecimal>, TableCell<ICFBamUInt64DefObj, BigDecimal>>() { @Override public TableCell<ICFBamUInt64DefObj, BigDecimal> call( TableColumn<ICFBamUInt64DefObj, BigDecimal> arg) { return new CFUInt64TableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamUInt64DefObj, BigDecimal>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamUInt64DefObj, BigDecimal> p) { ICFBamUInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamUInt64DefObj, BigDecimal>, TableCell<ICFBamUInt64DefObj, BigDecimal>>() { @Override public TableCell<ICFBamUInt64DefObj, BigDecimal> call( TableColumn<ICFBamUInt64DefObj, BigDecimal> arg) { return new CFUInt64TableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamUInt64DefObj, BigDecimal>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamUInt64DefObj, BigDecimal> p) { ICFBamUInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamUInt64DefObj, BigDecimal>, TableCell<ICFBamUInt64DefObj, BigDecimal>>() { @Override public TableCell<ICFBamUInt64DefObj, BigDecimal> call( TableColumn<ICFBamUInt64DefObj, BigDecimal> arg) { return new CFUInt64TableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamUInt64DefObj, BigDecimal>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamUInt64DefObj, BigDecimal> p) { ICFBamUInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamUInt64DefObj, BigDecimal>, TableCell<ICFBamUInt64DefObj, BigDecimal>>() { @Override public TableCell<ICFBamUInt64DefObj, BigDecimal> call( TableColumn<ICFBamUInt64DefObj, BigDecimal> arg) { return new CFUInt64TableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamUInt64DefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamUInt64DefObj, ICFBamSchemaDefObj> p) { ICFBamUInt64DefObj 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<ICFBamUInt64DefObj, ICFBamSchemaDefObj>, TableCell<ICFBamUInt64DefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamUInt64DefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamUInt64DefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamUInt64DefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamUInt64DefObj>() { @Override public void changed(ObservableValue<? extends ICFBamUInt64DefObj> observable, ICFBamUInt64DefObj oldValue, ICFBamUInt64DefObj 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 (observableListOfUInt64Def != null) { dataTable.setItems(observableListOfUInt64Def); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXInt64DefListPane.java
public CFBamJavaFXInt64DefListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argContainer, ICFBamInt64DefObj argFocus, Collection<ICFBamInt64DefObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/* w w w .j a va2 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<ICFBamInt64DefObj>(); tableColumnObjKind = new TableColumn<ICFBamInt64DefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64DefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamInt64DefObj, String> p) { ICFBamInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamInt64DefObj, String>, TableCell<ICFBamInt64DefObj, String>>() { @Override public TableCell<ICFBamInt64DefObj, String> call(TableColumn<ICFBamInt64DefObj, String> arg) { return new CFStringTableCell<ICFBamInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamInt64DefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64DefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamInt64DefObj, 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<ICFBamInt64DefObj, Long>, TableCell<ICFBamInt64DefObj, Long>>() { @Override public TableCell<ICFBamInt64DefObj, Long> call(TableColumn<ICFBamInt64DefObj, Long> arg) { return new CFInt64TableCell<ICFBamInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamInt64DefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt64DefObj, 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<ICFBamInt64DefObj, String>, TableCell<ICFBamInt64DefObj, String>>() { @Override public TableCell<ICFBamInt64DefObj, String> call(TableColumn<ICFBamInt64DefObj, String> arg) { return new CFStringTableCell<ICFBamInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamInt64DefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt64DefObj, 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<ICFBamInt64DefObj, String>, TableCell<ICFBamInt64DefObj, String>>() { @Override public TableCell<ICFBamInt64DefObj, String> call(TableColumn<ICFBamInt64DefObj, String> arg) { return new CFStringTableCell<ICFBamInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamInt64DefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt64DefObj, 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<ICFBamInt64DefObj, String>, TableCell<ICFBamInt64DefObj, String>>() { @Override public TableCell<ICFBamInt64DefObj, String> call(TableColumn<ICFBamInt64DefObj, String> arg) { return new CFStringTableCell<ICFBamInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamInt64DefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt64DefObj, 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<ICFBamInt64DefObj, String>, TableCell<ICFBamInt64DefObj, String>>() { @Override public TableCell<ICFBamInt64DefObj, String> call(TableColumn<ICFBamInt64DefObj, String> arg) { return new CFStringTableCell<ICFBamInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamInt64DefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt64DefObj, 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<ICFBamInt64DefObj, String>, TableCell<ICFBamInt64DefObj, String>>() { @Override public TableCell<ICFBamInt64DefObj, String> call(TableColumn<ICFBamInt64DefObj, String> arg) { return new CFStringTableCell<ICFBamInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamInt64DefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64DefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt64DefObj, 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<ICFBamInt64DefObj, Boolean>, TableCell<ICFBamInt64DefObj, Boolean>>() { @Override public TableCell<ICFBamInt64DefObj, Boolean> call(TableColumn<ICFBamInt64DefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamInt64DefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64DefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt64DefObj, 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<ICFBamInt64DefObj, Boolean>, TableCell<ICFBamInt64DefObj, Boolean>>() { @Override public TableCell<ICFBamInt64DefObj, Boolean> call(TableColumn<ICFBamInt64DefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamInt64DefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64DefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt64DefObj, 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<ICFBamInt64DefObj, Boolean>, TableCell<ICFBamInt64DefObj, Boolean>>() { @Override public TableCell<ICFBamInt64DefObj, Boolean> call(TableColumn<ICFBamInt64DefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamInt64DefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt64DefObj, 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<ICFBamInt64DefObj, String>, TableCell<ICFBamInt64DefObj, String>>() { @Override public TableCell<ICFBamInt64DefObj, String> call(TableColumn<ICFBamInt64DefObj, String> arg) { return new CFStringTableCell<ICFBamInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamInt64DefObj, Long>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64DefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamInt64DefObj, Long> p) { ICFBamInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Long value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamInt64DefObj, Long>, TableCell<ICFBamInt64DefObj, Long>>() { @Override public TableCell<ICFBamInt64DefObj, Long> call(TableColumn<ICFBamInt64DefObj, Long> arg) { return new CFInt64TableCell<ICFBamInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamInt64DefObj, Long>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64DefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamInt64DefObj, Long> p) { ICFBamInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Long value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamInt64DefObj, Long>, TableCell<ICFBamInt64DefObj, Long>>() { @Override public TableCell<ICFBamInt64DefObj, Long> call(TableColumn<ICFBamInt64DefObj, Long> arg) { return new CFInt64TableCell<ICFBamInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamInt64DefObj, Long>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64DefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamInt64DefObj, Long> p) { ICFBamInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Long value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamInt64DefObj, Long>, TableCell<ICFBamInt64DefObj, Long>>() { @Override public TableCell<ICFBamInt64DefObj, Long> call(TableColumn<ICFBamInt64DefObj, Long> arg) { return new CFInt64TableCell<ICFBamInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamInt64DefObj, Long>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64DefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamInt64DefObj, Long> p) { ICFBamInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Long value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamInt64DefObj, Long>, TableCell<ICFBamInt64DefObj, Long>>() { @Override public TableCell<ICFBamInt64DefObj, Long> call(TableColumn<ICFBamInt64DefObj, Long> arg) { return new CFInt64TableCell<ICFBamInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamInt64DefObj, Long>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64DefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamInt64DefObj, Long> p) { ICFBamInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Long value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamInt64DefObj, Long>, TableCell<ICFBamInt64DefObj, Long>>() { @Override public TableCell<ICFBamInt64DefObj, Long> call(TableColumn<ICFBamInt64DefObj, Long> arg) { return new CFInt64TableCell<ICFBamInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamInt64DefObj, Long>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64DefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamInt64DefObj, Long> p) { ICFBamInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Long value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamInt64DefObj, Long>, TableCell<ICFBamInt64DefObj, Long>>() { @Override public TableCell<ICFBamInt64DefObj, Long> call(TableColumn<ICFBamInt64DefObj, Long> arg) { return new CFInt64TableCell<ICFBamInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamInt64DefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64DefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamInt64DefObj, ICFBamSchemaDefObj> p) { ICFBamInt64DefObj 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<ICFBamInt64DefObj, ICFBamSchemaDefObj>, TableCell<ICFBamInt64DefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamInt64DefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamInt64DefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamInt64DefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamInt64DefObj>() { @Override public void changed(ObservableValue<? extends ICFBamInt64DefObj> observable, ICFBamInt64DefObj oldValue, ICFBamInt64DefObj 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 (observableListOfInt64Def != null) { dataTable.setItems(observableListOfInt64Def); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXNmTokenDefListPane.java
public CFBamJavaFXNmTokenDefListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argContainer, ICFBamNmTokenDefObj argFocus, Collection<ICFBamNmTokenDefObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();//from ww w. j av a 2 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<ICFBamNmTokenDefObj>(); tableColumnObjKind = new TableColumn<ICFBamNmTokenDefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamNmTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamNmTokenDefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamNmTokenDefObj, 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<ICFBamNmTokenDefObj, Long>, TableCell<ICFBamNmTokenDefObj, Long>>() { @Override public TableCell<ICFBamNmTokenDefObj, Long> call(TableColumn<ICFBamNmTokenDefObj, Long> arg) { return new CFInt64TableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamNmTokenDefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, 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<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamNmTokenDefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, 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<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamNmTokenDefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, 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<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamNmTokenDefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, 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<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamNmTokenDefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, 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<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamNmTokenDefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokenDefObj, 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<ICFBamNmTokenDefObj, Boolean>, TableCell<ICFBamNmTokenDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokenDefObj, Boolean> call( TableColumn<ICFBamNmTokenDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamNmTokenDefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokenDefObj, 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<ICFBamNmTokenDefObj, Boolean>, TableCell<ICFBamNmTokenDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokenDefObj, Boolean> call( TableColumn<ICFBamNmTokenDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamNmTokenDefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokenDefObj, 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<ICFBamNmTokenDefObj, Boolean>, TableCell<ICFBamNmTokenDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokenDefObj, Boolean> call( TableColumn<ICFBamNmTokenDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamNmTokenDefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, 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<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnMaxLen = new TableColumn<ICFBamNmTokenDefObj, Integer>("Max. Length"); tableColumnMaxLen.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamNmTokenDefObj, Integer> p) { ICFBamNmTokenDefObj 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<ICFBamNmTokenDefObj, Integer>, TableCell<ICFBamNmTokenDefObj, Integer>>() { @Override public TableCell<ICFBamNmTokenDefObj, Integer> call( TableColumn<ICFBamNmTokenDefObj, Integer> arg) { return new CFInt32TableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnMaxLen); tableColumnInitValue = new TableColumn<ICFBamNmTokenDefObj, String>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamNmTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFNmTokenTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamNmTokenDefObj, String>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamNmTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFNmTokenTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamNmTokenDefObj, String>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamNmTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFNmTokenTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamNmTokenDefObj, String>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamNmTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFNmTokenTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnShowLines = new TableColumn<ICFBamNmTokenDefObj, Short>("Show Lines"); tableColumnShowLines.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamNmTokenDefObj, Short> p) { ICFBamNmTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { short value = obj.getRequiredShowLines(); Short wrapped = new Short(value); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(wrapped); return (observable); } } }); tableColumnShowLines.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, Short>, TableCell<ICFBamNmTokenDefObj, Short>>() { @Override public TableCell<ICFBamNmTokenDefObj, Short> call(TableColumn<ICFBamNmTokenDefObj, Short> arg) { return new CFInt16TableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnShowLines); tableColumnLookupDefSchema = new TableColumn<ICFBamNmTokenDefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamNmTokenDefObj, ICFBamSchemaDefObj> p) { ICFBamNmTokenDefObj 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<ICFBamNmTokenDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamNmTokenDefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamNmTokenDefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamNmTokenDefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamNmTokenDefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamNmTokenDefObj>() { @Override public void changed(ObservableValue<? extends ICFBamNmTokenDefObj> observable, ICFBamNmTokenDefObj oldValue, ICFBamNmTokenDefObj 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 (observableListOfNmTokenDef != null) { dataTable.setItems(observableListOfNmTokenDef); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXInt32DefListPane.java
public CFBamJavaFXInt32DefListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argContainer, ICFBamInt32DefObj argFocus, Collection<ICFBamInt32DefObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();// w w w .ja v a2s.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<ICFBamInt32DefObj>(); tableColumnObjKind = new TableColumn<ICFBamInt32DefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32DefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamInt32DefObj, String> p) { ICFBamInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamInt32DefObj, String>, TableCell<ICFBamInt32DefObj, String>>() { @Override public TableCell<ICFBamInt32DefObj, String> call(TableColumn<ICFBamInt32DefObj, String> arg) { return new CFStringTableCell<ICFBamInt32DefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamInt32DefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32DefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamInt32DefObj, 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<ICFBamInt32DefObj, Long>, TableCell<ICFBamInt32DefObj, Long>>() { @Override public TableCell<ICFBamInt32DefObj, Long> call(TableColumn<ICFBamInt32DefObj, Long> arg) { return new CFInt64TableCell<ICFBamInt32DefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamInt32DefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt32DefObj, 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<ICFBamInt32DefObj, String>, TableCell<ICFBamInt32DefObj, String>>() { @Override public TableCell<ICFBamInt32DefObj, String> call(TableColumn<ICFBamInt32DefObj, String> arg) { return new CFStringTableCell<ICFBamInt32DefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamInt32DefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt32DefObj, 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<ICFBamInt32DefObj, String>, TableCell<ICFBamInt32DefObj, String>>() { @Override public TableCell<ICFBamInt32DefObj, String> call(TableColumn<ICFBamInt32DefObj, String> arg) { return new CFStringTableCell<ICFBamInt32DefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamInt32DefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt32DefObj, 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<ICFBamInt32DefObj, String>, TableCell<ICFBamInt32DefObj, String>>() { @Override public TableCell<ICFBamInt32DefObj, String> call(TableColumn<ICFBamInt32DefObj, String> arg) { return new CFStringTableCell<ICFBamInt32DefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamInt32DefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt32DefObj, 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<ICFBamInt32DefObj, String>, TableCell<ICFBamInt32DefObj, String>>() { @Override public TableCell<ICFBamInt32DefObj, String> call(TableColumn<ICFBamInt32DefObj, String> arg) { return new CFStringTableCell<ICFBamInt32DefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamInt32DefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt32DefObj, 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<ICFBamInt32DefObj, String>, TableCell<ICFBamInt32DefObj, String>>() { @Override public TableCell<ICFBamInt32DefObj, String> call(TableColumn<ICFBamInt32DefObj, String> arg) { return new CFStringTableCell<ICFBamInt32DefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamInt32DefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32DefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt32DefObj, 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<ICFBamInt32DefObj, Boolean>, TableCell<ICFBamInt32DefObj, Boolean>>() { @Override public TableCell<ICFBamInt32DefObj, Boolean> call(TableColumn<ICFBamInt32DefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt32DefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamInt32DefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32DefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt32DefObj, 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<ICFBamInt32DefObj, Boolean>, TableCell<ICFBamInt32DefObj, Boolean>>() { @Override public TableCell<ICFBamInt32DefObj, Boolean> call(TableColumn<ICFBamInt32DefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt32DefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamInt32DefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32DefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt32DefObj, 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<ICFBamInt32DefObj, Boolean>, TableCell<ICFBamInt32DefObj, Boolean>>() { @Override public TableCell<ICFBamInt32DefObj, Boolean> call(TableColumn<ICFBamInt32DefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt32DefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamInt32DefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt32DefObj, 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<ICFBamInt32DefObj, String>, TableCell<ICFBamInt32DefObj, String>>() { @Override public TableCell<ICFBamInt32DefObj, String> call(TableColumn<ICFBamInt32DefObj, String> arg) { return new CFStringTableCell<ICFBamInt32DefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamInt32DefObj, Integer>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32DefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32DefObj, Integer> p) { ICFBamInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamInt32DefObj, Integer>, TableCell<ICFBamInt32DefObj, Integer>>() { @Override public TableCell<ICFBamInt32DefObj, Integer> call(TableColumn<ICFBamInt32DefObj, Integer> arg) { return new CFInt32TableCell<ICFBamInt32DefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamInt32DefObj, Integer>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32DefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32DefObj, Integer> p) { ICFBamInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamInt32DefObj, Integer>, TableCell<ICFBamInt32DefObj, Integer>>() { @Override public TableCell<ICFBamInt32DefObj, Integer> call(TableColumn<ICFBamInt32DefObj, Integer> arg) { return new CFInt32TableCell<ICFBamInt32DefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamInt32DefObj, Integer>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32DefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32DefObj, Integer> p) { ICFBamInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamInt32DefObj, Integer>, TableCell<ICFBamInt32DefObj, Integer>>() { @Override public TableCell<ICFBamInt32DefObj, Integer> call(TableColumn<ICFBamInt32DefObj, Integer> arg) { return new CFInt32TableCell<ICFBamInt32DefObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamInt32DefObj, Integer>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32DefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32DefObj, Integer> p) { ICFBamInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamInt32DefObj, Integer>, TableCell<ICFBamInt32DefObj, Integer>>() { @Override public TableCell<ICFBamInt32DefObj, Integer> call(TableColumn<ICFBamInt32DefObj, Integer> arg) { return new CFInt32TableCell<ICFBamInt32DefObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamInt32DefObj, Integer>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32DefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32DefObj, Integer> p) { ICFBamInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamInt32DefObj, Integer>, TableCell<ICFBamInt32DefObj, Integer>>() { @Override public TableCell<ICFBamInt32DefObj, Integer> call(TableColumn<ICFBamInt32DefObj, Integer> arg) { return new CFInt32TableCell<ICFBamInt32DefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamInt32DefObj, Integer>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32DefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32DefObj, Integer> p) { ICFBamInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamInt32DefObj, Integer>, TableCell<ICFBamInt32DefObj, Integer>>() { @Override public TableCell<ICFBamInt32DefObj, Integer> call(TableColumn<ICFBamInt32DefObj, Integer> arg) { return new CFInt32TableCell<ICFBamInt32DefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamInt32DefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32DefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamInt32DefObj, ICFBamSchemaDefObj> p) { ICFBamInt32DefObj 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<ICFBamInt32DefObj, ICFBamSchemaDefObj>, TableCell<ICFBamInt32DefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamInt32DefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamInt32DefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamInt32DefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamInt32DefObj>() { @Override public void changed(ObservableValue<? extends ICFBamInt32DefObj> observable, ICFBamInt32DefObj oldValue, ICFBamInt32DefObj 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 (observableListOfInt32Def != null) { dataTable.setItems(observableListOfInt32Def); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXNmTokensDefListPane.java
public CFBamJavaFXNmTokensDefListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argContainer, ICFBamNmTokensDefObj argFocus, Collection<ICFBamNmTokensDefObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();//from w w w . ja v 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<ICFBamNmTokensDefObj>(); tableColumnObjKind = new TableColumn<ICFBamNmTokensDefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamNmTokensDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamNmTokensDefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, Long>, TableCell<ICFBamNmTokensDefObj, Long>>() { @Override public TableCell<ICFBamNmTokensDefObj, Long> call(TableColumn<ICFBamNmTokensDefObj, Long> arg) { return new CFInt64TableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamNmTokensDefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamNmTokensDefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamNmTokensDefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamNmTokensDefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamNmTokensDefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamNmTokensDefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, Boolean>, TableCell<ICFBamNmTokensDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokensDefObj, Boolean> call( TableColumn<ICFBamNmTokensDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamNmTokensDefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, Boolean>, TableCell<ICFBamNmTokensDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokensDefObj, Boolean> call( TableColumn<ICFBamNmTokensDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamNmTokensDefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, Boolean>, TableCell<ICFBamNmTokensDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokensDefObj, Boolean> call( TableColumn<ICFBamNmTokensDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamNmTokensDefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnMaxLen = new TableColumn<ICFBamNmTokensDefObj, Integer>("Max. Length"); tableColumnMaxLen.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamNmTokensDefObj, Integer> p) { ICFBamNmTokensDefObj 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<ICFBamNmTokensDefObj, Integer>, TableCell<ICFBamNmTokensDefObj, Integer>>() { @Override public TableCell<ICFBamNmTokensDefObj, Integer> call( TableColumn<ICFBamNmTokensDefObj, Integer> arg) { return new CFInt32TableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnMaxLen); tableColumnInitValue = new TableColumn<ICFBamNmTokensDefObj, String>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamNmTokensDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamNmTokensDefObj, String>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamNmTokensDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamNmTokensDefObj, String>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamNmTokensDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamNmTokensDefObj, String>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamNmTokensDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnShowLines = new TableColumn<ICFBamNmTokensDefObj, Short>("Show Lines"); tableColumnShowLines.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamNmTokensDefObj, Short> p) { ICFBamNmTokensDefObj obj = p.getValue(); if (obj == null) { return (null); } else { short value = obj.getRequiredShowLines(); Short wrapped = new Short(value); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(wrapped); return (observable); } } }); tableColumnShowLines.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, Short>, TableCell<ICFBamNmTokensDefObj, Short>>() { @Override public TableCell<ICFBamNmTokensDefObj, Short> call( TableColumn<ICFBamNmTokensDefObj, Short> arg) { return new CFInt16TableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnShowLines); tableColumnLookupDefSchema = new TableColumn<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamNmTokensDefObj, ICFBamSchemaDefObj> p) { ICFBamNmTokensDefObj 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<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamNmTokensDefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamNmTokensDefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty() .addListener(new ChangeListener<ICFBamNmTokensDefObj>() { @Override public void changed(ObservableValue<? extends ICFBamNmTokensDefObj> observable, ICFBamNmTokensDefObj oldValue, ICFBamNmTokensDefObj 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 (observableListOfNmTokensDef != null) { dataTable.setItems(observableListOfNmTokensDef); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTimestampDefListPane.java
public CFBamJavaFXTimestampDefListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argContainer, ICFBamTimestampDefObj argFocus, Collection<ICFBamTimestampDefObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/*w w w. j a v 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<ICFBamTimestampDefObj>(); tableColumnObjKind = new TableColumn<ICFBamTimestampDefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, String> p) { ICFBamTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() { @Override public TableCell<ICFBamTimestampDefObj, String> call( TableColumn<ICFBamTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamTimestampDefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, Long>, TableCell<ICFBamTimestampDefObj, Long>>() { @Override public TableCell<ICFBamTimestampDefObj, Long> call( TableColumn<ICFBamTimestampDefObj, Long> arg) { return new CFInt64TableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamTimestampDefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() { @Override public TableCell<ICFBamTimestampDefObj, String> call( TableColumn<ICFBamTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamTimestampDefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() { @Override public TableCell<ICFBamTimestampDefObj, String> call( TableColumn<ICFBamTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamTimestampDefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() { @Override public TableCell<ICFBamTimestampDefObj, String> call( TableColumn<ICFBamTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamTimestampDefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() { @Override public TableCell<ICFBamTimestampDefObj, String> call( TableColumn<ICFBamTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamTimestampDefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() { @Override public TableCell<ICFBamTimestampDefObj, String> call( TableColumn<ICFBamTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamTimestampDefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, Boolean>, TableCell<ICFBamTimestampDefObj, Boolean>>() { @Override public TableCell<ICFBamTimestampDefObj, Boolean> call( TableColumn<ICFBamTimestampDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamTimestampDefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, Boolean>, TableCell<ICFBamTimestampDefObj, Boolean>>() { @Override public TableCell<ICFBamTimestampDefObj, Boolean> call( TableColumn<ICFBamTimestampDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamTimestampDefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, Boolean>, TableCell<ICFBamTimestampDefObj, Boolean>>() { @Override public TableCell<ICFBamTimestampDefObj, Boolean> call( TableColumn<ICFBamTimestampDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamTimestampDefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() { @Override public TableCell<ICFBamTimestampDefObj, String> call( TableColumn<ICFBamTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, Calendar> p) { ICFBamTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTimestampDefObj, Calendar> call( TableColumn<ICFBamTimestampDefObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, Calendar> p) { ICFBamTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTimestampDefObj, Calendar> call( TableColumn<ICFBamTimestampDefObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, Calendar> p) { ICFBamTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTimestampDefObj, Calendar> call( TableColumn<ICFBamTimestampDefObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, Calendar> p) { ICFBamTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTimestampDefObj, Calendar> call( TableColumn<ICFBamTimestampDefObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, Calendar> p) { ICFBamTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTimestampDefObj, Calendar> call( TableColumn<ICFBamTimestampDefObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, Calendar> p) { ICFBamTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTimestampDefObj, Calendar> call( TableColumn<ICFBamTimestampDefObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamTimestampDefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamTimestampDefObj, ICFBamSchemaDefObj> p) { ICFBamTimestampDefObj 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<ICFBamTimestampDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamTimestampDefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamTimestampDefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamTimestampDefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamTimestampDefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty() .addListener(new ChangeListener<ICFBamTimestampDefObj>() { @Override public void changed(ObservableValue<? extends ICFBamTimestampDefObj> observable, ICFBamTimestampDefObj oldValue, ICFBamTimestampDefObj 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 (observableListOfTimestampDef != null) { dataTable.setItems(observableListOfTimestampDef); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXInt16DefListPane.java
public CFBamJavaFXInt16DefListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argContainer, ICFBamInt16DefObj argFocus, Collection<ICFBamInt16DefObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();//from w w w . j av a 2s . 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<ICFBamInt16DefObj>(); tableColumnObjKind = new TableColumn<ICFBamInt16DefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16DefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamInt16DefObj, String> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamInt16DefObj, String>, TableCell<ICFBamInt16DefObj, String>>() { @Override public TableCell<ICFBamInt16DefObj, String> call(TableColumn<ICFBamInt16DefObj, String> arg) { return new CFStringTableCell<ICFBamInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamInt16DefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16DefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamInt16DefObj, 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<ICFBamInt16DefObj, Long>, TableCell<ICFBamInt16DefObj, Long>>() { @Override public TableCell<ICFBamInt16DefObj, Long> call(TableColumn<ICFBamInt16DefObj, Long> arg) { return new CFInt64TableCell<ICFBamInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamInt16DefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt16DefObj, 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<ICFBamInt16DefObj, String>, TableCell<ICFBamInt16DefObj, String>>() { @Override public TableCell<ICFBamInt16DefObj, String> call(TableColumn<ICFBamInt16DefObj, String> arg) { return new CFStringTableCell<ICFBamInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamInt16DefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt16DefObj, 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<ICFBamInt16DefObj, String>, TableCell<ICFBamInt16DefObj, String>>() { @Override public TableCell<ICFBamInt16DefObj, String> call(TableColumn<ICFBamInt16DefObj, String> arg) { return new CFStringTableCell<ICFBamInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamInt16DefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt16DefObj, 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<ICFBamInt16DefObj, String>, TableCell<ICFBamInt16DefObj, String>>() { @Override public TableCell<ICFBamInt16DefObj, String> call(TableColumn<ICFBamInt16DefObj, String> arg) { return new CFStringTableCell<ICFBamInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamInt16DefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt16DefObj, 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<ICFBamInt16DefObj, String>, TableCell<ICFBamInt16DefObj, String>>() { @Override public TableCell<ICFBamInt16DefObj, String> call(TableColumn<ICFBamInt16DefObj, String> arg) { return new CFStringTableCell<ICFBamInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamInt16DefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt16DefObj, 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<ICFBamInt16DefObj, String>, TableCell<ICFBamInt16DefObj, String>>() { @Override public TableCell<ICFBamInt16DefObj, String> call(TableColumn<ICFBamInt16DefObj, String> arg) { return new CFStringTableCell<ICFBamInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamInt16DefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16DefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt16DefObj, 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<ICFBamInt16DefObj, Boolean>, TableCell<ICFBamInt16DefObj, Boolean>>() { @Override public TableCell<ICFBamInt16DefObj, Boolean> call(TableColumn<ICFBamInt16DefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamInt16DefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16DefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt16DefObj, 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<ICFBamInt16DefObj, Boolean>, TableCell<ICFBamInt16DefObj, Boolean>>() { @Override public TableCell<ICFBamInt16DefObj, Boolean> call(TableColumn<ICFBamInt16DefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamInt16DefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16DefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt16DefObj, 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<ICFBamInt16DefObj, Boolean>, TableCell<ICFBamInt16DefObj, Boolean>>() { @Override public TableCell<ICFBamInt16DefObj, Boolean> call(TableColumn<ICFBamInt16DefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamInt16DefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt16DefObj, 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<ICFBamInt16DefObj, String>, TableCell<ICFBamInt16DefObj, String>>() { @Override public TableCell<ICFBamInt16DefObj, String> call(TableColumn<ICFBamInt16DefObj, String> arg) { return new CFStringTableCell<ICFBamInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamInt16DefObj, Short>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16DefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16DefObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamInt16DefObj, Short>, TableCell<ICFBamInt16DefObj, Short>>() { @Override public TableCell<ICFBamInt16DefObj, Short> call(TableColumn<ICFBamInt16DefObj, Short> arg) { return new CFInt16TableCell<ICFBamInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamInt16DefObj, Short>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16DefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16DefObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamInt16DefObj, Short>, TableCell<ICFBamInt16DefObj, Short>>() { @Override public TableCell<ICFBamInt16DefObj, Short> call(TableColumn<ICFBamInt16DefObj, Short> arg) { return new CFInt16TableCell<ICFBamInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamInt16DefObj, Short>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16DefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16DefObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamInt16DefObj, Short>, TableCell<ICFBamInt16DefObj, Short>>() { @Override public TableCell<ICFBamInt16DefObj, Short> call(TableColumn<ICFBamInt16DefObj, Short> arg) { return new CFInt16TableCell<ICFBamInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamInt16DefObj, Short>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16DefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16DefObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamInt16DefObj, Short>, TableCell<ICFBamInt16DefObj, Short>>() { @Override public TableCell<ICFBamInt16DefObj, Short> call(TableColumn<ICFBamInt16DefObj, Short> arg) { return new CFInt16TableCell<ICFBamInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamInt16DefObj, Short>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16DefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16DefObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamInt16DefObj, Short>, TableCell<ICFBamInt16DefObj, Short>>() { @Override public TableCell<ICFBamInt16DefObj, Short> call(TableColumn<ICFBamInt16DefObj, Short> arg) { return new CFInt16TableCell<ICFBamInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamInt16DefObj, Short>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16DefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16DefObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamInt16DefObj, Short>, TableCell<ICFBamInt16DefObj, Short>>() { @Override public TableCell<ICFBamInt16DefObj, Short> call(TableColumn<ICFBamInt16DefObj, Short> arg) { return new CFInt16TableCell<ICFBamInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamInt16DefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16DefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamInt16DefObj, ICFBamSchemaDefObj> p) { ICFBamInt16DefObj 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<ICFBamInt16DefObj, ICFBamSchemaDefObj>, TableCell<ICFBamInt16DefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamInt16DefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamInt16DefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamInt16DefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamInt16DefObj>() { @Override public void changed(ObservableValue<? extends ICFBamInt16DefObj> observable, ICFBamInt16DefObj oldValue, ICFBamInt16DefObj 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 (observableListOfInt16Def != null) { dataTable.setItems(observableListOfInt16Def); } adjustListButtons(); }