Example usage for javafx.beans.property ReadOnlyObjectWrapper ReadOnlyObjectWrapper

List of usage examples for javafx.beans.property ReadOnlyObjectWrapper ReadOnlyObjectWrapper

Introduction

In this page you can find the example usage for javafx.beans.property ReadOnlyObjectWrapper ReadOnlyObjectWrapper.

Prototype

public ReadOnlyObjectWrapper() 

Source Link

Document

The constructor of ReadOnlyObjectWrapper

Usage

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

public CFBamJavaFXScopePickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamScopeObj argFocus, ICFLibAnyObj argContainer, Collection<ICFBamScopeObj> argDataCollection,
        ICFBamJavaFXScopeChosen whenChosen) {
    super();/*  w w  w  .  ja  va  2s. 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");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamScopeObj>();
    tableColumnObjKind = new TableColumn<ICFBamScopeObj, String>("Class Code");
    tableColumnObjKind.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamScopeObj, String>, ObservableValue<String>>() {
                @Override
                public ObservableValue<String> call(CellDataFeatures<ICFBamScopeObj, String> p) {
                    ICFBamScopeObj 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<ICFBamScopeObj, String>, TableCell<ICFBamScopeObj, String>>() {
                @Override
                public TableCell<ICFBamScopeObj, String> call(TableColumn<ICFBamScopeObj, String> arg) {
                    return new CFStringTableCell<ICFBamScopeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnObjKind);
    tableColumnId = new TableColumn<ICFBamScopeObj, Long>("Id");
    tableColumnId
            .setCellValueFactory(new Callback<CellDataFeatures<ICFBamScopeObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamScopeObj, Long> p) {
                    ICFBamScopeObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        long value = obj.getRequiredId();
                        Long wrapped = new Long(value);
                        ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnId
            .setCellFactory(new Callback<TableColumn<ICFBamScopeObj, Long>, TableCell<ICFBamScopeObj, Long>>() {
                @Override
                public TableCell<ICFBamScopeObj, Long> call(TableColumn<ICFBamScopeObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamScopeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamScopeObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamScopeObj> observable, ICFBamScopeObj oldValue,
                ICFBamScopeObj newValue) {
            setJavaFXFocus(newValue);
            if (buttonChooseSelected != null) {
                if (newValue != null) {
                    buttonChooseSelected.setDisable(false);
                } else {
                    buttonChooseSelected.setDisable(true);
                }
            }
        }
    });
    hboxMenu = new CFHBox(10);
    buttonCancel = new CFButton();
    buttonCancel.setMinWidth(200);
    buttonCancel.setText("Cancel");
    buttonCancel.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonCancel);
    buttonChooseNone = new CFButton();
    buttonChooseNone.setMinWidth(200);
    buttonChooseNone.setText("ChooseNone");
    buttonChooseNone.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                invokeWhenChosen.choseScope(null);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseNone);
    buttonChooseSelected = new CFButton();
    buttonChooseSelected.setMinWidth(200);
    buttonChooseSelected.setText("ChooseSelected");
    buttonChooseSelected.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                ICFBamScopeObj selectedInstance = getJavaFXFocusAsScope();
                invokeWhenChosen.choseScope(selectedInstance);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseSelected);
    if (argFocus != null) {
        dataTable.getSelectionModel().select(argFocus);
    }
    setTop(hboxMenu);
    setCenter(dataTable);
}

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

public CFBamJavaFXDelDepPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamDelDepObj argFocus, ICFLibAnyObj argContainer, Collection<ICFBamDelDepObj> argDataCollection,
        ICFBamJavaFXDelDepChosen whenChosen) {
    super();/*  ww w.  ja 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");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamDelDepObj>();
    tableColumnObjKind = new TableColumn<ICFBamDelDepObj, String>("Class Code");
    tableColumnObjKind.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDelDepObj, String>, ObservableValue<String>>() {
                @Override
                public ObservableValue<String> call(CellDataFeatures<ICFBamDelDepObj, String> p) {
                    ICFBamDelDepObj 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<ICFBamDelDepObj, String>, TableCell<ICFBamDelDepObj, String>>() {
                @Override
                public TableCell<ICFBamDelDepObj, String> call(TableColumn<ICFBamDelDepObj, String> arg) {
                    return new CFStringTableCell<ICFBamDelDepObj>();
                }
            });
    dataTable.getColumns().add(tableColumnObjKind);
    tableColumnId = new TableColumn<ICFBamDelDepObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDelDepObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamDelDepObj, Long> p) {
                    ICFBamScopeObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        long value = obj.getRequiredId();
                        Long wrapped = new Long(value);
                        ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnId.setCellFactory(
            new Callback<TableColumn<ICFBamDelDepObj, Long>, TableCell<ICFBamDelDepObj, Long>>() {
                @Override
                public TableCell<ICFBamDelDepObj, Long> call(TableColumn<ICFBamDelDepObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamDelDepObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnLookupRelation = new TableColumn<ICFBamDelDepObj, ICFBamRelationObj>("Relation");
    tableColumnLookupRelation.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDelDepObj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() {
                public ObservableValue<ICFBamRelationObj> call(
                        CellDataFeatures<ICFBamDelDepObj, ICFBamRelationObj> p) {
                    ICFBamDelDepObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamRelationObj ref = obj.getRequiredLookupRelation();
                        ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupRelation.setCellFactory(
            new Callback<TableColumn<ICFBamDelDepObj, ICFBamRelationObj>, TableCell<ICFBamDelDepObj, ICFBamRelationObj>>() {
                @Override
                public TableCell<ICFBamDelDepObj, ICFBamRelationObj> call(
                        TableColumn<ICFBamDelDepObj, ICFBamRelationObj> arg) {
                    return new CFReferenceTableCell<ICFBamDelDepObj, ICFBamRelationObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupRelation);
    tableColumnLookupDefSchema = new TableColumn<ICFBamDelDepObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDelDepObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamDelDepObj, ICFBamSchemaDefObj> p) {
                    ICFBamDelDepObj 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<ICFBamDelDepObj, ICFBamSchemaDefObj>, TableCell<ICFBamDelDepObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamDelDepObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamDelDepObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamDelDepObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamDelDepObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamDelDepObj> observable, ICFBamDelDepObj oldValue,
                ICFBamDelDepObj newValue) {
            setJavaFXFocus(newValue);
            if (buttonChooseSelected != null) {
                if (newValue != null) {
                    buttonChooseSelected.setDisable(false);
                } else {
                    buttonChooseSelected.setDisable(true);
                }
            }
        }
    });
    hboxMenu = new CFHBox(10);
    buttonCancel = new CFButton();
    buttonCancel.setMinWidth(200);
    buttonCancel.setText("Cancel");
    buttonCancel.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonCancel);
    buttonChooseNone = new CFButton();
    buttonChooseNone.setMinWidth(200);
    buttonChooseNone.setText("ChooseNone");
    buttonChooseNone.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                invokeWhenChosen.choseDelDep(null);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseNone);
    buttonChooseSelected = new CFButton();
    buttonChooseSelected.setMinWidth(200);
    buttonChooseSelected.setText("ChooseSelected");
    buttonChooseSelected.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                ICFBamDelDepObj selectedInstance = getJavaFXFocusAsDelDep();
                invokeWhenChosen.choseDelDep(selectedInstance);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseSelected);
    if (argFocus != null) {
        dataTable.getSelectionModel().select(argFocus);
    }
    setTop(hboxMenu);
    setCenter(dataTable);
}

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

public CFBamJavaFXEnumTagPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamEnumTagObj argFocus, ICFBamEnumDefObj argContainer,
        Collection<ICFBamEnumTagObj> argDataCollection, ICFBamJavaFXEnumTagChosen whenChosen) {
    super();//from  w  w w.java 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");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamEnumTagObj>();
    tableColumnId = new TableColumn<ICFBamEnumTagObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamEnumTagObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamEnumTagObj, Long> p) {
                    ICFBamEnumTagObj 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<ICFBamEnumTagObj, Long>, TableCell<ICFBamEnumTagObj, Long>>() {
                @Override
                public TableCell<ICFBamEnumTagObj, Long> call(TableColumn<ICFBamEnumTagObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamEnumTagObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnEnumCode = new TableColumn<ICFBamEnumTagObj, Short>("EnumCode");
    tableColumnEnumCode.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamEnumTagObj, Short>, ObservableValue<Short>>() {
                public ObservableValue<Short> call(CellDataFeatures<ICFBamEnumTagObj, Short> p) {
                    ICFBamEnumTagObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Short value = obj.getOptionalEnumCode();
                        ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnEnumCode.setCellFactory(
            new Callback<TableColumn<ICFBamEnumTagObj, Short>, TableCell<ICFBamEnumTagObj, Short>>() {
                @Override
                public TableCell<ICFBamEnumTagObj, Short> call(TableColumn<ICFBamEnumTagObj, Short> arg) {
                    return new CFInt16TableCell<ICFBamEnumTagObj>();
                }
            });
    dataTable.getColumns().add(tableColumnEnumCode);
    tableColumnName = new TableColumn<ICFBamEnumTagObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamEnumTagObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamEnumTagObj, String> p) {
                    ICFBamEnumTagObj 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<ICFBamEnumTagObj, String>, TableCell<ICFBamEnumTagObj, String>>() {
                @Override
                public TableCell<ICFBamEnumTagObj, String> call(TableColumn<ICFBamEnumTagObj, String> arg) {
                    return new CFStringTableCell<ICFBamEnumTagObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnLookupDefSchema = new TableColumn<ICFBamEnumTagObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamEnumTagObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamEnumTagObj, ICFBamSchemaDefObj> p) {
                    ICFBamEnumTagObj 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<ICFBamEnumTagObj, ICFBamSchemaDefObj>, TableCell<ICFBamEnumTagObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamEnumTagObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamEnumTagObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamEnumTagObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamEnumTagObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamEnumTagObj> observable, ICFBamEnumTagObj oldValue,
                ICFBamEnumTagObj newValue) {
            setJavaFXFocus(newValue);
            if (buttonChooseSelected != null) {
                if (newValue != null) {
                    buttonChooseSelected.setDisable(false);
                } else {
                    buttonChooseSelected.setDisable(true);
                }
            }
        }
    });
    hboxMenu = new CFHBox(10);
    buttonCancel = new CFButton();
    buttonCancel.setMinWidth(200);
    buttonCancel.setText("Cancel");
    buttonCancel.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonCancel);
    buttonChooseNone = new CFButton();
    buttonChooseNone.setMinWidth(200);
    buttonChooseNone.setText("ChooseNone");
    buttonChooseNone.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                invokeWhenChosen.choseEnumTag(null);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseNone);
    buttonChooseSelected = new CFButton();
    buttonChooseSelected.setMinWidth(200);
    buttonChooseSelected.setText("ChooseSelected");
    buttonChooseSelected.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                ICFBamEnumTagObj selectedInstance = getJavaFXFocusAsEnumTag();
                invokeWhenChosen.choseEnumTag(selectedInstance);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseSelected);
    if (argFocus != null) {
        dataTable.getSelectionModel().select(argFocus);
    }
    setTop(hboxMenu);
    setCenter(dataTable);
}

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

public CFBamJavaFXPopDepPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamPopDepObj argFocus, ICFLibAnyObj argContainer, Collection<ICFBamPopDepObj> argDataCollection,
        ICFBamJavaFXPopDepChosen whenChosen) {
    super();/* w  w w . j av 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");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamPopDepObj>();
    tableColumnObjKind = new TableColumn<ICFBamPopDepObj, String>("Class Code");
    tableColumnObjKind.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamPopDepObj, String>, ObservableValue<String>>() {
                @Override
                public ObservableValue<String> call(CellDataFeatures<ICFBamPopDepObj, String> p) {
                    ICFBamPopDepObj 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<ICFBamPopDepObj, String>, TableCell<ICFBamPopDepObj, String>>() {
                @Override
                public TableCell<ICFBamPopDepObj, String> call(TableColumn<ICFBamPopDepObj, String> arg) {
                    return new CFStringTableCell<ICFBamPopDepObj>();
                }
            });
    dataTable.getColumns().add(tableColumnObjKind);
    tableColumnId = new TableColumn<ICFBamPopDepObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamPopDepObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamPopDepObj, Long> p) {
                    ICFBamScopeObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        long value = obj.getRequiredId();
                        Long wrapped = new Long(value);
                        ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnId.setCellFactory(
            new Callback<TableColumn<ICFBamPopDepObj, Long>, TableCell<ICFBamPopDepObj, Long>>() {
                @Override
                public TableCell<ICFBamPopDepObj, Long> call(TableColumn<ICFBamPopDepObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamPopDepObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnLookupRelation = new TableColumn<ICFBamPopDepObj, ICFBamRelationObj>("Relation");
    tableColumnLookupRelation.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamPopDepObj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() {
                public ObservableValue<ICFBamRelationObj> call(
                        CellDataFeatures<ICFBamPopDepObj, ICFBamRelationObj> p) {
                    ICFBamPopDepObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamRelationObj ref = obj.getRequiredLookupRelation();
                        ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupRelation.setCellFactory(
            new Callback<TableColumn<ICFBamPopDepObj, ICFBamRelationObj>, TableCell<ICFBamPopDepObj, ICFBamRelationObj>>() {
                @Override
                public TableCell<ICFBamPopDepObj, ICFBamRelationObj> call(
                        TableColumn<ICFBamPopDepObj, ICFBamRelationObj> arg) {
                    return new CFReferenceTableCell<ICFBamPopDepObj, ICFBamRelationObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupRelation);
    tableColumnLookupDefSchema = new TableColumn<ICFBamPopDepObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamPopDepObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamPopDepObj, ICFBamSchemaDefObj> p) {
                    ICFBamPopDepObj 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<ICFBamPopDepObj, ICFBamSchemaDefObj>, TableCell<ICFBamPopDepObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamPopDepObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamPopDepObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamPopDepObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamPopDepObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamPopDepObj> observable, ICFBamPopDepObj oldValue,
                ICFBamPopDepObj newValue) {
            setJavaFXFocus(newValue);
            if (buttonChooseSelected != null) {
                if (newValue != null) {
                    buttonChooseSelected.setDisable(false);
                } else {
                    buttonChooseSelected.setDisable(true);
                }
            }
        }
    });
    hboxMenu = new CFHBox(10);
    buttonCancel = new CFButton();
    buttonCancel.setMinWidth(200);
    buttonCancel.setText("Cancel");
    buttonCancel.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonCancel);
    buttonChooseNone = new CFButton();
    buttonChooseNone.setMinWidth(200);
    buttonChooseNone.setText("ChooseNone");
    buttonChooseNone.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                invokeWhenChosen.chosePopDep(null);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseNone);
    buttonChooseSelected = new CFButton();
    buttonChooseSelected.setMinWidth(200);
    buttonChooseSelected.setText("ChooseSelected");
    buttonChooseSelected.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                ICFBamPopDepObj selectedInstance = getJavaFXFocusAsPopDep();
                invokeWhenChosen.chosePopDep(selectedInstance);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseSelected);
    if (argFocus != null) {
        dataTable.getSelectionModel().select(argFocus);
    }
    setTop(hboxMenu);
    setCenter(dataTable);
}

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

public CFBamJavaFXClearDepPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamClearDepObj argFocus, ICFLibAnyObj argContainer, Collection<ICFBamClearDepObj> argDataCollection,
        ICFBamJavaFXClearDepChosen whenChosen) {
    super();//  w w  w .java2 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");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamClearDepObj>();
    tableColumnObjKind = new TableColumn<ICFBamClearDepObj, String>("Class Code");
    tableColumnObjKind.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamClearDepObj, String>, ObservableValue<String>>() {
                @Override
                public ObservableValue<String> call(CellDataFeatures<ICFBamClearDepObj, String> p) {
                    ICFBamClearDepObj 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<ICFBamClearDepObj, String>, TableCell<ICFBamClearDepObj, String>>() {
                @Override
                public TableCell<ICFBamClearDepObj, String> call(TableColumn<ICFBamClearDepObj, String> arg) {
                    return new CFStringTableCell<ICFBamClearDepObj>();
                }
            });
    dataTable.getColumns().add(tableColumnObjKind);
    tableColumnId = new TableColumn<ICFBamClearDepObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamClearDepObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamClearDepObj, Long> p) {
                    ICFBamScopeObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        long value = obj.getRequiredId();
                        Long wrapped = new Long(value);
                        ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnId.setCellFactory(
            new Callback<TableColumn<ICFBamClearDepObj, Long>, TableCell<ICFBamClearDepObj, Long>>() {
                @Override
                public TableCell<ICFBamClearDepObj, Long> call(TableColumn<ICFBamClearDepObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamClearDepObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnLookupRelation = new TableColumn<ICFBamClearDepObj, ICFBamRelationObj>("Relation");
    tableColumnLookupRelation.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamClearDepObj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() {
                public ObservableValue<ICFBamRelationObj> call(
                        CellDataFeatures<ICFBamClearDepObj, ICFBamRelationObj> p) {
                    ICFBamClearDepObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamRelationObj ref = obj.getRequiredLookupRelation();
                        ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupRelation.setCellFactory(
            new Callback<TableColumn<ICFBamClearDepObj, ICFBamRelationObj>, TableCell<ICFBamClearDepObj, ICFBamRelationObj>>() {
                @Override
                public TableCell<ICFBamClearDepObj, ICFBamRelationObj> call(
                        TableColumn<ICFBamClearDepObj, ICFBamRelationObj> arg) {
                    return new CFReferenceTableCell<ICFBamClearDepObj, ICFBamRelationObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupRelation);
    tableColumnLookupDefSchema = new TableColumn<ICFBamClearDepObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamClearDepObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamClearDepObj, ICFBamSchemaDefObj> p) {
                    ICFBamClearDepObj 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<ICFBamClearDepObj, ICFBamSchemaDefObj>, TableCell<ICFBamClearDepObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamClearDepObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamClearDepObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamClearDepObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamClearDepObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamClearDepObj> observable, ICFBamClearDepObj oldValue,
                ICFBamClearDepObj newValue) {
            setJavaFXFocus(newValue);
            if (buttonChooseSelected != null) {
                if (newValue != null) {
                    buttonChooseSelected.setDisable(false);
                } else {
                    buttonChooseSelected.setDisable(true);
                }
            }
        }
    });
    hboxMenu = new CFHBox(10);
    buttonCancel = new CFButton();
    buttonCancel.setMinWidth(200);
    buttonCancel.setText("Cancel");
    buttonCancel.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonCancel);
    buttonChooseNone = new CFButton();
    buttonChooseNone.setMinWidth(200);
    buttonChooseNone.setText("ChooseNone");
    buttonChooseNone.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                invokeWhenChosen.choseClearDep(null);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseNone);
    buttonChooseSelected = new CFButton();
    buttonChooseSelected.setMinWidth(200);
    buttonChooseSelected.setText("ChooseSelected");
    buttonChooseSelected.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                ICFBamClearDepObj selectedInstance = getJavaFXFocusAsClearDep();
                invokeWhenChosen.choseClearDep(selectedInstance);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseSelected);
    if (argFocus != null) {
        dataTable.getSelectionModel().select(argFocus);
    }
    setTop(hboxMenu);
    setCenter(dataTable);
}

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

public CFBamJavaFXDelTopDepPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamDelTopDepObj argFocus, ICFBamTableObj argContainer,
        Collection<ICFBamDelTopDepObj> argDataCollection, ICFBamJavaFXDelTopDepChosen whenChosen) {
    super();//from  w w  w  .  java2 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");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamDelTopDepObj>();
    tableColumnId = new TableColumn<ICFBamDelTopDepObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDelTopDepObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamDelTopDepObj, Long> p) {
                    ICFBamScopeObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        long value = obj.getRequiredId();
                        Long wrapped = new Long(value);
                        ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnId.setCellFactory(
            new Callback<TableColumn<ICFBamDelTopDepObj, Long>, TableCell<ICFBamDelTopDepObj, Long>>() {
                @Override
                public TableCell<ICFBamDelTopDepObj, Long> call(TableColumn<ICFBamDelTopDepObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamDelTopDepObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamDelTopDepObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDelTopDepObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamDelTopDepObj, String> p) {
                    ICFBamDelTopDepObj 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<ICFBamDelTopDepObj, String>, TableCell<ICFBamDelTopDepObj, String>>() {
                @Override
                public TableCell<ICFBamDelTopDepObj, String> call(TableColumn<ICFBamDelTopDepObj, String> arg) {
                    return new CFStringTableCell<ICFBamDelTopDepObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnLookupRelation = new TableColumn<ICFBamDelTopDepObj, ICFBamRelationObj>("Relation");
    tableColumnLookupRelation.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDelTopDepObj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() {
                public ObservableValue<ICFBamRelationObj> call(
                        CellDataFeatures<ICFBamDelTopDepObj, ICFBamRelationObj> p) {
                    ICFBamDelTopDepObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamRelationObj ref = obj.getRequiredLookupRelation();
                        ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupRelation.setCellFactory(
            new Callback<TableColumn<ICFBamDelTopDepObj, ICFBamRelationObj>, TableCell<ICFBamDelTopDepObj, ICFBamRelationObj>>() {
                @Override
                public TableCell<ICFBamDelTopDepObj, ICFBamRelationObj> call(
                        TableColumn<ICFBamDelTopDepObj, ICFBamRelationObj> arg) {
                    return new CFReferenceTableCell<ICFBamDelTopDepObj, ICFBamRelationObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupRelation);
    tableColumnLookupDefSchema = new TableColumn<ICFBamDelTopDepObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDelTopDepObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamDelTopDepObj, ICFBamSchemaDefObj> p) {
                    ICFBamDelTopDepObj 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<ICFBamDelTopDepObj, ICFBamSchemaDefObj>, TableCell<ICFBamDelTopDepObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamDelTopDepObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamDelTopDepObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamDelTopDepObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamDelTopDepObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamDelTopDepObj> observable,
                ICFBamDelTopDepObj oldValue, ICFBamDelTopDepObj newValue) {
            setJavaFXFocus(newValue);
            if (buttonChooseSelected != null) {
                if (newValue != null) {
                    buttonChooseSelected.setDisable(false);
                } else {
                    buttonChooseSelected.setDisable(true);
                }
            }
        }
    });
    hboxMenu = new CFHBox(10);
    buttonCancel = new CFButton();
    buttonCancel.setMinWidth(200);
    buttonCancel.setText("Cancel");
    buttonCancel.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonCancel);
    buttonChooseNone = new CFButton();
    buttonChooseNone.setMinWidth(200);
    buttonChooseNone.setText("ChooseNone");
    buttonChooseNone.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                invokeWhenChosen.choseDelTopDep(null);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseNone);
    buttonChooseSelected = new CFButton();
    buttonChooseSelected.setMinWidth(200);
    buttonChooseSelected.setText("ChooseSelected");
    buttonChooseSelected.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                ICFBamDelTopDepObj selectedInstance = getJavaFXFocusAsDelTopDep();
                invokeWhenChosen.choseDelTopDep(selectedInstance);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseSelected);
    if (argFocus != null) {
        dataTable.getSelectionModel().select(argFocus);
    }
    setTop(hboxMenu);
    setCenter(dataTable);
}

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

public CFBamJavaFXPopTopDepPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamPopTopDepObj argFocus, ICFBamRelationObj argContainer,
        Collection<ICFBamPopTopDepObj> argDataCollection, ICFBamJavaFXPopTopDepChosen whenChosen) {
    super();//from ww  w  . j  a  va 2 s  .com
    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");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamPopTopDepObj>();
    tableColumnId = new TableColumn<ICFBamPopTopDepObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamPopTopDepObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamPopTopDepObj, Long> p) {
                    ICFBamScopeObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        long value = obj.getRequiredId();
                        Long wrapped = new Long(value);
                        ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnId.setCellFactory(
            new Callback<TableColumn<ICFBamPopTopDepObj, Long>, TableCell<ICFBamPopTopDepObj, Long>>() {
                @Override
                public TableCell<ICFBamPopTopDepObj, Long> call(TableColumn<ICFBamPopTopDepObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamPopTopDepObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamPopTopDepObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamPopTopDepObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamPopTopDepObj, String> p) {
                    ICFBamPopTopDepObj 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<ICFBamPopTopDepObj, String>, TableCell<ICFBamPopTopDepObj, String>>() {
                @Override
                public TableCell<ICFBamPopTopDepObj, String> call(TableColumn<ICFBamPopTopDepObj, String> arg) {
                    return new CFStringTableCell<ICFBamPopTopDepObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnLookupRelation = new TableColumn<ICFBamPopTopDepObj, ICFBamRelationObj>("Relation");
    tableColumnLookupRelation.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamPopTopDepObj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() {
                public ObservableValue<ICFBamRelationObj> call(
                        CellDataFeatures<ICFBamPopTopDepObj, ICFBamRelationObj> p) {
                    ICFBamPopTopDepObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamRelationObj ref = obj.getRequiredLookupRelation();
                        ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupRelation.setCellFactory(
            new Callback<TableColumn<ICFBamPopTopDepObj, ICFBamRelationObj>, TableCell<ICFBamPopTopDepObj, ICFBamRelationObj>>() {
                @Override
                public TableCell<ICFBamPopTopDepObj, ICFBamRelationObj> call(
                        TableColumn<ICFBamPopTopDepObj, ICFBamRelationObj> arg) {
                    return new CFReferenceTableCell<ICFBamPopTopDepObj, ICFBamRelationObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupRelation);
    tableColumnLookupDefSchema = new TableColumn<ICFBamPopTopDepObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamPopTopDepObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamPopTopDepObj, ICFBamSchemaDefObj> p) {
                    ICFBamPopTopDepObj 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<ICFBamPopTopDepObj, ICFBamSchemaDefObj>, TableCell<ICFBamPopTopDepObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamPopTopDepObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamPopTopDepObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamPopTopDepObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamPopTopDepObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamPopTopDepObj> observable,
                ICFBamPopTopDepObj oldValue, ICFBamPopTopDepObj newValue) {
            setJavaFXFocus(newValue);
            if (buttonChooseSelected != null) {
                if (newValue != null) {
                    buttonChooseSelected.setDisable(false);
                } else {
                    buttonChooseSelected.setDisable(true);
                }
            }
        }
    });
    hboxMenu = new CFHBox(10);
    buttonCancel = new CFButton();
    buttonCancel.setMinWidth(200);
    buttonCancel.setText("Cancel");
    buttonCancel.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonCancel);
    buttonChooseNone = new CFButton();
    buttonChooseNone.setMinWidth(200);
    buttonChooseNone.setText("ChooseNone");
    buttonChooseNone.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                invokeWhenChosen.chosePopTopDep(null);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseNone);
    buttonChooseSelected = new CFButton();
    buttonChooseSelected.setMinWidth(200);
    buttonChooseSelected.setText("ChooseSelected");
    buttonChooseSelected.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                ICFBamPopTopDepObj selectedInstance = getJavaFXFocusAsPopTopDep();
                invokeWhenChosen.chosePopTopDep(selectedInstance);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseSelected);
    if (argFocus != null) {
        dataTable.getSelectionModel().select(argFocus);
    }
    setTop(hboxMenu);
    setCenter(dataTable);
}

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

public CFBamJavaFXDelSubDep1PickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamDelSubDep1Obj argFocus, ICFBamDelTopDepObj argContainer,
        Collection<ICFBamDelSubDep1Obj> argDataCollection, ICFBamJavaFXDelSubDep1Chosen whenChosen) {
    super();/*from   w  ww .  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");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamDelSubDep1Obj>();
    tableColumnId = new TableColumn<ICFBamDelSubDep1Obj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDelSubDep1Obj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamDelSubDep1Obj, Long> p) {
                    ICFBamScopeObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        long value = obj.getRequiredId();
                        Long wrapped = new Long(value);
                        ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnId.setCellFactory(
            new Callback<TableColumn<ICFBamDelSubDep1Obj, Long>, TableCell<ICFBamDelSubDep1Obj, Long>>() {
                @Override
                public TableCell<ICFBamDelSubDep1Obj, Long> call(TableColumn<ICFBamDelSubDep1Obj, Long> arg) {
                    return new CFInt64TableCell<ICFBamDelSubDep1Obj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamDelSubDep1Obj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDelSubDep1Obj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamDelSubDep1Obj, String> p) {
                    ICFBamDelSubDep1Obj 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<ICFBamDelSubDep1Obj, String>, TableCell<ICFBamDelSubDep1Obj, String>>() {
                @Override
                public TableCell<ICFBamDelSubDep1Obj, String> call(
                        TableColumn<ICFBamDelSubDep1Obj, String> arg) {
                    return new CFStringTableCell<ICFBamDelSubDep1Obj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnLookupRelation = new TableColumn<ICFBamDelSubDep1Obj, ICFBamRelationObj>("Relation");
    tableColumnLookupRelation.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDelSubDep1Obj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() {
                public ObservableValue<ICFBamRelationObj> call(
                        CellDataFeatures<ICFBamDelSubDep1Obj, ICFBamRelationObj> p) {
                    ICFBamDelSubDep1Obj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamRelationObj ref = obj.getRequiredLookupRelation();
                        ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupRelation.setCellFactory(
            new Callback<TableColumn<ICFBamDelSubDep1Obj, ICFBamRelationObj>, TableCell<ICFBamDelSubDep1Obj, ICFBamRelationObj>>() {
                @Override
                public TableCell<ICFBamDelSubDep1Obj, ICFBamRelationObj> call(
                        TableColumn<ICFBamDelSubDep1Obj, ICFBamRelationObj> arg) {
                    return new CFReferenceTableCell<ICFBamDelSubDep1Obj, ICFBamRelationObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupRelation);
    tableColumnLookupDefSchema = new TableColumn<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj> p) {
                    ICFBamDelSubDep1Obj 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<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj>, TableCell<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamDelSubDep1Obj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamDelSubDep1Obj> observable,
                ICFBamDelSubDep1Obj oldValue, ICFBamDelSubDep1Obj newValue) {
            setJavaFXFocus(newValue);
            if (buttonChooseSelected != null) {
                if (newValue != null) {
                    buttonChooseSelected.setDisable(false);
                } else {
                    buttonChooseSelected.setDisable(true);
                }
            }
        }
    });
    hboxMenu = new CFHBox(10);
    buttonCancel = new CFButton();
    buttonCancel.setMinWidth(200);
    buttonCancel.setText("Cancel");
    buttonCancel.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonCancel);
    buttonChooseNone = new CFButton();
    buttonChooseNone.setMinWidth(200);
    buttonChooseNone.setText("ChooseNone");
    buttonChooseNone.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                invokeWhenChosen.choseDelSubDep1(null);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseNone);
    buttonChooseSelected = new CFButton();
    buttonChooseSelected.setMinWidth(200);
    buttonChooseSelected.setText("ChooseSelected");
    buttonChooseSelected.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                ICFBamDelSubDep1Obj selectedInstance = getJavaFXFocusAsDelSubDep1();
                invokeWhenChosen.choseDelSubDep1(selectedInstance);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseSelected);
    if (argFocus != null) {
        dataTable.getSelectionModel().select(argFocus);
    }
    setTop(hboxMenu);
    setCenter(dataTable);
}

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

public CFBamJavaFXPopSubDep1PickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamPopSubDep1Obj argFocus, ICFBamPopTopDepObj argContainer,
        Collection<ICFBamPopSubDep1Obj> argDataCollection, ICFBamJavaFXPopSubDep1Chosen whenChosen) {
    super();/*  w  w w.j a v a  2s .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");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamPopSubDep1Obj>();
    tableColumnId = new TableColumn<ICFBamPopSubDep1Obj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamPopSubDep1Obj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamPopSubDep1Obj, Long> p) {
                    ICFBamScopeObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        long value = obj.getRequiredId();
                        Long wrapped = new Long(value);
                        ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnId.setCellFactory(
            new Callback<TableColumn<ICFBamPopSubDep1Obj, Long>, TableCell<ICFBamPopSubDep1Obj, Long>>() {
                @Override
                public TableCell<ICFBamPopSubDep1Obj, Long> call(TableColumn<ICFBamPopSubDep1Obj, Long> arg) {
                    return new CFInt64TableCell<ICFBamPopSubDep1Obj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamPopSubDep1Obj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamPopSubDep1Obj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamPopSubDep1Obj, String> p) {
                    ICFBamPopSubDep1Obj 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<ICFBamPopSubDep1Obj, String>, TableCell<ICFBamPopSubDep1Obj, String>>() {
                @Override
                public TableCell<ICFBamPopSubDep1Obj, String> call(
                        TableColumn<ICFBamPopSubDep1Obj, String> arg) {
                    return new CFStringTableCell<ICFBamPopSubDep1Obj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnLookupRelation = new TableColumn<ICFBamPopSubDep1Obj, ICFBamRelationObj>("Relation");
    tableColumnLookupRelation.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamPopSubDep1Obj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() {
                public ObservableValue<ICFBamRelationObj> call(
                        CellDataFeatures<ICFBamPopSubDep1Obj, ICFBamRelationObj> p) {
                    ICFBamPopSubDep1Obj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamRelationObj ref = obj.getRequiredLookupRelation();
                        ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupRelation.setCellFactory(
            new Callback<TableColumn<ICFBamPopSubDep1Obj, ICFBamRelationObj>, TableCell<ICFBamPopSubDep1Obj, ICFBamRelationObj>>() {
                @Override
                public TableCell<ICFBamPopSubDep1Obj, ICFBamRelationObj> call(
                        TableColumn<ICFBamPopSubDep1Obj, ICFBamRelationObj> arg) {
                    return new CFReferenceTableCell<ICFBamPopSubDep1Obj, ICFBamRelationObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupRelation);
    tableColumnLookupDefSchema = new TableColumn<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj> p) {
                    ICFBamPopSubDep1Obj 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<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj>, TableCell<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamPopSubDep1Obj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamPopSubDep1Obj> observable,
                ICFBamPopSubDep1Obj oldValue, ICFBamPopSubDep1Obj newValue) {
            setJavaFXFocus(newValue);
            if (buttonChooseSelected != null) {
                if (newValue != null) {
                    buttonChooseSelected.setDisable(false);
                } else {
                    buttonChooseSelected.setDisable(true);
                }
            }
        }
    });
    hboxMenu = new CFHBox(10);
    buttonCancel = new CFButton();
    buttonCancel.setMinWidth(200);
    buttonCancel.setText("Cancel");
    buttonCancel.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonCancel);
    buttonChooseNone = new CFButton();
    buttonChooseNone.setMinWidth(200);
    buttonChooseNone.setText("ChooseNone");
    buttonChooseNone.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                invokeWhenChosen.chosePopSubDep1(null);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseNone);
    buttonChooseSelected = new CFButton();
    buttonChooseSelected.setMinWidth(200);
    buttonChooseSelected.setText("ChooseSelected");
    buttonChooseSelected.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                ICFBamPopSubDep1Obj selectedInstance = getJavaFXFocusAsPopSubDep1();
                invokeWhenChosen.chosePopSubDep1(selectedInstance);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseSelected);
    if (argFocus != null) {
        dataTable.getSelectionModel().select(argFocus);
    }
    setTop(hboxMenu);
    setCenter(dataTable);
}

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

public CFBamJavaFXDelSubDep2PickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamDelSubDep2Obj argFocus, ICFBamDelSubDep1Obj argContainer,
        Collection<ICFBamDelSubDep2Obj> argDataCollection, ICFBamJavaFXDelSubDep2Chosen whenChosen) {
    super();/*  ww w .jav  a  2 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");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamDelSubDep2Obj>();
    tableColumnId = new TableColumn<ICFBamDelSubDep2Obj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDelSubDep2Obj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamDelSubDep2Obj, Long> p) {
                    ICFBamScopeObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        long value = obj.getRequiredId();
                        Long wrapped = new Long(value);
                        ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnId.setCellFactory(
            new Callback<TableColumn<ICFBamDelSubDep2Obj, Long>, TableCell<ICFBamDelSubDep2Obj, Long>>() {
                @Override
                public TableCell<ICFBamDelSubDep2Obj, Long> call(TableColumn<ICFBamDelSubDep2Obj, Long> arg) {
                    return new CFInt64TableCell<ICFBamDelSubDep2Obj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamDelSubDep2Obj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDelSubDep2Obj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamDelSubDep2Obj, String> p) {
                    ICFBamDelSubDep2Obj 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<ICFBamDelSubDep2Obj, String>, TableCell<ICFBamDelSubDep2Obj, String>>() {
                @Override
                public TableCell<ICFBamDelSubDep2Obj, String> call(
                        TableColumn<ICFBamDelSubDep2Obj, String> arg) {
                    return new CFStringTableCell<ICFBamDelSubDep2Obj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnLookupRelation = new TableColumn<ICFBamDelSubDep2Obj, ICFBamRelationObj>("Relation");
    tableColumnLookupRelation.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDelSubDep2Obj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() {
                public ObservableValue<ICFBamRelationObj> call(
                        CellDataFeatures<ICFBamDelSubDep2Obj, ICFBamRelationObj> p) {
                    ICFBamDelSubDep2Obj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamRelationObj ref = obj.getRequiredLookupRelation();
                        ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupRelation.setCellFactory(
            new Callback<TableColumn<ICFBamDelSubDep2Obj, ICFBamRelationObj>, TableCell<ICFBamDelSubDep2Obj, ICFBamRelationObj>>() {
                @Override
                public TableCell<ICFBamDelSubDep2Obj, ICFBamRelationObj> call(
                        TableColumn<ICFBamDelSubDep2Obj, ICFBamRelationObj> arg) {
                    return new CFReferenceTableCell<ICFBamDelSubDep2Obj, ICFBamRelationObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupRelation);
    tableColumnLookupDefSchema = new TableColumn<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj> p) {
                    ICFBamDelSubDep2Obj 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<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj>, TableCell<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamDelSubDep2Obj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamDelSubDep2Obj> observable,
                ICFBamDelSubDep2Obj oldValue, ICFBamDelSubDep2Obj newValue) {
            setJavaFXFocus(newValue);
            if (buttonChooseSelected != null) {
                if (newValue != null) {
                    buttonChooseSelected.setDisable(false);
                } else {
                    buttonChooseSelected.setDisable(true);
                }
            }
        }
    });
    hboxMenu = new CFHBox(10);
    buttonCancel = new CFButton();
    buttonCancel.setMinWidth(200);
    buttonCancel.setText("Cancel");
    buttonCancel.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonCancel);
    buttonChooseNone = new CFButton();
    buttonChooseNone.setMinWidth(200);
    buttonChooseNone.setText("ChooseNone");
    buttonChooseNone.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                invokeWhenChosen.choseDelSubDep2(null);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseNone);
    buttonChooseSelected = new CFButton();
    buttonChooseSelected.setMinWidth(200);
    buttonChooseSelected.setText("ChooseSelected");
    buttonChooseSelected.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                ICFBamDelSubDep2Obj selectedInstance = getJavaFXFocusAsDelSubDep2();
                invokeWhenChosen.choseDelSubDep2(selectedInstance);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseSelected);
    if (argFocus != null) {
        dataTable.getSelectionModel().select(argFocus);
    }
    setTop(hboxMenu);
    setCenter(dataTable);
}