List of usage examples for javafx.event EventHandler EventHandler
EventHandler
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTZTimestampTypeListPane.java
public CFHBox getPanelHBoxMenu() { if (hboxMenu == null) { hboxMenu = new CFHBox(10); buttonAddTZTimestampType = new CFButton(); buttonAddTZTimestampType.setMinWidth(200); buttonAddTZTimestampType.setText("Add TZTimestampType"); buttonAddTZTimestampType.setOnAction(new EventHandler<ActionEvent>() { @Override//from w w w. j a va 2 s .c om public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamTZTimestampTypeObj obj = (ICFBamTZTimestampTypeObj) schemaObj .getTZTimestampTypeTableObj().newInstance(); ICFBamTZTimestampTypeEditObj edit = (ICFBamTZTimestampTypeEditObj) (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); CFBorderPane frame = javafxSchema.getTZTimestampTypeFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamJavaFXTZTimestampTypePaneCommon jpanelCommon = (ICFBamJavaFXTZTimestampTypePaneCommon) frame; jpanelCommon.setJavaFXFocus(obj); jpanelCommon.setPaneMode(CFPane.PaneMode.Add); cfFormManager.pushForm(frame); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonAddTZTimestampType); 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"); } ICFBamTZTimestampTypeObj selectedInstance = getJavaFXFocusAsTZTimestampType(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("ZSTT".equals(classCode)) { CFBorderPane frame = javafxSchema.getTZTimestampTypeFactory().newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXTZTimestampTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamTZTimestampTypeObj"); } } } 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"); } ICFBamTZTimestampTypeObj selectedInstance = getJavaFXFocusAsTZTimestampType(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("ZSTT".equals(classCode)) { CFBorderPane frame = javafxSchema.getTZTimestampTypeFactory().newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXTZTimestampTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamTZTimestampTypeObj"); } } } 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"); } ICFBamTZTimestampTypeObj selectedInstance = getJavaFXFocusAsTZTimestampType(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("ZSTT".equals(classCode)) { CFBorderPane frame = javafxSchema.getTZTimestampTypeFactory() .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback()); ((ICFBamJavaFXTZTimestampTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamTZTimestampTypeObj"); } } } 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// w ww.j av 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/* w ww. ja v a 2 s .c om*/ 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.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/* w ww . j a v a2 s .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.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/*w w w . j av a 2 s . co 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.CFBamJavaFXInt32DefListPane.java
public CFHBox getPanelHBoxMenu() { if (hboxMenu == null) { hboxMenu = new CFHBox(10); LinkedList<CFButton> list = new LinkedList<CFButton>(); vboxMenuAdd = new CFVBox(10); buttonAddInt32Type = new CFButton(); buttonAddInt32Type.setMinWidth(200); buttonAddInt32Type.setText("Add Int32Type"); buttonAddInt32Type.setOnAction(new EventHandler<ActionEvent>() { @Override/*from w w w . j a v a2s .c o m*/ public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamInt32TypeObj obj = (ICFBamInt32TypeObj) schemaObj.getInt32TypeTableObj() .newInstance(); CFBorderPane frame = javafxSchema.getInt32TypeFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamInt32TypeEditObj edit = (ICFBamInt32TypeEditObj) (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); ICFBamJavaFXInt32TypePaneCommon jpanelCommon = (ICFBamJavaFXInt32TypePaneCommon) 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(buttonAddInt32Type); } buttonAddId32Gen = new CFButton(); buttonAddId32Gen.setMinWidth(200); buttonAddId32Gen.setText("Add Id32Gen"); buttonAddId32Gen.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamId32GenObj obj = (ICFBamId32GenObj) schemaObj.getId32GenTableObj().newInstance(); CFBorderPane frame = javafxSchema.getId32GenFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamId32GenEditObj edit = (ICFBamId32GenEditObj) (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); ICFBamJavaFXId32GenPaneCommon jpanelCommon = (ICFBamJavaFXId32GenPaneCommon) 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(buttonAddId32Gen); } buttonAddInt32Col = new CFButton(); buttonAddInt32Col.setMinWidth(200); buttonAddInt32Col.setText("Add Int32Col"); buttonAddInt32Col.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamInt32ColObj obj = (ICFBamInt32ColObj) schemaObj.getInt32ColTableObj().newInstance(); CFBorderPane frame = javafxSchema.getInt32ColFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamInt32ColEditObj edit = (ICFBamInt32ColEditObj) (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); ICFBamJavaFXInt32ColPaneCommon jpanelCommon = (ICFBamJavaFXInt32ColPaneCommon) 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(buttonAddInt32Col); } 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"); } ICFBamInt32DefObj selectedInstance = getJavaFXFocusAsInt32Def(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("I32D".equals(classCode)) { CFBorderPane frame = javafxSchema.getInt32DefFactory().newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXInt32DefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("I32T".equals(classCode)) { ICFBamInt32TypeObj obj = (ICFBamInt32TypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getInt32TypeFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXInt32TypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("IG32".equals(classCode)) { ICFBamId32GenObj obj = (ICFBamId32GenObj) selectedInstance; CFBorderPane frame = javafxSchema.getId32GenFactory().newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXId32GenPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("I32C".equals(classCode)) { ICFBamInt32ColObj obj = (ICFBamInt32ColObj) selectedInstance; CFBorderPane frame = javafxSchema.getInt32ColFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXInt32ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamInt32DefObj, ICFBamInt32TypeObj, ICFBamId32GenObj, ICFBamInt32ColObj"); } } } 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"); } ICFBamInt32DefObj selectedInstance = getJavaFXFocusAsInt32Def(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("I32D".equals(classCode)) { CFBorderPane frame = javafxSchema.getInt32DefFactory().newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXInt32DefPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("I32T".equals(classCode)) { ICFBamInt32TypeObj obj = (ICFBamInt32TypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getInt32TypeFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXInt32TypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("IG32".equals(classCode)) { ICFBamId32GenObj obj = (ICFBamId32GenObj) selectedInstance; CFBorderPane frame = javafxSchema.getId32GenFactory().newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXId32GenPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("I32C".equals(classCode)) { ICFBamInt32ColObj obj = (ICFBamInt32ColObj) selectedInstance; CFBorderPane frame = javafxSchema.getInt32ColFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXInt32ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamInt32DefObj, ICFBamInt32TypeObj, ICFBamId32GenObj, ICFBamInt32ColObj"); } } } 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"); } ICFBamInt32DefObj selectedInstance = getJavaFXFocusAsInt32Def(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("I32D".equals(classCode)) { CFBorderPane frame = javafxSchema.getInt32DefFactory() .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback()); ((ICFBamJavaFXInt32DefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("I32T".equals(classCode)) { ICFBamInt32TypeObj obj = (ICFBamInt32TypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getInt32TypeFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXInt32TypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("IG32".equals(classCode)) { ICFBamId32GenObj obj = (ICFBamId32GenObj) selectedInstance; CFBorderPane frame = javafxSchema.getId32GenFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXId32GenPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("I32C".equals(classCode)) { ICFBamInt32ColObj obj = (ICFBamInt32ColObj) selectedInstance; CFBorderPane frame = javafxSchema.getInt32ColFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXInt32ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamInt32DefObj, ICFBamInt32TypeObj, ICFBamId32GenObj, ICFBamInt32ColObj"); } } } 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.CFBamJavaFXInt16DefListPane.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 ww . j av a 2 s . c om*/ 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); } buttonAddEnumType = new CFButton(); buttonAddEnumType.setMinWidth(200); buttonAddEnumType.setText("Add EnumType"); buttonAddEnumType.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamEnumTypeObj obj = (ICFBamEnumTypeObj) schemaObj.getEnumTypeTableObj().newInstance(); CFBorderPane frame = javafxSchema.getEnumTypeFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamEnumTypeEditObj edit = (ICFBamEnumTypeEditObj) (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); ICFBamJavaFXEnumTypePaneCommon jpanelCommon = (ICFBamJavaFXEnumTypePaneCommon) 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(buttonAddEnumType); } buttonAddInt16Col = new CFButton(); buttonAddInt16Col.setMinWidth(200); buttonAddInt16Col.setText("Add Int16Col"); buttonAddInt16Col.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamInt16ColObj obj = (ICFBamInt16ColObj) schemaObj.getInt16ColTableObj().newInstance(); CFBorderPane frame = javafxSchema.getInt16ColFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamInt16ColEditObj edit = (ICFBamInt16ColEditObj) (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); ICFBamJavaFXInt16ColPaneCommon jpanelCommon = (ICFBamJavaFXInt16ColPaneCommon) 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(buttonAddInt16Col); } 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"); } ICFBamInt16DefObj selectedInstance = getJavaFXFocusAsInt16Def(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("I16D".equals(classCode)) { CFBorderPane frame = javafxSchema.getInt16DefFactory().newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXInt16DefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("I16T".equals(classCode)) { ICFBamInt16TypeObj obj = (ICFBamInt16TypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getInt16TypeFactory() .newViewEditForm(cfFormManager, obj, 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 if ("ENMD".equals(classCode)) { ICFBamEnumDefObj obj = (ICFBamEnumDefObj) selectedInstance; CFBorderPane frame = javafxSchema.getEnumDefFactory().newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXEnumDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("ENMT".equals(classCode)) { ICFBamEnumTypeObj obj = (ICFBamEnumTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getEnumTypeFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXEnumTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("I16C".equals(classCode)) { ICFBamInt16ColObj obj = (ICFBamInt16ColObj) selectedInstance; CFBorderPane frame = javafxSchema.getInt16ColFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXInt16ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamInt16DefObj, ICFBamInt16TypeObj, ICFBamId16GenObj, ICFBamEnumDefObj, ICFBamEnumTypeObj, ICFBamInt16ColObj"); } } } 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"); } ICFBamInt16DefObj selectedInstance = getJavaFXFocusAsInt16Def(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("I16D".equals(classCode)) { CFBorderPane frame = javafxSchema.getInt16DefFactory().newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXInt16DefPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("I16T".equals(classCode)) { ICFBamInt16TypeObj obj = (ICFBamInt16TypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getInt16TypeFactory() .newViewEditForm(cfFormManager, obj, 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.View); cfFormManager.pushForm(frame); } else if ("ENMD".equals(classCode)) { ICFBamEnumDefObj obj = (ICFBamEnumDefObj) selectedInstance; CFBorderPane frame = javafxSchema.getEnumDefFactory().newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXEnumDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("ENMT".equals(classCode)) { ICFBamEnumTypeObj obj = (ICFBamEnumTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getEnumTypeFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXEnumTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("I16C".equals(classCode)) { ICFBamInt16ColObj obj = (ICFBamInt16ColObj) selectedInstance; CFBorderPane frame = javafxSchema.getInt16ColFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXInt16ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamInt16DefObj, ICFBamInt16TypeObj, ICFBamId16GenObj, ICFBamEnumDefObj, ICFBamEnumTypeObj, ICFBamInt16ColObj"); } } } 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"); } ICFBamInt16DefObj selectedInstance = getJavaFXFocusAsInt16Def(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("I16D".equals(classCode)) { CFBorderPane frame = javafxSchema.getInt16DefFactory() .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback()); ((ICFBamJavaFXInt16DefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("I16T".equals(classCode)) { ICFBamInt16TypeObj obj = (ICFBamInt16TypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getInt16TypeFactory() .newAskDeleteForm(cfFormManager, obj, 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 if ("ENMD".equals(classCode)) { ICFBamEnumDefObj obj = (ICFBamEnumDefObj) selectedInstance; CFBorderPane frame = javafxSchema.getEnumDefFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXEnumDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("ENMT".equals(classCode)) { ICFBamEnumTypeObj obj = (ICFBamEnumTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getEnumTypeFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXEnumTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("I16C".equals(classCode)) { ICFBamInt16ColObj obj = (ICFBamInt16ColObj) selectedInstance; CFBorderPane frame = javafxSchema.getInt16ColFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXInt16ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamInt16DefObj, ICFBamInt16TypeObj, ICFBamId16GenObj, ICFBamEnumDefObj, ICFBamEnumTypeObj, ICFBamInt16ColObj"); } } } 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/*w ww . j a va 2 s . 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); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXStringDefListPane.java
public CFHBox getPanelHBoxMenu() { if (hboxMenu == null) { hboxMenu = new CFHBox(10); LinkedList<CFButton> list = new LinkedList<CFButton>(); vboxMenuAdd = new CFVBox(10); buttonAddStringType = new CFButton(); buttonAddStringType.setMinWidth(200); buttonAddStringType.setText("Add StringType"); buttonAddStringType.setOnAction(new EventHandler<ActionEvent>() { @Override//from w w w . j a v a2s. c o m public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamStringTypeObj obj = (ICFBamStringTypeObj) schemaObj.getStringTypeTableObj() .newInstance(); CFBorderPane frame = javafxSchema.getStringTypeFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamStringTypeEditObj edit = (ICFBamStringTypeEditObj) (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); ICFBamJavaFXStringTypePaneCommon jpanelCommon = (ICFBamJavaFXStringTypePaneCommon) 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(buttonAddStringType); } buttonAddStringCol = new CFButton(); buttonAddStringCol.setMinWidth(200); buttonAddStringCol.setText("Add StringCol"); buttonAddStringCol.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamStringColObj obj = (ICFBamStringColObj) schemaObj.getStringColTableObj() .newInstance(); CFBorderPane frame = javafxSchema.getStringColFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamStringColEditObj edit = (ICFBamStringColEditObj) (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); ICFBamJavaFXStringColPaneCommon jpanelCommon = (ICFBamJavaFXStringColPaneCommon) 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(buttonAddStringCol); } 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"); } ICFBamStringDefObj selectedInstance = getJavaFXFocusAsStringDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("STRD".equals(classCode)) { CFBorderPane frame = javafxSchema.getStringDefFactory().newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXStringDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("STRT".equals(classCode)) { ICFBamStringTypeObj obj = (ICFBamStringTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getStringTypeFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXStringTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("STRC".equals(classCode)) { ICFBamStringColObj obj = (ICFBamStringColObj) selectedInstance; CFBorderPane frame = javafxSchema.getStringColFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXStringColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamStringDefObj, ICFBamStringTypeObj, ICFBamStringColObj"); } } } 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"); } ICFBamStringDefObj selectedInstance = getJavaFXFocusAsStringDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("STRD".equals(classCode)) { CFBorderPane frame = javafxSchema.getStringDefFactory().newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXStringDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("STRT".equals(classCode)) { ICFBamStringTypeObj obj = (ICFBamStringTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getStringTypeFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXStringTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("STRC".equals(classCode)) { ICFBamStringColObj obj = (ICFBamStringColObj) selectedInstance; CFBorderPane frame = javafxSchema.getStringColFactory() .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXStringColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamStringDefObj, ICFBamStringTypeObj, ICFBamStringColObj"); } } } 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"); } ICFBamStringDefObj selectedInstance = getJavaFXFocusAsStringDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("STRD".equals(classCode)) { CFBorderPane frame = javafxSchema.getStringDefFactory() .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback()); ((ICFBamJavaFXStringDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("STRT".equals(classCode)) { ICFBamStringTypeObj obj = (ICFBamStringTypeObj) selectedInstance; CFBorderPane frame = javafxSchema.getStringTypeFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXStringTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("STRC".equals(classCode)) { ICFBamStringColObj obj = (ICFBamStringColObj) selectedInstance; CFBorderPane frame = javafxSchema.getStringColFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXStringColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamStringDefObj, ICFBamStringTypeObj, ICFBamStringColObj"); } } } 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.CFBamJavaFXInt32TypeListPane.java
public CFHBox getPanelHBoxMenu() { if (hboxMenu == null) { hboxMenu = new CFHBox(10); LinkedList<CFButton> list = new LinkedList<CFButton>(); vboxMenuAdd = new CFVBox(10); buttonAddInt32Type = new CFButton(); buttonAddInt32Type.setMinWidth(200); buttonAddInt32Type.setText("Add Int32Type"); buttonAddInt32Type.setOnAction(new EventHandler<ActionEvent>() { @Override// w ww . ja v a 2s. co m public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamInt32TypeObj obj = (ICFBamInt32TypeObj) schemaObj.getInt32TypeTableObj() .newInstance(); CFBorderPane frame = javafxSchema.getInt32TypeFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamInt32TypeEditObj edit = (ICFBamInt32TypeEditObj) (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); ICFBamJavaFXInt32TypePaneCommon jpanelCommon = (ICFBamJavaFXInt32TypePaneCommon) 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(buttonAddInt32Type); } buttonAddId32Gen = new CFButton(); buttonAddId32Gen.setMinWidth(200); buttonAddId32Gen.setText("Add Id32Gen"); buttonAddId32Gen.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamId32GenObj obj = (ICFBamId32GenObj) schemaObj.getId32GenTableObj().newInstance(); CFBorderPane frame = javafxSchema.getId32GenFactory().newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamId32GenEditObj edit = (ICFBamId32GenEditObj) (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); ICFBamJavaFXId32GenPaneCommon jpanelCommon = (ICFBamJavaFXId32GenPaneCommon) 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(buttonAddId32Gen); } 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"); } ICFBamInt32TypeObj selectedInstance = getJavaFXFocusAsInt32Type(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("I32T".equals(classCode)) { CFBorderPane frame = javafxSchema.getInt32TypeFactory().newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXInt32TypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("IG32".equals(classCode)) { ICFBamId32GenObj obj = (ICFBamId32GenObj) selectedInstance; CFBorderPane frame = javafxSchema.getId32GenFactory().newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXId32GenPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamInt32TypeObj, ICFBamId32GenObj"); } } } 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"); } ICFBamInt32TypeObj selectedInstance = getJavaFXFocusAsInt32Type(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("I32T".equals(classCode)) { CFBorderPane frame = javafxSchema.getInt32TypeFactory().newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXInt32TypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else if ("IG32".equals(classCode)) { ICFBamId32GenObj obj = (ICFBamId32GenObj) selectedInstance; CFBorderPane frame = javafxSchema.getId32GenFactory().newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false); ((ICFBamJavaFXId32GenPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamInt32TypeObj, ICFBamId32GenObj"); } } } 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"); } ICFBamInt32TypeObj selectedInstance = getJavaFXFocusAsInt32Type(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("I32T".equals(classCode)) { CFBorderPane frame = javafxSchema.getInt32TypeFactory() .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback()); ((ICFBamJavaFXInt32TypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else if ("IG32".equals(classCode)) { ICFBamId32GenObj obj = (ICFBamId32GenObj) selectedInstance; CFBorderPane frame = javafxSchema.getId32GenFactory() .newAskDeleteForm(cfFormManager, obj, getDeleteCallback()); ((ICFBamJavaFXId32GenPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamInt32TypeObj, ICFBamId32GenObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonDeleteSelected); } return (hboxMenu); }