List of usage examples for javafx.scene.control ScrollPane ScrollPane
public ScrollPane()
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXBoolDefListPane.java
public CFHBox getPanelHBoxMenu() { if (hboxMenu == null) { hboxMenu = new CFHBox(10); LinkedList<CFButton> list = new LinkedList<CFButton>(); vboxMenuAdd = new CFVBox(10); buttonAddBoolType = new CFButton(); buttonAddBoolType.setMinWidth(200); buttonAddBoolType.setText("Add BoolType"); buttonAddBoolType.setOnAction(new EventHandler<ActionEvent>() { @Override/* w ww.j a va2 s . co m*/ public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamBoolTypeObj obj = (ICFBamBoolTypeObj) schemaObj.getBoolTypeTableObj().newInstance(); CFBorderPane frame = javafxSchema.getBoolTypeFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamBoolTypeEditObj edit = (ICFBamBoolTypeEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFBamSchemaDefObj container = (ICFBamSchemaDefObj) (getJavaFXContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "JavaFXContainer"); } edit.setRequiredContainerSchemaDef(container); ICFBamJavaFXBoolTypePaneCommon jpanelCommon = (ICFBamJavaFXBoolTypePaneCommon) frame; jpanelCommon.setJavaFXFocus(obj); jpanelCommon.setPaneMode(CFPane.PaneMode.Add); cfFormManager.pushForm(frame); setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); if (javafxContainer instanceof ICFBamSchemaDefObj) { list.add(buttonAddBoolType); } buttonAddBoolCol = new CFButton(); buttonAddBoolCol.setMinWidth(200); buttonAddBoolCol.setText("Add BoolCol"); buttonAddBoolCol.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamBoolColObj obj = (ICFBamBoolColObj) schemaObj.getBoolColTableObj().newInstance(); CFBorderPane frame = javafxSchema.getBoolColFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamBoolColEditObj edit = (ICFBamBoolColEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFBamTableObj container = (ICFBamTableObj) (getJavaFXContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "JavaFXContainer"); } edit.setRequiredContainerTable(container); ICFBamJavaFXBoolColPaneCommon jpanelCommon = (ICFBamJavaFXBoolColPaneCommon) frame; jpanelCommon.setJavaFXFocus(obj); jpanelCommon.setPaneMode(CFPane.PaneMode.Add); cfFormManager.pushForm(frame); setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); if (javafxContainer instanceof ICFBamTableObj) { list.add(buttonAddBoolCol); } int len = list.size(); CFButton arr[] = new CFButton[len]; Iterator<CFButton> iter = list.iterator(); int idx = 0; while (iter.hasNext()) { arr[idx++] = iter.next(); } Arrays.sort(arr, new CompareCFButtonByText()); for (idx = 0; idx < len; idx++) { vboxMenuAdd.getChildren().add(arr[idx]); } buttonCancelAdd = new CFButton(); buttonCancelAdd.setMinWidth(200); buttonCancelAdd.setText("Cancel Add..."); buttonCancelAdd.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); vboxMenuAdd.getChildren().add(buttonCancelAdd); scrollMenuAdd = new ScrollPane(); scrollMenuAdd.setMinWidth(240); scrollMenuAdd.setMaxWidth(240); scrollMenuAdd.setFitToWidth(true); scrollMenuAdd.setHbarPolicy(ScrollBarPolicy.NEVER); scrollMenuAdd.setVbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenuAdd.setContent(vboxMenuAdd); buttonAdd = new CFButton(); buttonAdd.setMinWidth(200); buttonAdd.setText("Add..."); buttonAdd.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { setLeft(scrollMenuAdd); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonAdd); buttonViewSelected = new CFButton(); buttonViewSelected.setMinWidth(200); buttonViewSelected.setText("View Selected"); buttonViewSelected.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"); } ICFBamBoolDefObj selectedInstance = getJavaFXFocusAsBoolDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("BOLD".equals(classCode)) { CFBorderPane frame = javafxSchema.getBoolDefFactory().newViewEditForm(cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXBoolDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("BOLT".equals(classCode)) { ICFBamBoolTypeObj obj = (ICFBamBoolTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getBoolTypeFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXBoolTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("BOLC".equals(classCode)) { ICFBamBoolColObj obj = (ICFBamBoolColObj) selectedInstance; CFBorderPane frame = javafxSchema.getBoolColFactory().newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXBoolColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamBoolDefObj, ICFBamBoolTypeObj, ICFBamBoolColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonViewSelected); buttonEditSelected = new CFButton(); buttonEditSelected.setMinWidth(200); buttonEditSelected.setText("Edit Selected"); buttonEditSelected.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"); } ICFBamBoolDefObj selectedInstance = getJavaFXFocusAsBoolDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("BOLD".equals(classCode)) { CFBorderPane frame = javafxSchema.getBoolDefFactory().newViewEditForm(cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXBoolDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("BOLT".equals(classCode)) { ICFBamBoolTypeObj obj = (ICFBamBoolTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getBoolTypeFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXBoolTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("BOLC".equals(classCode)) { ICFBamBoolColObj obj = (ICFBamBoolColObj) selectedInstance; CFBorderPane frame = javafxSchema.getBoolColFactory().newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXBoolColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamBoolDefObj, ICFBamBoolTypeObj, ICFBamBoolColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonEditSelected); buttonDeleteSelected = new CFButton(); buttonDeleteSelected.setMinWidth(200); buttonDeleteSelected.setText("Delete Selected"); buttonDeleteSelected.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"); } ICFBamBoolDefObj selectedInstance = getJavaFXFocusAsBoolDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("BOLD".equals(classCode)) { CFBorderPane frame = javafxSchema.getBoolDefFactory() .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback()); ((ICFBamJavaFXBoolDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("BOLT".equals(classCode)) { ICFBamBoolTypeObj obj = (ICFBamBoolTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getBoolTypeFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXBoolTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("BOLC".equals(classCode)) { ICFBamBoolColObj obj = (ICFBamBoolColObj) selectedInstance; CFBorderPane frame = javafxSchema.getBoolColFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXBoolColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamBoolDefObj, ICFBamBoolTypeObj, ICFBamBoolColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonDeleteSelected); } return (hboxMenu); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXUuidDefListPane.java
public CFHBox getPanelHBoxMenu() { if (hboxMenu == null) { hboxMenu = new CFHBox(10); LinkedList<CFButton> list = new LinkedList<CFButton>(); vboxMenuAdd = new CFVBox(10); buttonAddUuidType = new CFButton(); buttonAddUuidType.setMinWidth(200); buttonAddUuidType.setText("Add UuidType"); buttonAddUuidType.setOnAction(new EventHandler<ActionEvent>() { @Override/*from w w w.j a v a 2 s.c om*/ public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamUuidTypeObj obj = (ICFBamUuidTypeObj) schemaObj.getUuidTypeTableObj().newInstance(); CFBorderPane frame = javafxSchema.getUuidTypeFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamUuidTypeEditObj edit = (ICFBamUuidTypeEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFBamSchemaDefObj container = (ICFBamSchemaDefObj) (getJavaFXContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "JavaFXContainer"); } edit.setRequiredContainerSchemaDef(container); ICFBamJavaFXUuidTypePaneCommon jpanelCommon = (ICFBamJavaFXUuidTypePaneCommon) frame; jpanelCommon.setJavaFXFocus(obj); jpanelCommon.setPaneMode(CFPane.PaneMode.Add); cfFormManager.pushForm(frame); setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); if (javafxContainer instanceof ICFBamSchemaDefObj) { list.add(buttonAddUuidType); } buttonAddUuidGen = new CFButton(); buttonAddUuidGen.setMinWidth(200); buttonAddUuidGen.setText("Add UuidGen"); buttonAddUuidGen.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamUuidGenObj obj = (ICFBamUuidGenObj) schemaObj.getUuidGenTableObj().newInstance(); CFBorderPane frame = javafxSchema.getUuidGenFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamUuidGenEditObj edit = (ICFBamUuidGenEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFBamSchemaDefObj container = (ICFBamSchemaDefObj) (getJavaFXContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "JavaFXContainer"); } edit.setRequiredContainerSchemaDef(container); ICFBamJavaFXUuidGenPaneCommon jpanelCommon = (ICFBamJavaFXUuidGenPaneCommon) frame; jpanelCommon.setJavaFXFocus(obj); jpanelCommon.setPaneMode(CFPane.PaneMode.Add); cfFormManager.pushForm(frame); setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); if (javafxContainer instanceof ICFBamSchemaDefObj) { list.add(buttonAddUuidGen); } buttonAddUuidCol = new CFButton(); buttonAddUuidCol.setMinWidth(200); buttonAddUuidCol.setText("Add UuidCol"); buttonAddUuidCol.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamUuidColObj obj = (ICFBamUuidColObj) schemaObj.getUuidColTableObj().newInstance(); CFBorderPane frame = javafxSchema.getUuidColFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamUuidColEditObj edit = (ICFBamUuidColEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFBamTableObj container = (ICFBamTableObj) (getJavaFXContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "JavaFXContainer"); } edit.setRequiredContainerTable(container); ICFBamJavaFXUuidColPaneCommon jpanelCommon = (ICFBamJavaFXUuidColPaneCommon) frame; jpanelCommon.setJavaFXFocus(obj); jpanelCommon.setPaneMode(CFPane.PaneMode.Add); cfFormManager.pushForm(frame); setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); if (javafxContainer instanceof ICFBamTableObj) { list.add(buttonAddUuidCol); } int len = list.size(); CFButton arr[] = new CFButton[len]; Iterator<CFButton> iter = list.iterator(); int idx = 0; while (iter.hasNext()) { arr[idx++] = iter.next(); } Arrays.sort(arr, new CompareCFButtonByText()); for (idx = 0; idx < len; idx++) { vboxMenuAdd.getChildren().add(arr[idx]); } buttonCancelAdd = new CFButton(); buttonCancelAdd.setMinWidth(200); buttonCancelAdd.setText("Cancel Add..."); buttonCancelAdd.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); vboxMenuAdd.getChildren().add(buttonCancelAdd); scrollMenuAdd = new ScrollPane(); scrollMenuAdd.setMinWidth(240); scrollMenuAdd.setMaxWidth(240); scrollMenuAdd.setFitToWidth(true); scrollMenuAdd.setHbarPolicy(ScrollBarPolicy.NEVER); scrollMenuAdd.setVbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenuAdd.setContent(vboxMenuAdd); buttonAdd = new CFButton(); buttonAdd.setMinWidth(200); buttonAdd.setText("Add..."); buttonAdd.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { setLeft(scrollMenuAdd); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonAdd); buttonViewSelected = new CFButton(); buttonViewSelected.setMinWidth(200); buttonViewSelected.setText("View Selected"); buttonViewSelected.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"); } ICFBamUuidDefObj selectedInstance = getJavaFXFocusAsUuidDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("UIDD".equals(classCode)) { CFBorderPane frame = javafxSchema.getUuidDefFactory().newViewEditForm(cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXUuidDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("UIDT".equals(classCode)) { ICFBamUuidTypeObj obj = (ICFBamUuidTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getUuidTypeFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXUuidTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("IGUU".equals(classCode)) { ICFBamUuidGenObj obj = (ICFBamUuidGenObj) selectedInstance; CFBorderPane frame = javafxSchema.getUuidGenFactory().newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXUuidGenPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("UIDC".equals(classCode)) { ICFBamUuidColObj obj = (ICFBamUuidColObj) selectedInstance; CFBorderPane frame = javafxSchema.getUuidColFactory().newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXUuidColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamUuidDefObj, ICFBamUuidTypeObj, ICFBamUuidGenObj, ICFBamUuidColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonViewSelected); buttonEditSelected = new CFButton(); buttonEditSelected.setMinWidth(200); buttonEditSelected.setText("Edit Selected"); buttonEditSelected.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"); } ICFBamUuidDefObj selectedInstance = getJavaFXFocusAsUuidDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("UIDD".equals(classCode)) { CFBorderPane frame = javafxSchema.getUuidDefFactory().newViewEditForm(cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXUuidDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("UIDT".equals(classCode)) { ICFBamUuidTypeObj obj = (ICFBamUuidTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getUuidTypeFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXUuidTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("IGUU".equals(classCode)) { ICFBamUuidGenObj obj = (ICFBamUuidGenObj) selectedInstance; CFBorderPane frame = javafxSchema.getUuidGenFactory().newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXUuidGenPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("UIDC".equals(classCode)) { ICFBamUuidColObj obj = (ICFBamUuidColObj) selectedInstance; CFBorderPane frame = javafxSchema.getUuidColFactory().newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXUuidColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamUuidDefObj, ICFBamUuidTypeObj, ICFBamUuidGenObj, ICFBamUuidColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonEditSelected); buttonDeleteSelected = new CFButton(); buttonDeleteSelected.setMinWidth(200); buttonDeleteSelected.setText("Delete Selected"); buttonDeleteSelected.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"); } ICFBamUuidDefObj selectedInstance = getJavaFXFocusAsUuidDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("UIDD".equals(classCode)) { CFBorderPane frame = javafxSchema.getUuidDefFactory() .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback()); ((ICFBamJavaFXUuidDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("UIDT".equals(classCode)) { ICFBamUuidTypeObj obj = (ICFBamUuidTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getUuidTypeFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXUuidTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("IGUU".equals(classCode)) { ICFBamUuidGenObj obj = (ICFBamUuidGenObj) selectedInstance; CFBorderPane frame = javafxSchema.getUuidGenFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXUuidGenPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("UIDC".equals(classCode)) { ICFBamUuidColObj obj = (ICFBamUuidColObj) selectedInstance; CFBorderPane frame = javafxSchema.getUuidColFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXUuidColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamUuidDefObj, ICFBamUuidTypeObj, ICFBamUuidGenObj, ICFBamUuidColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonDeleteSelected); } return (hboxMenu); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTextDefListPane.java
public CFHBox getPanelHBoxMenu() { if (hboxMenu == null) { hboxMenu = new CFHBox(10); LinkedList<CFButton> list = new LinkedList<CFButton>(); vboxMenuAdd = new CFVBox(10); buttonAddTextType = new CFButton(); buttonAddTextType.setMinWidth(200); buttonAddTextType.setText("Add TextType"); buttonAddTextType.setOnAction(new EventHandler<ActionEvent>() { @Override/*ww w . ja va 2s . com*/ public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamTextTypeObj obj = (ICFBamTextTypeObj) schemaObj.getTextTypeTableObj().newInstance(); CFBorderPane frame = javafxSchema.getTextTypeFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamTextTypeEditObj edit = (ICFBamTextTypeEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFBamSchemaDefObj container = (ICFBamSchemaDefObj) (getJavaFXContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "JavaFXContainer"); } edit.setRequiredContainerSchemaDef(container); ICFBamJavaFXTextTypePaneCommon jpanelCommon = (ICFBamJavaFXTextTypePaneCommon) frame; jpanelCommon.setJavaFXFocus(obj); jpanelCommon.setPaneMode(CFPane.PaneMode.Add); cfFormManager.pushForm(frame); setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); if (javafxContainer instanceof ICFBamSchemaDefObj) { list.add(buttonAddTextType); } buttonAddTextCol = new CFButton(); buttonAddTextCol.setMinWidth(200); buttonAddTextCol.setText("Add TextCol"); buttonAddTextCol.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamTextColObj obj = (ICFBamTextColObj) schemaObj.getTextColTableObj().newInstance(); CFBorderPane frame = javafxSchema.getTextColFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamTextColEditObj edit = (ICFBamTextColEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFBamTableObj container = (ICFBamTableObj) (getJavaFXContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "JavaFXContainer"); } edit.setRequiredContainerTable(container); ICFBamJavaFXTextColPaneCommon jpanelCommon = (ICFBamJavaFXTextColPaneCommon) frame; jpanelCommon.setJavaFXFocus(obj); jpanelCommon.setPaneMode(CFPane.PaneMode.Add); cfFormManager.pushForm(frame); setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); if (javafxContainer instanceof ICFBamTableObj) { list.add(buttonAddTextCol); } int len = list.size(); CFButton arr[] = new CFButton[len]; Iterator<CFButton> iter = list.iterator(); int idx = 0; while (iter.hasNext()) { arr[idx++] = iter.next(); } Arrays.sort(arr, new CompareCFButtonByText()); for (idx = 0; idx < len; idx++) { vboxMenuAdd.getChildren().add(arr[idx]); } buttonCancelAdd = new CFButton(); buttonCancelAdd.setMinWidth(200); buttonCancelAdd.setText("Cancel Add..."); buttonCancelAdd.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); vboxMenuAdd.getChildren().add(buttonCancelAdd); scrollMenuAdd = new ScrollPane(); scrollMenuAdd.setMinWidth(240); scrollMenuAdd.setMaxWidth(240); scrollMenuAdd.setFitToWidth(true); scrollMenuAdd.setHbarPolicy(ScrollBarPolicy.NEVER); scrollMenuAdd.setVbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenuAdd.setContent(vboxMenuAdd); buttonAdd = new CFButton(); buttonAdd.setMinWidth(200); buttonAdd.setText("Add..."); buttonAdd.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { setLeft(scrollMenuAdd); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonAdd); buttonViewSelected = new CFButton(); buttonViewSelected.setMinWidth(200); buttonViewSelected.setText("View Selected"); buttonViewSelected.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"); } ICFBamTextDefObj selectedInstance = getJavaFXFocusAsTextDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("TXTD".equals(classCode)) { CFBorderPane frame = javafxSchema.getTextDefFactory().newViewEditForm(cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXTextDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("TXTT".equals(classCode)) { ICFBamTextTypeObj obj = (ICFBamTextTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getTextTypeFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXTextTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("TXTC".equals(classCode)) { ICFBamTextColObj obj = (ICFBamTextColObj) selectedInstance; CFBorderPane frame = javafxSchema.getTextColFactory().newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXTextColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamTextDefObj, ICFBamTextTypeObj, ICFBamTextColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonViewSelected); buttonEditSelected = new CFButton(); buttonEditSelected.setMinWidth(200); buttonEditSelected.setText("Edit Selected"); buttonEditSelected.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"); } ICFBamTextDefObj selectedInstance = getJavaFXFocusAsTextDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("TXTD".equals(classCode)) { CFBorderPane frame = javafxSchema.getTextDefFactory().newViewEditForm(cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXTextDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("TXTT".equals(classCode)) { ICFBamTextTypeObj obj = (ICFBamTextTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getTextTypeFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXTextTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("TXTC".equals(classCode)) { ICFBamTextColObj obj = (ICFBamTextColObj) selectedInstance; CFBorderPane frame = javafxSchema.getTextColFactory().newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXTextColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamTextDefObj, ICFBamTextTypeObj, ICFBamTextColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonEditSelected); buttonDeleteSelected = new CFButton(); buttonDeleteSelected.setMinWidth(200); buttonDeleteSelected.setText("Delete Selected"); buttonDeleteSelected.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"); } ICFBamTextDefObj selectedInstance = getJavaFXFocusAsTextDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("TXTD".equals(classCode)) { CFBorderPane frame = javafxSchema.getTextDefFactory() .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback()); ((ICFBamJavaFXTextDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("TXTT".equals(classCode)) { ICFBamTextTypeObj obj = (ICFBamTextTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getTextTypeFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXTextTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("TXTC".equals(classCode)) { ICFBamTextColObj obj = (ICFBamTextColObj) selectedInstance; CFBorderPane frame = javafxSchema.getTextColFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXTextColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamTextDefObj, ICFBamTextTypeObj, ICFBamTextColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonDeleteSelected); } return (hboxMenu); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXDateDefListPane.java
public CFHBox getPanelHBoxMenu() { if (hboxMenu == null) { hboxMenu = new CFHBox(10); LinkedList<CFButton> list = new LinkedList<CFButton>(); vboxMenuAdd = new CFVBox(10); buttonAddDateType = new CFButton(); buttonAddDateType.setMinWidth(200); buttonAddDateType.setText("Add DateType"); buttonAddDateType.setOnAction(new EventHandler<ActionEvent>() { @Override//from w w w. ja v a 2s . com public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamDateTypeObj obj = (ICFBamDateTypeObj) schemaObj.getDateTypeTableObj().newInstance(); CFBorderPane frame = javafxSchema.getDateTypeFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamDateTypeEditObj edit = (ICFBamDateTypeEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFBamSchemaDefObj container = (ICFBamSchemaDefObj) (getJavaFXContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "JavaFXContainer"); } edit.setRequiredContainerSchemaDef(container); ICFBamJavaFXDateTypePaneCommon jpanelCommon = (ICFBamJavaFXDateTypePaneCommon) frame; jpanelCommon.setJavaFXFocus(obj); jpanelCommon.setPaneMode(CFPane.PaneMode.Add); cfFormManager.pushForm(frame); setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); if (javafxContainer instanceof ICFBamSchemaDefObj) { list.add(buttonAddDateType); } buttonAddDateCol = new CFButton(); buttonAddDateCol.setMinWidth(200); buttonAddDateCol.setText("Add DateCol"); buttonAddDateCol.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamDateColObj obj = (ICFBamDateColObj) schemaObj.getDateColTableObj().newInstance(); CFBorderPane frame = javafxSchema.getDateColFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamDateColEditObj edit = (ICFBamDateColEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFBamTableObj container = (ICFBamTableObj) (getJavaFXContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "JavaFXContainer"); } edit.setRequiredContainerTable(container); ICFBamJavaFXDateColPaneCommon jpanelCommon = (ICFBamJavaFXDateColPaneCommon) frame; jpanelCommon.setJavaFXFocus(obj); jpanelCommon.setPaneMode(CFPane.PaneMode.Add); cfFormManager.pushForm(frame); setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); if (javafxContainer instanceof ICFBamTableObj) { list.add(buttonAddDateCol); } int len = list.size(); CFButton arr[] = new CFButton[len]; Iterator<CFButton> iter = list.iterator(); int idx = 0; while (iter.hasNext()) { arr[idx++] = iter.next(); } Arrays.sort(arr, new CompareCFButtonByText()); for (idx = 0; idx < len; idx++) { vboxMenuAdd.getChildren().add(arr[idx]); } buttonCancelAdd = new CFButton(); buttonCancelAdd.setMinWidth(200); buttonCancelAdd.setText("Cancel Add..."); buttonCancelAdd.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); vboxMenuAdd.getChildren().add(buttonCancelAdd); scrollMenuAdd = new ScrollPane(); scrollMenuAdd.setMinWidth(240); scrollMenuAdd.setMaxWidth(240); scrollMenuAdd.setFitToWidth(true); scrollMenuAdd.setHbarPolicy(ScrollBarPolicy.NEVER); scrollMenuAdd.setVbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenuAdd.setContent(vboxMenuAdd); buttonAdd = new CFButton(); buttonAdd.setMinWidth(200); buttonAdd.setText("Add..."); buttonAdd.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { setLeft(scrollMenuAdd); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonAdd); buttonViewSelected = new CFButton(); buttonViewSelected.setMinWidth(200); buttonViewSelected.setText("View Selected"); buttonViewSelected.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"); } ICFBamDateDefObj selectedInstance = getJavaFXFocusAsDateDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("DATD".equals(classCode)) { CFBorderPane frame = javafxSchema.getDateDefFactory().newViewEditForm(cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXDateDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("DATT".equals(classCode)) { ICFBamDateTypeObj obj = (ICFBamDateTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getDateTypeFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXDateTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("DATC".equals(classCode)) { ICFBamDateColObj obj = (ICFBamDateColObj) selectedInstance; CFBorderPane frame = javafxSchema.getDateColFactory().newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXDateColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamDateDefObj, ICFBamDateTypeObj, ICFBamDateColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonViewSelected); buttonEditSelected = new CFButton(); buttonEditSelected.setMinWidth(200); buttonEditSelected.setText("Edit Selected"); buttonEditSelected.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"); } ICFBamDateDefObj selectedInstance = getJavaFXFocusAsDateDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("DATD".equals(classCode)) { CFBorderPane frame = javafxSchema.getDateDefFactory().newViewEditForm(cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXDateDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("DATT".equals(classCode)) { ICFBamDateTypeObj obj = (ICFBamDateTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getDateTypeFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXDateTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("DATC".equals(classCode)) { ICFBamDateColObj obj = (ICFBamDateColObj) selectedInstance; CFBorderPane frame = javafxSchema.getDateColFactory().newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXDateColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamDateDefObj, ICFBamDateTypeObj, ICFBamDateColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonEditSelected); buttonDeleteSelected = new CFButton(); buttonDeleteSelected.setMinWidth(200); buttonDeleteSelected.setText("Delete Selected"); buttonDeleteSelected.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"); } ICFBamDateDefObj selectedInstance = getJavaFXFocusAsDateDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("DATD".equals(classCode)) { CFBorderPane frame = javafxSchema.getDateDefFactory() .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback()); ((ICFBamJavaFXDateDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("DATT".equals(classCode)) { ICFBamDateTypeObj obj = (ICFBamDateTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getDateTypeFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXDateTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("DATC".equals(classCode)) { ICFBamDateColObj obj = (ICFBamDateColObj) selectedInstance; CFBorderPane frame = javafxSchema.getDateColFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXDateColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamDateDefObj, ICFBamDateTypeObj, ICFBamDateColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonDeleteSelected); } return (hboxMenu); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXFloatDefListPane.java
public CFHBox getPanelHBoxMenu() { if (hboxMenu == null) { hboxMenu = new CFHBox(10); LinkedList<CFButton> list = new LinkedList<CFButton>(); vboxMenuAdd = new CFVBox(10); buttonAddFloatType = new CFButton(); buttonAddFloatType.setMinWidth(200); buttonAddFloatType.setText("Add FloatType"); buttonAddFloatType.setOnAction(new EventHandler<ActionEvent>() { @Override//ww w . j a v a2 s.c o m public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamFloatTypeObj obj = (ICFBamFloatTypeObj) schemaObj.getFloatTypeTableObj() .newInstance(); CFBorderPane frame = javafxSchema.getFloatTypeFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamFloatTypeEditObj edit = (ICFBamFloatTypeEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFBamSchemaDefObj container = (ICFBamSchemaDefObj) (getJavaFXContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "JavaFXContainer"); } edit.setRequiredContainerSchemaDef(container); ICFBamJavaFXFloatTypePaneCommon jpanelCommon = (ICFBamJavaFXFloatTypePaneCommon) frame; jpanelCommon.setJavaFXFocus(obj); jpanelCommon.setPaneMode(CFPane.PaneMode.Add); cfFormManager.pushForm(frame); setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); if (javafxContainer instanceof ICFBamSchemaDefObj) { list.add(buttonAddFloatType); } buttonAddFloatCol = new CFButton(); buttonAddFloatCol.setMinWidth(200); buttonAddFloatCol.setText("Add FloatCol"); buttonAddFloatCol.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamFloatColObj obj = (ICFBamFloatColObj) schemaObj.getFloatColTableObj().newInstance(); CFBorderPane frame = javafxSchema.getFloatColFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamFloatColEditObj edit = (ICFBamFloatColEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFBamTableObj container = (ICFBamTableObj) (getJavaFXContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "JavaFXContainer"); } edit.setRequiredContainerTable(container); ICFBamJavaFXFloatColPaneCommon jpanelCommon = (ICFBamJavaFXFloatColPaneCommon) frame; jpanelCommon.setJavaFXFocus(obj); jpanelCommon.setPaneMode(CFPane.PaneMode.Add); cfFormManager.pushForm(frame); setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); if (javafxContainer instanceof ICFBamTableObj) { list.add(buttonAddFloatCol); } int len = list.size(); CFButton arr[] = new CFButton[len]; Iterator<CFButton> iter = list.iterator(); int idx = 0; while (iter.hasNext()) { arr[idx++] = iter.next(); } Arrays.sort(arr, new CompareCFButtonByText()); for (idx = 0; idx < len; idx++) { vboxMenuAdd.getChildren().add(arr[idx]); } buttonCancelAdd = new CFButton(); buttonCancelAdd.setMinWidth(200); buttonCancelAdd.setText("Cancel Add..."); buttonCancelAdd.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); vboxMenuAdd.getChildren().add(buttonCancelAdd); scrollMenuAdd = new ScrollPane(); scrollMenuAdd.setMinWidth(240); scrollMenuAdd.setMaxWidth(240); scrollMenuAdd.setFitToWidth(true); scrollMenuAdd.setHbarPolicy(ScrollBarPolicy.NEVER); scrollMenuAdd.setVbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenuAdd.setContent(vboxMenuAdd); buttonAdd = new CFButton(); buttonAdd.setMinWidth(200); buttonAdd.setText("Add..."); buttonAdd.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { setLeft(scrollMenuAdd); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonAdd); buttonViewSelected = new CFButton(); buttonViewSelected.setMinWidth(200); buttonViewSelected.setText("View Selected"); buttonViewSelected.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"); } ICFBamFloatDefObj selectedInstance = getJavaFXFocusAsFloatDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("FLTD".equals(classCode)) { CFBorderPane frame = javafxSchema.getFloatDefFactory().newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXFloatDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("FLTT".equals(classCode)) { ICFBamFloatTypeObj obj = (ICFBamFloatTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getFloatTypeFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXFloatTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("FLTC".equals(classCode)) { ICFBamFloatColObj obj = (ICFBamFloatColObj) selectedInstance; CFBorderPane frame = javafxSchema.getFloatColFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXFloatColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamFloatDefObj, ICFBamFloatTypeObj, ICFBamFloatColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonViewSelected); buttonEditSelected = new CFButton(); buttonEditSelected.setMinWidth(200); buttonEditSelected.setText("Edit Selected"); buttonEditSelected.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"); } ICFBamFloatDefObj selectedInstance = getJavaFXFocusAsFloatDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("FLTD".equals(classCode)) { CFBorderPane frame = javafxSchema.getFloatDefFactory().newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXFloatDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("FLTT".equals(classCode)) { ICFBamFloatTypeObj obj = (ICFBamFloatTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getFloatTypeFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXFloatTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("FLTC".equals(classCode)) { ICFBamFloatColObj obj = (ICFBamFloatColObj) selectedInstance; CFBorderPane frame = javafxSchema.getFloatColFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXFloatColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamFloatDefObj, ICFBamFloatTypeObj, ICFBamFloatColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonEditSelected); buttonDeleteSelected = new CFButton(); buttonDeleteSelected.setMinWidth(200); buttonDeleteSelected.setText("Delete Selected"); buttonDeleteSelected.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"); } ICFBamFloatDefObj selectedInstance = getJavaFXFocusAsFloatDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("FLTD".equals(classCode)) { CFBorderPane frame = javafxSchema.getFloatDefFactory() .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback()); ((ICFBamJavaFXFloatDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("FLTT".equals(classCode)) { ICFBamFloatTypeObj obj = (ICFBamFloatTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getFloatTypeFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXFloatTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("FLTC".equals(classCode)) { ICFBamFloatColObj obj = (ICFBamFloatColObj) selectedInstance; CFBorderPane frame = javafxSchema.getFloatColFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXFloatColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamFloatDefObj, ICFBamFloatTypeObj, ICFBamFloatColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonDeleteSelected); } return (hboxMenu); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXInt64TypeListPane.java
public CFHBox getPanelHBoxMenu() { if (hboxMenu == null) { hboxMenu = new CFHBox(10); LinkedList<CFButton> list = new LinkedList<CFButton>(); vboxMenuAdd = new CFVBox(10); buttonAddInt64Type = new CFButton(); buttonAddInt64Type.setMinWidth(200); buttonAddInt64Type.setText("Add Int64Type"); buttonAddInt64Type.setOnAction(new EventHandler<ActionEvent>() { @Override// ww w . jav a 2 s .c om public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamInt64TypeObj obj = (ICFBamInt64TypeObj) schemaObj.getInt64TypeTableObj() .newInstance(); CFBorderPane frame = javafxSchema.getInt64TypeFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamInt64TypeEditObj edit = (ICFBamInt64TypeEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFBamSchemaDefObj container = (ICFBamSchemaDefObj) (getJavaFXContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "JavaFXContainer"); } edit.setRequiredContainerSchemaDef(container); ICFBamJavaFXInt64TypePaneCommon jpanelCommon = (ICFBamJavaFXInt64TypePaneCommon) frame; jpanelCommon.setJavaFXFocus(obj); jpanelCommon.setPaneMode(CFPane.PaneMode.Add); cfFormManager.pushForm(frame); setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); if (javafxContainer instanceof ICFBamSchemaDefObj) { list.add(buttonAddInt64Type); } buttonAddId64Gen = new CFButton(); buttonAddId64Gen.setMinWidth(200); buttonAddId64Gen.setText("Add Id64Gen"); buttonAddId64Gen.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamId64GenObj obj = (ICFBamId64GenObj) schemaObj.getId64GenTableObj().newInstance(); CFBorderPane frame = javafxSchema.getId64GenFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamId64GenEditObj edit = (ICFBamId64GenEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFBamSchemaDefObj container = (ICFBamSchemaDefObj) (getJavaFXContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "JavaFXContainer"); } edit.setRequiredContainerSchemaDef(container); ICFBamJavaFXId64GenPaneCommon jpanelCommon = (ICFBamJavaFXId64GenPaneCommon) frame; jpanelCommon.setJavaFXFocus(obj); jpanelCommon.setPaneMode(CFPane.PaneMode.Add); cfFormManager.pushForm(frame); setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); if (javafxContainer instanceof ICFBamSchemaDefObj) { list.add(buttonAddId64Gen); } int len = list.size(); CFButton arr[] = new CFButton[len]; Iterator<CFButton> iter = list.iterator(); int idx = 0; while (iter.hasNext()) { arr[idx++] = iter.next(); } Arrays.sort(arr, new CompareCFButtonByText()); for (idx = 0; idx < len; idx++) { vboxMenuAdd.getChildren().add(arr[idx]); } buttonCancelAdd = new CFButton(); buttonCancelAdd.setMinWidth(200); buttonCancelAdd.setText("Cancel Add..."); buttonCancelAdd.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); vboxMenuAdd.getChildren().add(buttonCancelAdd); scrollMenuAdd = new ScrollPane(); scrollMenuAdd.setMinWidth(240); scrollMenuAdd.setMaxWidth(240); scrollMenuAdd.setFitToWidth(true); scrollMenuAdd.setHbarPolicy(ScrollBarPolicy.NEVER); scrollMenuAdd.setVbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenuAdd.setContent(vboxMenuAdd); buttonAdd = new CFButton(); buttonAdd.setMinWidth(200); buttonAdd.setText("Add..."); buttonAdd.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { setLeft(scrollMenuAdd); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonAdd); buttonViewSelected = new CFButton(); buttonViewSelected.setMinWidth(200); buttonViewSelected.setText("View Selected"); buttonViewSelected.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"); } ICFBamInt64TypeObj selectedInstance = getJavaFXFocusAsInt64Type(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("I64T".equals(classCode)) { CFBorderPane frame = javafxSchema.getInt64TypeFactory().newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXInt64TypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("IG64".equals(classCode)) { ICFBamId64GenObj obj = (ICFBamId64GenObj) selectedInstance; CFBorderPane frame = javafxSchema.getId64GenFactory().newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXId64GenPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamInt64TypeObj, ICFBamId64GenObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonViewSelected); buttonEditSelected = new CFButton(); buttonEditSelected.setMinWidth(200); buttonEditSelected.setText("Edit Selected"); buttonEditSelected.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"); } ICFBamInt64TypeObj selectedInstance = getJavaFXFocusAsInt64Type(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("I64T".equals(classCode)) { CFBorderPane frame = javafxSchema.getInt64TypeFactory().newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXInt64TypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("IG64".equals(classCode)) { ICFBamId64GenObj obj = (ICFBamId64GenObj) selectedInstance; CFBorderPane frame = javafxSchema.getId64GenFactory().newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXId64GenPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamInt64TypeObj, ICFBamId64GenObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonEditSelected); buttonDeleteSelected = new CFButton(); buttonDeleteSelected.setMinWidth(200); buttonDeleteSelected.setText("Delete Selected"); buttonDeleteSelected.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"); } ICFBamInt64TypeObj selectedInstance = getJavaFXFocusAsInt64Type(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("I64T".equals(classCode)) { CFBorderPane frame = javafxSchema.getInt64TypeFactory() .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback()); ((ICFBamJavaFXInt64TypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("IG64".equals(classCode)) { ICFBamId64GenObj obj = (ICFBamId64GenObj) selectedInstance; CFBorderPane frame = javafxSchema.getId64GenFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXId64GenPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamInt64TypeObj, ICFBamId64GenObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonDeleteSelected); } return (hboxMenu); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTokenDefListPane.java
public CFHBox getPanelHBoxMenu() { if (hboxMenu == null) { hboxMenu = new CFHBox(10); LinkedList<CFButton> list = new LinkedList<CFButton>(); vboxMenuAdd = new CFVBox(10); buttonAddTokenType = new CFButton(); buttonAddTokenType.setMinWidth(200); buttonAddTokenType.setText("Add TokenType"); buttonAddTokenType.setOnAction(new EventHandler<ActionEvent>() { @Override/*from w ww . ja va 2 s.c o m*/ public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamTokenTypeObj obj = (ICFBamTokenTypeObj) schemaObj.getTokenTypeTableObj() .newInstance(); CFBorderPane frame = javafxSchema.getTokenTypeFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamTokenTypeEditObj edit = (ICFBamTokenTypeEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFBamSchemaDefObj container = (ICFBamSchemaDefObj) (getJavaFXContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "JavaFXContainer"); } edit.setRequiredContainerSchemaDef(container); ICFBamJavaFXTokenTypePaneCommon jpanelCommon = (ICFBamJavaFXTokenTypePaneCommon) frame; jpanelCommon.setJavaFXFocus(obj); jpanelCommon.setPaneMode(CFPane.PaneMode.Add); cfFormManager.pushForm(frame); setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); if (javafxContainer instanceof ICFBamSchemaDefObj) { list.add(buttonAddTokenType); } buttonAddTokenCol = new CFButton(); buttonAddTokenCol.setMinWidth(200); buttonAddTokenCol.setText("Add TokenCol"); buttonAddTokenCol.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamTokenColObj obj = (ICFBamTokenColObj) schemaObj.getTokenColTableObj().newInstance(); CFBorderPane frame = javafxSchema.getTokenColFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamTokenColEditObj edit = (ICFBamTokenColEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFBamTableObj container = (ICFBamTableObj) (getJavaFXContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "JavaFXContainer"); } edit.setRequiredContainerTable(container); ICFBamJavaFXTokenColPaneCommon jpanelCommon = (ICFBamJavaFXTokenColPaneCommon) frame; jpanelCommon.setJavaFXFocus(obj); jpanelCommon.setPaneMode(CFPane.PaneMode.Add); cfFormManager.pushForm(frame); setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); if (javafxContainer instanceof ICFBamTableObj) { list.add(buttonAddTokenCol); } int len = list.size(); CFButton arr[] = new CFButton[len]; Iterator<CFButton> iter = list.iterator(); int idx = 0; while (iter.hasNext()) { arr[idx++] = iter.next(); } Arrays.sort(arr, new CompareCFButtonByText()); for (idx = 0; idx < len; idx++) { vboxMenuAdd.getChildren().add(arr[idx]); } buttonCancelAdd = new CFButton(); buttonCancelAdd.setMinWidth(200); buttonCancelAdd.setText("Cancel Add..."); buttonCancelAdd.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); vboxMenuAdd.getChildren().add(buttonCancelAdd); scrollMenuAdd = new ScrollPane(); scrollMenuAdd.setMinWidth(240); scrollMenuAdd.setMaxWidth(240); scrollMenuAdd.setFitToWidth(true); scrollMenuAdd.setHbarPolicy(ScrollBarPolicy.NEVER); scrollMenuAdd.setVbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenuAdd.setContent(vboxMenuAdd); buttonAdd = new CFButton(); buttonAdd.setMinWidth(200); buttonAdd.setText("Add..."); buttonAdd.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { setLeft(scrollMenuAdd); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonAdd); buttonViewSelected = new CFButton(); buttonViewSelected.setMinWidth(200); buttonViewSelected.setText("View Selected"); buttonViewSelected.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"); } ICFBamTokenDefObj selectedInstance = getJavaFXFocusAsTokenDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("TKND".equals(classCode)) { CFBorderPane frame = javafxSchema.getTokenDefFactory().newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXTokenDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("TKNT".equals(classCode)) { ICFBamTokenTypeObj obj = (ICFBamTokenTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getTokenTypeFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXTokenTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("TKNC".equals(classCode)) { ICFBamTokenColObj obj = (ICFBamTokenColObj) selectedInstance; CFBorderPane frame = javafxSchema.getTokenColFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXTokenColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamTokenDefObj, ICFBamTokenTypeObj, ICFBamTokenColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonViewSelected); buttonEditSelected = new CFButton(); buttonEditSelected.setMinWidth(200); buttonEditSelected.setText("Edit Selected"); buttonEditSelected.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"); } ICFBamTokenDefObj selectedInstance = getJavaFXFocusAsTokenDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("TKND".equals(classCode)) { CFBorderPane frame = javafxSchema.getTokenDefFactory().newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXTokenDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("TKNT".equals(classCode)) { ICFBamTokenTypeObj obj = (ICFBamTokenTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getTokenTypeFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXTokenTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("TKNC".equals(classCode)) { ICFBamTokenColObj obj = (ICFBamTokenColObj) selectedInstance; CFBorderPane frame = javafxSchema.getTokenColFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXTokenColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamTokenDefObj, ICFBamTokenTypeObj, ICFBamTokenColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonEditSelected); buttonDeleteSelected = new CFButton(); buttonDeleteSelected.setMinWidth(200); buttonDeleteSelected.setText("Delete Selected"); buttonDeleteSelected.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"); } ICFBamTokenDefObj selectedInstance = getJavaFXFocusAsTokenDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("TKND".equals(classCode)) { CFBorderPane frame = javafxSchema.getTokenDefFactory() .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback()); ((ICFBamJavaFXTokenDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("TKNT".equals(classCode)) { ICFBamTokenTypeObj obj = (ICFBamTokenTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getTokenTypeFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXTokenTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("TKNC".equals(classCode)) { ICFBamTokenColObj obj = (ICFBamTokenColObj) selectedInstance; CFBorderPane frame = javafxSchema.getTokenColFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXTokenColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamTokenDefObj, ICFBamTokenTypeObj, ICFBamTokenColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonDeleteSelected); } return (hboxMenu); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXInt16TypeListPane.java
public CFHBox getPanelHBoxMenu() { if (hboxMenu == null) { hboxMenu = new CFHBox(10); LinkedList<CFButton> list = new LinkedList<CFButton>(); vboxMenuAdd = new CFVBox(10); buttonAddInt16Type = new CFButton(); buttonAddInt16Type.setMinWidth(200); buttonAddInt16Type.setText("Add Int16Type"); buttonAddInt16Type.setOnAction(new EventHandler<ActionEvent>() { @Override/*from w w w . ja v a 2 s . c o m*/ public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamInt16TypeObj obj = (ICFBamInt16TypeObj) schemaObj.getInt16TypeTableObj() .newInstance(); CFBorderPane frame = javafxSchema.getInt16TypeFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamInt16TypeEditObj edit = (ICFBamInt16TypeEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFBamSchemaDefObj container = (ICFBamSchemaDefObj) (getJavaFXContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "JavaFXContainer"); } edit.setRequiredContainerSchemaDef(container); ICFBamJavaFXInt16TypePaneCommon jpanelCommon = (ICFBamJavaFXInt16TypePaneCommon) frame; jpanelCommon.setJavaFXFocus(obj); jpanelCommon.setPaneMode(CFPane.PaneMode.Add); cfFormManager.pushForm(frame); setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); if (javafxContainer instanceof ICFBamSchemaDefObj) { list.add(buttonAddInt16Type); } buttonAddId16Gen = new CFButton(); buttonAddId16Gen.setMinWidth(200); buttonAddId16Gen.setText("Add Id16Gen"); buttonAddId16Gen.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamId16GenObj obj = (ICFBamId16GenObj) schemaObj.getId16GenTableObj().newInstance(); CFBorderPane frame = javafxSchema.getId16GenFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamId16GenEditObj edit = (ICFBamId16GenEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFBamSchemaDefObj container = (ICFBamSchemaDefObj) (getJavaFXContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "JavaFXContainer"); } edit.setRequiredContainerSchemaDef(container); ICFBamJavaFXId16GenPaneCommon jpanelCommon = (ICFBamJavaFXId16GenPaneCommon) frame; jpanelCommon.setJavaFXFocus(obj); jpanelCommon.setPaneMode(CFPane.PaneMode.Add); cfFormManager.pushForm(frame); setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); if (javafxContainer instanceof ICFBamSchemaDefObj) { list.add(buttonAddId16Gen); } int len = list.size(); CFButton arr[] = new CFButton[len]; Iterator<CFButton> iter = list.iterator(); int idx = 0; while (iter.hasNext()) { arr[idx++] = iter.next(); } Arrays.sort(arr, new CompareCFButtonByText()); for (idx = 0; idx < len; idx++) { vboxMenuAdd.getChildren().add(arr[idx]); } buttonCancelAdd = new CFButton(); buttonCancelAdd.setMinWidth(200); buttonCancelAdd.setText("Cancel Add..."); buttonCancelAdd.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); vboxMenuAdd.getChildren().add(buttonCancelAdd); scrollMenuAdd = new ScrollPane(); scrollMenuAdd.setMinWidth(240); scrollMenuAdd.setMaxWidth(240); scrollMenuAdd.setFitToWidth(true); scrollMenuAdd.setHbarPolicy(ScrollBarPolicy.NEVER); scrollMenuAdd.setVbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenuAdd.setContent(vboxMenuAdd); buttonAdd = new CFButton(); buttonAdd.setMinWidth(200); buttonAdd.setText("Add..."); buttonAdd.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { setLeft(scrollMenuAdd); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonAdd); buttonViewSelected = new CFButton(); buttonViewSelected.setMinWidth(200); buttonViewSelected.setText("View Selected"); buttonViewSelected.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"); } ICFBamInt16TypeObj selectedInstance = getJavaFXFocusAsInt16Type(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("I16T".equals(classCode)) { CFBorderPane frame = javafxSchema.getInt16TypeFactory().newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXInt16TypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("IG16".equals(classCode)) { ICFBamId16GenObj obj = (ICFBamId16GenObj) selectedInstance; CFBorderPane frame = javafxSchema.getId16GenFactory().newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXId16GenPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamInt16TypeObj, ICFBamId16GenObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonViewSelected); buttonEditSelected = new CFButton(); buttonEditSelected.setMinWidth(200); buttonEditSelected.setText("Edit Selected"); buttonEditSelected.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"); } ICFBamInt16TypeObj selectedInstance = getJavaFXFocusAsInt16Type(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("I16T".equals(classCode)) { CFBorderPane frame = javafxSchema.getInt16TypeFactory().newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXInt16TypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("IG16".equals(classCode)) { ICFBamId16GenObj obj = (ICFBamId16GenObj) selectedInstance; CFBorderPane frame = javafxSchema.getId16GenFactory().newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXId16GenPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamInt16TypeObj, ICFBamId16GenObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonEditSelected); buttonDeleteSelected = new CFButton(); buttonDeleteSelected.setMinWidth(200); buttonDeleteSelected.setText("Delete Selected"); buttonDeleteSelected.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"); } ICFBamInt16TypeObj selectedInstance = getJavaFXFocusAsInt16Type(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("I16T".equals(classCode)) { CFBorderPane frame = javafxSchema.getInt16TypeFactory() .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback()); ((ICFBamJavaFXInt16TypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("IG16".equals(classCode)) { ICFBamId16GenObj obj = (ICFBamId16GenObj) selectedInstance; CFBorderPane frame = javafxSchema.getId16GenFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXId16GenPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamInt16TypeObj, ICFBamId16GenObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonDeleteSelected); } return (hboxMenu); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXUInt32DefListPane.java
public CFHBox getPanelHBoxMenu() { if (hboxMenu == null) { hboxMenu = new CFHBox(10); LinkedList<CFButton> list = new LinkedList<CFButton>(); vboxMenuAdd = new CFVBox(10); buttonAddUInt32Type = new CFButton(); buttonAddUInt32Type.setMinWidth(200); buttonAddUInt32Type.setText("Add UInt32Type"); buttonAddUInt32Type.setOnAction(new EventHandler<ActionEvent>() { @Override//from w w w . j a va 2s . c o m public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamUInt32TypeObj obj = (ICFBamUInt32TypeObj) schemaObj.getUInt32TypeTableObj() .newInstance(); CFBorderPane frame = javafxSchema.getUInt32TypeFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamUInt32TypeEditObj edit = (ICFBamUInt32TypeEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFBamSchemaDefObj container = (ICFBamSchemaDefObj) (getJavaFXContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "JavaFXContainer"); } edit.setRequiredContainerSchemaDef(container); ICFBamJavaFXUInt32TypePaneCommon jpanelCommon = (ICFBamJavaFXUInt32TypePaneCommon) frame; jpanelCommon.setJavaFXFocus(obj); jpanelCommon.setPaneMode(CFPane.PaneMode.Add); cfFormManager.pushForm(frame); setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); if (javafxContainer instanceof ICFBamSchemaDefObj) { list.add(buttonAddUInt32Type); } buttonAddUInt32Col = new CFButton(); buttonAddUInt32Col.setMinWidth(200); buttonAddUInt32Col.setText("Add UInt32Col"); buttonAddUInt32Col.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamUInt32ColObj obj = (ICFBamUInt32ColObj) schemaObj.getUInt32ColTableObj() .newInstance(); CFBorderPane frame = javafxSchema.getUInt32ColFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamUInt32ColEditObj edit = (ICFBamUInt32ColEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFBamTableObj container = (ICFBamTableObj) (getJavaFXContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "JavaFXContainer"); } edit.setRequiredContainerTable(container); ICFBamJavaFXUInt32ColPaneCommon jpanelCommon = (ICFBamJavaFXUInt32ColPaneCommon) frame; jpanelCommon.setJavaFXFocus(obj); jpanelCommon.setPaneMode(CFPane.PaneMode.Add); cfFormManager.pushForm(frame); setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); if (javafxContainer instanceof ICFBamTableObj) { list.add(buttonAddUInt32Col); } int len = list.size(); CFButton arr[] = new CFButton[len]; Iterator<CFButton> iter = list.iterator(); int idx = 0; while (iter.hasNext()) { arr[idx++] = iter.next(); } Arrays.sort(arr, new CompareCFButtonByText()); for (idx = 0; idx < len; idx++) { vboxMenuAdd.getChildren().add(arr[idx]); } buttonCancelAdd = new CFButton(); buttonCancelAdd.setMinWidth(200); buttonCancelAdd.setText("Cancel Add..."); buttonCancelAdd.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); vboxMenuAdd.getChildren().add(buttonCancelAdd); scrollMenuAdd = new ScrollPane(); scrollMenuAdd.setMinWidth(240); scrollMenuAdd.setMaxWidth(240); scrollMenuAdd.setFitToWidth(true); scrollMenuAdd.setHbarPolicy(ScrollBarPolicy.NEVER); scrollMenuAdd.setVbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenuAdd.setContent(vboxMenuAdd); buttonAdd = new CFButton(); buttonAdd.setMinWidth(200); buttonAdd.setText("Add..."); buttonAdd.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { setLeft(scrollMenuAdd); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonAdd); buttonViewSelected = new CFButton(); buttonViewSelected.setMinWidth(200); buttonViewSelected.setText("View Selected"); buttonViewSelected.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"); } ICFBamUInt32DefObj selectedInstance = getJavaFXFocusAsUInt32Def(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("U32D".equals(classCode)) { CFBorderPane frame = javafxSchema.getUInt32DefFactory().newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXUInt32DefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("U32T".equals(classCode)) { ICFBamUInt32TypeObj obj = (ICFBamUInt32TypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getUInt32TypeFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXUInt32TypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("U32C".equals(classCode)) { ICFBamUInt32ColObj obj = (ICFBamUInt32ColObj) selectedInstance; CFBorderPane frame = javafxSchema.getUInt32ColFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXUInt32ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamUInt32DefObj, ICFBamUInt32TypeObj, ICFBamUInt32ColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonViewSelected); buttonEditSelected = new CFButton(); buttonEditSelected.setMinWidth(200); buttonEditSelected.setText("Edit Selected"); buttonEditSelected.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"); } ICFBamUInt32DefObj selectedInstance = getJavaFXFocusAsUInt32Def(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("U32D".equals(classCode)) { CFBorderPane frame = javafxSchema.getUInt32DefFactory().newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXUInt32DefPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("U32T".equals(classCode)) { ICFBamUInt32TypeObj obj = (ICFBamUInt32TypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getUInt32TypeFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXUInt32TypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("U32C".equals(classCode)) { ICFBamUInt32ColObj obj = (ICFBamUInt32ColObj) selectedInstance; CFBorderPane frame = javafxSchema.getUInt32ColFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXUInt32ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamUInt32DefObj, ICFBamUInt32TypeObj, ICFBamUInt32ColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonEditSelected); buttonDeleteSelected = new CFButton(); buttonDeleteSelected.setMinWidth(200); buttonDeleteSelected.setText("Delete Selected"); buttonDeleteSelected.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"); } ICFBamUInt32DefObj selectedInstance = getJavaFXFocusAsUInt32Def(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("U32D".equals(classCode)) { CFBorderPane frame = javafxSchema.getUInt32DefFactory() .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback()); ((ICFBamJavaFXUInt32DefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("U32T".equals(classCode)) { ICFBamUInt32TypeObj obj = (ICFBamUInt32TypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getUInt32TypeFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXUInt32TypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("U32C".equals(classCode)) { ICFBamUInt32ColObj obj = (ICFBamUInt32ColObj) selectedInstance; CFBorderPane frame = javafxSchema.getUInt32ColFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXUInt32ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamUInt32DefObj, ICFBamUInt32TypeObj, ICFBamUInt32ColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonDeleteSelected); } return (hboxMenu); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXDoubleDefListPane.java
public CFHBox getPanelHBoxMenu() { if (hboxMenu == null) { hboxMenu = new CFHBox(10); LinkedList<CFButton> list = new LinkedList<CFButton>(); vboxMenuAdd = new CFVBox(10); buttonAddDoubleType = new CFButton(); buttonAddDoubleType.setMinWidth(200); buttonAddDoubleType.setText("Add DoubleType"); buttonAddDoubleType.setOnAction(new EventHandler<ActionEvent>() { @Override/*from w w w. ja v a 2s . c o m*/ public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamDoubleTypeObj obj = (ICFBamDoubleTypeObj) schemaObj.getDoubleTypeTableObj() .newInstance(); CFBorderPane frame = javafxSchema.getDoubleTypeFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamDoubleTypeEditObj edit = (ICFBamDoubleTypeEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFBamSchemaDefObj container = (ICFBamSchemaDefObj) (getJavaFXContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "JavaFXContainer"); } edit.setRequiredContainerSchemaDef(container); ICFBamJavaFXDoubleTypePaneCommon jpanelCommon = (ICFBamJavaFXDoubleTypePaneCommon) frame; jpanelCommon.setJavaFXFocus(obj); jpanelCommon.setPaneMode(CFPane.PaneMode.Add); cfFormManager.pushForm(frame); setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); if (javafxContainer instanceof ICFBamSchemaDefObj) { list.add(buttonAddDoubleType); } buttonAddDoubleCol = new CFButton(); buttonAddDoubleCol.setMinWidth(200); buttonAddDoubleCol.setText("Add DoubleCol"); buttonAddDoubleCol.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamDoubleColObj obj = (ICFBamDoubleColObj) schemaObj.getDoubleColTableObj() .newInstance(); CFBorderPane frame = javafxSchema.getDoubleColFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamDoubleColEditObj edit = (ICFBamDoubleColEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFBamTableObj container = (ICFBamTableObj) (getJavaFXContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "JavaFXContainer"); } edit.setRequiredContainerTable(container); ICFBamJavaFXDoubleColPaneCommon jpanelCommon = (ICFBamJavaFXDoubleColPaneCommon) frame; jpanelCommon.setJavaFXFocus(obj); jpanelCommon.setPaneMode(CFPane.PaneMode.Add); cfFormManager.pushForm(frame); setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); if (javafxContainer instanceof ICFBamTableObj) { list.add(buttonAddDoubleCol); } int len = list.size(); CFButton arr[] = new CFButton[len]; Iterator<CFButton> iter = list.iterator(); int idx = 0; while (iter.hasNext()) { arr[idx++] = iter.next(); } Arrays.sort(arr, new CompareCFButtonByText()); for (idx = 0; idx < len; idx++) { vboxMenuAdd.getChildren().add(arr[idx]); } buttonCancelAdd = new CFButton(); buttonCancelAdd.setMinWidth(200); buttonCancelAdd.setText("Cancel Add..."); buttonCancelAdd.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { setLeft(null); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); vboxMenuAdd.getChildren().add(buttonCancelAdd); scrollMenuAdd = new ScrollPane(); scrollMenuAdd.setMinWidth(240); scrollMenuAdd.setMaxWidth(240); scrollMenuAdd.setFitToWidth(true); scrollMenuAdd.setHbarPolicy(ScrollBarPolicy.NEVER); scrollMenuAdd.setVbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenuAdd.setContent(vboxMenuAdd); buttonAdd = new CFButton(); buttonAdd.setMinWidth(200); buttonAdd.setText("Add..."); buttonAdd.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { setLeft(scrollMenuAdd); adjustListButtons(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonAdd); buttonViewSelected = new CFButton(); buttonViewSelected.setMinWidth(200); buttonViewSelected.setText("View Selected"); buttonViewSelected.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"); } ICFBamDoubleDefObj selectedInstance = getJavaFXFocusAsDoubleDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("DBLD".equals(classCode)) { CFBorderPane frame = javafxSchema.getDoubleDefFactory().newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXDoubleDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("DBLT".equals(classCode)) { ICFBamDoubleTypeObj obj = (ICFBamDoubleTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getDoubleTypeFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXDoubleTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("DBLC".equals(classCode)) { ICFBamDoubleColObj obj = (ICFBamDoubleColObj) selectedInstance; CFBorderPane frame = javafxSchema.getDoubleColFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXDoubleColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamDoubleDefObj, ICFBamDoubleTypeObj, ICFBamDoubleColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonViewSelected); buttonEditSelected = new CFButton(); buttonEditSelected.setMinWidth(200); buttonEditSelected.setText("Edit Selected"); buttonEditSelected.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"); } ICFBamDoubleDefObj selectedInstance = getJavaFXFocusAsDoubleDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("DBLD".equals(classCode)) { CFBorderPane frame = javafxSchema.getDoubleDefFactory().newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXDoubleDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("DBLT".equals(classCode)) { ICFBamDoubleTypeObj obj = (ICFBamDoubleTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getDoubleTypeFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXDoubleTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("DBLC".equals(classCode)) { ICFBamDoubleColObj obj = (ICFBamDoubleColObj) selectedInstance; CFBorderPane frame = javafxSchema.getDoubleColFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXDoubleColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamDoubleDefObj, ICFBamDoubleTypeObj, ICFBamDoubleColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonEditSelected); buttonDeleteSelected = new CFButton(); buttonDeleteSelected.setMinWidth(200); buttonDeleteSelected.setText("Delete Selected"); buttonDeleteSelected.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"); } ICFBamDoubleDefObj selectedInstance = getJavaFXFocusAsDoubleDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("DBLD".equals(classCode)) { CFBorderPane frame = javafxSchema.getDoubleDefFactory() .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback()); ((ICFBamJavaFXDoubleDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("DBLT".equals(classCode)) { ICFBamDoubleTypeObj obj = (ICFBamDoubleTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getDoubleTypeFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXDoubleTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("DBLC".equals(classCode)) { ICFBamDoubleColObj obj = (ICFBamDoubleColObj) selectedInstance; CFBorderPane frame = javafxSchema.getDoubleColFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXDoubleColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamDoubleDefObj, ICFBamDoubleTypeObj, ICFBamDoubleColObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonDeleteSelected); } return (hboxMenu); }