protected void setContext(
      FormLoader loader,
      Form form,
      ims.framework.interfaces.IAppForm appForm,
      UIFactory factory,
      ims.framework.Context context,
      Boolean skipContextValidation,
      Integer startControlID,
      ims.framework.utils.SizeInfo runtimeSize,
      ims.framework.Control control,
      Integer startTabIndex)
      throws Exception {
    if (loader == null) ; // this is to avoid eclipse warning only.
    if (factory == null) ; // this is to avoid eclipse warning only.
    if (runtimeSize == null) ; // this is to avoid eclipse warning only.
    if (appForm == null) throw new RuntimeException("Invalid application form");
    if (startControlID == null) throw new RuntimeException("Invalid startControlID");
    if (control == null) ; // this is to avoid eclipse warning only.
    if (startTabIndex == null) throw new RuntimeException("Invalid startTabIndex");
    this.context = context;
    this.componentIdentifier = startControlID.toString();
    this.formInfo = form.getFormInfo();
    this.globalContext = new GlobalContext(context);

    if (skipContextValidation == null || !skipContextValidation.booleanValue()) {
      validateContext(context);
    }

    super.setContext(form);

    ims.framework.utils.SizeInfo designSize = new ims.framework.utils.SizeInfo(536, 440);
    if (runtimeSize == null) runtimeSize = designSize;
    form.setWidth(runtimeSize.getWidth());
    form.setHeight(runtimeSize.getHeight());
    super.setGlobalContext(
        ContextBridgeFlyweightFactory.getInstance()
            .create(GlobalContextBridge.class, context, false));

    // Button Controls
    RuntimeAnchoring anchoringHelper1 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            362,
            400,
            75,
            23,
            ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT);
    super.addControl(
        factory.getControl(
            Button.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1000),
              new Integer(anchoringHelper1.getX()),
              new Integer(anchoringHelper1.getY()),
              new Integer(anchoringHelper1.getWidth()),
              new Integer(anchoringHelper1.getHeight()),
              new Integer(-1),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT,
              "Select",
              Boolean.FALSE,
              null,
              Boolean.FALSE,
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              ims.framework.utils.Color.Default,
              ims.framework.utils.Color.Default
            }));
    RuntimeAnchoring anchoringHelper2 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            442,
            400,
            75,
            23,
            ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT);
    super.addControl(
        factory.getControl(
            Button.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1001),
              new Integer(anchoringHelper2.getX()),
              new Integer(anchoringHelper2.getY()),
              new Integer(anchoringHelper2.getWidth()),
              new Integer(anchoringHelper2.getHeight()),
              new Integer(-1),
              ControlState.HIDDEN,
              ControlState.ENABLED,
              ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT,
              "Cancel",
              Boolean.FALSE,
              null,
              Boolean.FALSE,
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              ims.framework.utils.Color.Default,
              ims.framework.utils.Color.Default
            }));

    // Grid Controls
    RuntimeAnchoring anchoringHelper3 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            16,
            16,
            504,
            368,
            ims.framework.enumerations.ControlAnchoring.TOPLEFT);
    Grid m_grdTemplateTemp =
        (Grid)
            factory.getControl(
                Grid.class,
                new Object[] {
                  control,
                  new Integer(startControlID.intValue() + 1002),
                  new Integer(anchoringHelper3.getX()),
                  new Integer(anchoringHelper3.getY()),
                  new Integer(anchoringHelper3.getWidth()),
                  new Integer(anchoringHelper3.getHeight()),
                  new Integer(startTabIndex.intValue() + 1),
                  ControlState.UNKNOWN,
                  ControlState.UNKNOWN,
                  ims.framework.enumerations.ControlAnchoring.TOPLEFT,
                  Boolean.TRUE,
                  Boolean.FALSE,
                  new Integer(24),
                  Boolean.TRUE,
                  null,
                  Boolean.FALSE,
                  Boolean.FALSE,
                  new Integer(0),
                  null,
                  Boolean.FALSE,
                  Boolean.TRUE
                });
    addControl(m_grdTemplateTemp);
    grdTemplateGrid grdTemplate =
        (grdTemplateGrid)
            GridFlyweightFactory.getInstance()
                .createGridBridge(grdTemplateGrid.class, m_grdTemplateTemp);
    grdTemplate.addStringColumn(
        "Template Name",
        0,
        0,
        -1,
        true,
        false,
        0,
        0,
        true,
        ims.framework.enumerations.CharacterCasing.NORMAL);
    super.addGrid(grdTemplate);
  }
  protected void setContext(
      FormLoader loader,
      Form form,
      ims.framework.interfaces.IAppForm appForm,
      UIFactory factory,
      ims.framework.Context context,
      Boolean skipContextValidation,
      Integer startControlID,
      ims.framework.utils.SizeInfo runtimeSize,
      ims.framework.Control control,
      Integer startTabIndex)
      throws Exception {
    if (loader == null) ; // this is to avoid eclipse warning only.
    if (factory == null) ; // this is to avoid eclipse warning only.
    if (runtimeSize == null) ; // this is to avoid eclipse warning only.
    if (appForm == null) throw new RuntimeException("Invalid application form");
    if (startControlID == null) throw new RuntimeException("Invalid startControlID");
    if (control == null) ; // this is to avoid eclipse warning only.
    if (startTabIndex == null) throw new RuntimeException("Invalid startTabIndex");
    this.context = context;
    this.componentIdentifier = startControlID.toString();
    this.formInfo = form.getFormInfo();
    this.globalContext = new GlobalContext(context);

    if (skipContextValidation == null || !skipContextValidation.booleanValue()) {
      validateContext(context);
    }

    super.setContext(form);

    ims.framework.utils.SizeInfo designSize = new ims.framework.utils.SizeInfo(824, 296);
    if (runtimeSize == null) runtimeSize = designSize;
    form.setWidth(runtimeSize.getWidth());
    form.setHeight(runtimeSize.getHeight());
    super.setGlobalContext(
        ContextBridgeFlyweightFactory.getInstance()
            .create(GlobalContextBridge.class, context, false));
    super.setLocalContext(new LocalContext(context, form.getFormInfo(), componentIdentifier));

    // Panel Controls
    RuntimeAnchoring anchoringHelper3 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            8,
            9,
            808,
            32,
            ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT);
    super.addControl(
        factory.getControl(
            Panel.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1000),
              new Integer(anchoringHelper3.getX()),
              new Integer(anchoringHelper3.getY()),
              new Integer(anchoringHelper3.getWidth()),
              new Integer(anchoringHelper3.getHeight()),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT,
              "Procedures",
              new Integer(1),
              ""
            }));

    // Custom Controls
    ims.framework.CustomComponent instance1 = factory.getEmptyCustomComponent();
    RuntimeAnchoring anchoringHelper4 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            504,
            144,
            312,
            20,
            ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT);
    ims.framework.FormUiLogic m_ccPerformedByForm =
        loader.loadComponent(
            102256,
            appForm,
            startControlID * 10 + 1000,
            anchoringHelper4.getSize(),
            instance1,
            startTabIndex.intValue() + 1006,
            skipContextValidation);
    // ims.framework.Control m_ccPerformedByControl = factory.getControl(CustomComponent.class, new
    // Object[] { control, new Integer(startControlID.intValue() + 1001), new Integer(504), new
    // Integer(144), new Integer(312), new Integer(20), ControlState.DISABLED, ControlState.ENABLED,
    // ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT, new
    // Integer(startTabIndex.intValue() + 1006), m_ccPerformedByForm, instance1 } );
    ims.framework.Control m_ccPerformedByControl =
        factory.getControl(
            CustomComponent.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1002),
              new Integer(anchoringHelper4.getX()),
              new Integer(anchoringHelper4.getY()),
              new Integer(anchoringHelper4.getWidth()),
              new Integer(anchoringHelper4.getHeight()),
              ControlState.DISABLED,
              ControlState.ENABLED,
              ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT,
              new Integer(startTabIndex.intValue() + 1006),
              m_ccPerformedByForm,
              instance1,
              Boolean.FALSE
            });
    super.addControl(m_ccPerformedByControl);
    Menu[] menus1 = m_ccPerformedByForm.getForm().getRegisteredMenus();
    for (int x = 0; x < menus1.length; x++) {
      form.registerMenu(menus1[x]);
    }
    ims.framework.CustomComponent instance2 = factory.getEmptyCustomComponent();
    RuntimeAnchoring anchoringHelper5 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            8,
            72,
            808,
            64,
            ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT);
    ims.framework.FormUiLogic m_ccProcedureForm =
        loader.loadComponent(
            123133,
            appForm,
            startControlID * 10 + 2000,
            anchoringHelper5.getSize(),
            instance2,
            startTabIndex.intValue() + 3,
            skipContextValidation);
    // ims.framework.Control m_ccProcedureControl = factory.getControl(CustomComponent.class, new
    // Object[] { control, new Integer(startControlID.intValue() + 1003), new Integer(8), new
    // Integer(72), new Integer(808), new Integer(64), ControlState.UNKNOWN, ControlState.UNKNOWN,
    // ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT, new
    // Integer(startTabIndex.intValue() + 3), m_ccProcedureForm, instance2 } );
    ims.framework.Control m_ccProcedureControl =
        factory.getControl(
            CustomComponent.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1004),
              new Integer(anchoringHelper5.getX()),
              new Integer(anchoringHelper5.getY()),
              new Integer(anchoringHelper5.getWidth()),
              new Integer(anchoringHelper5.getHeight()),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT,
              new Integer(startTabIndex.intValue() + 3),
              m_ccProcedureForm,
              instance2,
              Boolean.FALSE
            });
    super.addControl(m_ccProcedureControl);
    Menu[] menus2 = m_ccProcedureForm.getForm().getRegisteredMenus();
    for (int x = 0; x < menus2.length; x++) {
      form.registerMenu(menus2[x]);
    }

    // Label Controls
    RuntimeAnchoring anchoringHelper6 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            184,
            146,
            63,
            17,
            ims.framework.enumerations.ControlAnchoring.BOTTOMLEFT);
    super.addControl(
        factory.getControl(
            Label.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1005),
              new Integer(anchoringHelper6.getX()),
              new Integer(anchoringHelper6.getY()),
              new Integer(anchoringHelper6.getWidth()),
              new Integer(anchoringHelper6.getHeight()),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.BOTTOMLEFT,
              "Laterality:",
              new Integer(1),
              null,
              new Integer(0)
            }));
    RuntimeAnchoring anchoringHelper7 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            16,
            168,
            30,
            17,
            ims.framework.enumerations.ControlAnchoring.BOTTOMLEFT);
    super.addControl(
        factory.getControl(
            Label.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1006),
              new Integer(anchoringHelper7.getX()),
              new Integer(anchoringHelper7.getY()),
              new Integer(anchoringHelper7.getWidth()),
              new Integer(anchoringHelper7.getHeight()),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.BOTTOMLEFT,
              "Site:",
              new Integer(1),
              null,
              new Integer(0)
            }));
    RuntimeAnchoring anchoringHelper8 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            408,
            146,
            86,
            17,
            ims.framework.enumerations.ControlAnchoring.BOTTOMLEFT);
    super.addControl(
        factory.getControl(
            Label.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1007),
              new Integer(anchoringHelper8.getX()),
              new Integer(anchoringHelper8.getY()),
              new Integer(anchoringHelper8.getWidth()),
              new Integer(anchoringHelper8.getHeight()),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.BOTTOMLEFT,
              "Performed By:",
              new Integer(1),
              null,
              new Integer(0)
            }));
    RuntimeAnchoring anchoringHelper9 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            16,
            146,
            53,
            17,
            ims.framework.enumerations.ControlAnchoring.TOPLEFT);
    super.addControl(
        factory.getControl(
            Label.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1008),
              new Integer(anchoringHelper9.getX()),
              new Integer(anchoringHelper9.getY()),
              new Integer(anchoringHelper9.getWidth()),
              new Integer(anchoringHelper9.getHeight()),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPLEFT,
              "Primary:",
              new Integer(1),
              null,
              new Integer(0)
            }));
    RuntimeAnchoring anchoringHelper10 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            16,
            49,
            41,
            17,
            ims.framework.enumerations.ControlAnchoring.TOPLEFT);
    super.addControl(
        factory.getControl(
            Label.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1009),
              new Integer(anchoringHelper10.getX()),
              new Integer(anchoringHelper10.getY()),
              new Integer(anchoringHelper10.getWidth()),
              new Integer(anchoringHelper10.getHeight()),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPLEFT,
              "Filter: ",
              new Integer(1),
              null,
              new Integer(0)
            }));
    RuntimeAnchoring anchoringHelper11 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            16,
            146,
            53,
            17,
            ims.framework.enumerations.ControlAnchoring.BOTTOMLEFT);
    super.addControl(
        factory.getControl(
            Label.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1010),
              new Integer(anchoringHelper11.getX()),
              new Integer(anchoringHelper11.getY()),
              new Integer(anchoringHelper11.getWidth()),
              new Integer(anchoringHelper11.getHeight()),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.BOTTOMLEFT,
              "Primary:",
              new Integer(1),
              null,
              new Integer(0)
            }));
    RuntimeAnchoring anchoringHelper12 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            184,
            146,
            63,
            17,
            ims.framework.enumerations.ControlAnchoring.BOTTOMLEFT);
    super.addControl(
        factory.getControl(
            Label.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1011),
              new Integer(anchoringHelper12.getX()),
              new Integer(anchoringHelper12.getY()),
              new Integer(anchoringHelper12.getWidth()),
              new Integer(anchoringHelper12.getHeight()),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.BOTTOMLEFT,
              "Laterality:",
              new Integer(1),
              null,
              new Integer(0)
            }));
    RuntimeAnchoring anchoringHelper13 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            408,
            146,
            86,
            17,
            ims.framework.enumerations.ControlAnchoring.BOTTOMLEFT);
    super.addControl(
        factory.getControl(
            Label.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1012),
              new Integer(anchoringHelper13.getX()),
              new Integer(anchoringHelper13.getY()),
              new Integer(anchoringHelper13.getWidth()),
              new Integer(anchoringHelper13.getHeight()),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.BOTTOMLEFT,
              "Performed By:",
              new Integer(1),
              null,
              new Integer(0)
            }));

    // Button Controls
    RuntimeAnchoring anchoringHelper14 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            648,
            265,
            75,
            23,
            ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT);
    super.addControl(
        factory.getControl(
            Button.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1013),
              new Integer(anchoringHelper14.getX()),
              new Integer(anchoringHelper14.getY()),
              new Integer(anchoringHelper14.getWidth()),
              new Integer(anchoringHelper14.getHeight()),
              new Integer(startTabIndex.intValue() + 2009),
              ControlState.HIDDEN,
              ControlState.ENABLED,
              ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT,
              "Ok",
              Boolean.TRUE,
              null,
              Boolean.FALSE,
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              ims.framework.utils.Color.Default,
              ims.framework.utils.Color.Default
            }));
    RuntimeAnchoring anchoringHelper15 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            725,
            265,
            75,
            23,
            ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT);
    super.addControl(
        factory.getControl(
            Button.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1014),
              new Integer(anchoringHelper15.getX()),
              new Integer(anchoringHelper15.getY()),
              new Integer(anchoringHelper15.getWidth()),
              new Integer(anchoringHelper15.getHeight()),
              new Integer(startTabIndex.intValue() + 2011),
              ControlState.HIDDEN,
              ControlState.ENABLED,
              ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT,
              "Cancel",
              Boolean.FALSE,
              null,
              Boolean.FALSE,
              Boolean.FALSE,
              Boolean.FALSE,
              null,
              ims.framework.utils.Color.Default,
              ims.framework.utils.Color.Default
            }));

    // TextBox Controls
    RuntimeAnchoring anchoringHelper16 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            120,
            176,
            680,
            72,
            ims.framework.enumerations.ControlAnchoring.ALL);
    super.addControl(
        factory.getControl(
            TextBox.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1015),
              new Integer(anchoringHelper16.getX()),
              new Integer(anchoringHelper16.getY()),
              new Integer(anchoringHelper16.getWidth()),
              new Integer(anchoringHelper16.getHeight()),
              new Integer(startTabIndex.intValue() + 2007),
              ControlState.DISABLED,
              ControlState.ENABLED,
              ims.framework.enumerations.ControlAnchoring.ALL,
              Boolean.TRUE,
              new Integer(255),
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              null,
              Boolean.FALSE,
              ims.framework.enumerations.CharacterCasing.NORMAL,
              ims.framework.enumerations.TextTrimming.NONE,
              "",
              ""
            }));

    // ComboBox Controls
    RuntimeAnchoring anchoringHelper17 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            248,
            144,
            128,
            21,
            ims.framework.enumerations.ControlAnchoring.TOPLEFT);
    ComboBox m_cmbLateralityTemp =
        (ComboBox)
            factory.getControl(
                ComboBox.class,
                new Object[] {
                  control,
                  new Integer(startControlID.intValue() + 1016),
                  new Integer(anchoringHelper17.getX()),
                  new Integer(anchoringHelper17.getY()),
                  new Integer(anchoringHelper17.getWidth()),
                  new Integer(anchoringHelper17.getHeight()),
                  new Integer(startTabIndex.intValue() + 1005),
                  ControlState.DISABLED,
                  ControlState.ENABLED,
                  ims.framework.enumerations.ControlAnchoring.TOPLEFT,
                  Boolean.TRUE,
                  Boolean.FALSE,
                  SortOrder.NONE,
                  Boolean.FALSE,
                  new Integer(1),
                  null,
                  Boolean.FALSE,
                  new Integer(-1)
                });
    addControl(m_cmbLateralityTemp);
    cmbLateralityComboBox cmbLaterality =
        (cmbLateralityComboBox)
            ComboBoxFlyweightFactory.getInstance()
                .createComboBoxBridge(cmbLateralityComboBox.class, m_cmbLateralityTemp);
    super.addComboBox(cmbLaterality);

    // CheckBox Controls
    RuntimeAnchoring anchoringHelper18 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            120,
            146,
            16,
            16,
            ims.framework.enumerations.ControlAnchoring.TOPLEFT);
    super.addControl(
        factory.getControl(
            CheckBox.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1017),
              new Integer(anchoringHelper18.getX()),
              new Integer(anchoringHelper18.getY()),
              new Integer(anchoringHelper18.getWidth()),
              new Integer(anchoringHelper18.getHeight()),
              new Integer(startTabIndex.intValue() + 1004),
              ControlState.DISABLED,
              ControlState.ENABLED,
              ims.framework.enumerations.ControlAnchoring.TOPLEFT,
              "",
              Boolean.FALSE,
              null
            }));

    // RadioButton Controls
    RadioButton tmpgrpFilter =
        (RadioButton)
            factory.getControl(
                RadioButton.class,
                new Object[] {
                  control,
                  new Integer(startControlID.intValue() + 1018),
                  new Integer(0),
                  ControlState.DISABLED,
                  ControlState.ENABLED,
                  ims.framework.enumerations.ControlAnchoring.TOPLEFT,
                  Boolean.TRUE
                });
    super.addControl(tmpgrpFilter);
    grpFilterRadioButton grpFilter =
        (grpFilterRadioButton)
            RadioButtonBridgeFlyweightFactory.getInstance()
                .createRadioButtonBridge(grpFilterRadioButton.class, tmpgrpFilter);
    grpFilter.setContext(startTabIndex, designSize, runtimeSize);
    super.addRadioButton(grpFilter);
  }
  protected void setContext(
      FormLoader loader,
      Form form,
      ims.framework.interfaces.IAppForm appForm,
      UIFactory factory,
      ims.framework.Context context,
      Boolean skipContextValidation,
      Integer startControlID,
      ims.framework.utils.SizeInfo runtimeSize,
      ims.framework.Control control,
      Integer startTabIndex)
      throws Exception {
    if (loader == null) ; // this is to avoid eclipse warning only.
    if (factory == null) ; // this is to avoid eclipse warning only.
    if (runtimeSize == null) ; // this is to avoid eclipse warning only.
    if (appForm == null) throw new RuntimeException("Invalid application form");
    if (startControlID == null) throw new RuntimeException("Invalid startControlID");
    if (control == null) ; // this is to avoid eclipse warning only.
    if (startTabIndex == null) throw new RuntimeException("Invalid startTabIndex");
    this.context = context;
    this.componentIdentifier = startControlID.toString();
    this.formInfo = form.getFormInfo();
    this.globalContext = new GlobalContext(context);

    if (skipContextValidation == null || !skipContextValidation.booleanValue()) {
      validateContext(context);
      validateMandatoryContext(context);
    }

    super.setContext(form);

    ims.framework.utils.SizeInfo designSize = new ims.framework.utils.SizeInfo(456, 288);
    if (runtimeSize == null) runtimeSize = designSize;
    form.setWidth(runtimeSize.getWidth());
    form.setHeight(runtimeSize.getHeight());
    super.setGlobalContext(
        ContextBridgeFlyweightFactory.getInstance()
            .create(GlobalContextBridge.class, context, false));

    // Custom Controls
    ims.framework.CustomComponent instance1 = factory.getEmptyCustomComponent();
    RuntimeAnchoring anchoringHelper1 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            0,
            0,
            456,
            256,
            ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT);
    ims.framework.FormUiLogic m_ccErodHistoryForm =
        loader.loadComponent(
            134223,
            appForm,
            startControlID * 10 + 1000,
            anchoringHelper1.getSize(),
            instance1,
            startTabIndex.intValue() + 1,
            skipContextValidation);
    // ims.framework.Control m_ccErodHistoryControl = factory.getControl(CustomComponent.class, new
    // Object[] { control, new Integer(startControlID.intValue() + 1000), new Integer(0), new
    // Integer(0), new Integer(456), new Integer(256), ControlState.UNKNOWN, ControlState.UNKNOWN,
    // ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT, new
    // Integer(startTabIndex.intValue() + 1), m_ccErodHistoryForm, instance1 } );
    ims.framework.Control m_ccErodHistoryControl =
        factory.getControl(
            CustomComponent.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1001),
              new Integer(anchoringHelper1.getX()),
              new Integer(anchoringHelper1.getY()),
              new Integer(anchoringHelper1.getWidth()),
              new Integer(anchoringHelper1.getHeight()),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT,
              new Integer(startTabIndex.intValue() + 1),
              m_ccErodHistoryForm,
              instance1,
              Boolean.FALSE
            });
    super.addControl(m_ccErodHistoryControl);
    Menu[] menus1 = m_ccErodHistoryForm.getForm().getRegisteredMenus();
    for (int x = 0; x < menus1.length; x++) {
      form.registerMenu(menus1[x]);
    }

    // Button Controls
    RuntimeAnchoring anchoringHelper2 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            368,
            256,
            75,
            23,
            ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT);
    super.addControl(
        factory.getControl(
            Button.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1002),
              new Integer(anchoringHelper2.getX()),
              new Integer(anchoringHelper2.getY()),
              new Integer(anchoringHelper2.getWidth()),
              new Integer(anchoringHelper2.getHeight()),
              new Integer(startTabIndex.intValue() + 1002),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT,
              "Close",
              Boolean.FALSE,
              null,
              Boolean.FALSE,
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              ims.framework.utils.Color.Default,
              ims.framework.utils.Color.Default
            }));
  }
  protected void setContext(
      FormLoader loader,
      Form form,
      ims.framework.interfaces.IAppForm appForm,
      UIFactory factory,
      ims.framework.Context context,
      Boolean skipContextValidation,
      Integer startControlID,
      ims.framework.utils.SizeInfo runtimeSize,
      ims.framework.Control control,
      Integer startTabIndex)
      throws Exception {
    if (loader == null) ; // this is to avoid eclipse warning only.
    if (factory == null) ; // this is to avoid eclipse warning only.
    if (runtimeSize == null) ; // this is to avoid eclipse warning only.
    if (appForm == null) throw new RuntimeException("Invalid application form");
    if (startControlID == null) throw new RuntimeException("Invalid startControlID");
    if (control == null) ; // this is to avoid eclipse warning only.
    if (startTabIndex == null) throw new RuntimeException("Invalid startTabIndex");
    this.context = context;
    this.componentIdentifier = startControlID.toString();
    this.formInfo = form.getFormInfo();
    this.globalContext = new GlobalContext(context);

    if (skipContextValidation == null || !skipContextValidation.booleanValue()) {
      validateContext(context);
      validateMandatoryContext(context);
    }

    super.setContext(form);

    ims.framework.utils.SizeInfo designSize = new ims.framework.utils.SizeInfo(800, 512);
    if (runtimeSize == null) runtimeSize = designSize;
    form.setWidth(runtimeSize.getWidth());
    form.setHeight(runtimeSize.getHeight());
    super.setFormReferences(FormReferencesFlyweightFactory.getInstance().create(Forms.class));
    super.setImageReferences(ImageReferencesFlyweightFactory.getInstance().create(Images.class));
    super.setGlobalContext(
        ContextBridgeFlyweightFactory.getInstance()
            .create(GlobalContextBridge.class, context, false));
    super.setLocalContext(new LocalContext(context, form.getFormInfo(), componentIdentifier));

    // Context Menus
    contextMenus = new ContextMenus();
    contextMenus.RefMan.contextMenuPrescription = factory.createMenu(startControlID.intValue() + 1);
    contextMenus.RefMan.contextMenuPrescriptionNewPrescriptionRecordItem =
        factory.createMenuItem(
            startControlID.intValue() + 1,
            "New Prescription record ",
            true,
            false,
            new Integer(102149),
            true,
            false);
    contextMenus.RefMan.contextMenuPrescription.add(
        contextMenus.RefMan.contextMenuPrescriptionNewPrescriptionRecordItem);
    contextMenus.RefMan.contextMenuPrescriptionAddPrescriptionDrugItem =
        factory.createMenuItem(
            startControlID.intValue() + 2,
            "Add prescription drug ",
            true,
            false,
            new Integer(102179),
            true,
            false);
    contextMenus.RefMan.contextMenuPrescription.add(
        contextMenus.RefMan.contextMenuPrescriptionAddPrescriptionDrugItem);
    contextMenus.RefMan.contextMenuPrescriptionEDIT_PRESCRIPTION_DRUGItem =
        factory.createMenuItem(
            startControlID.intValue() + 3,
            "Edit prescription drug",
            true,
            false,
            new Integer(102150),
            true,
            false);
    if (factory
        .getUIEngine()
        .getLoggedInRole()
        .hasMenuActionRight(appForm, new ims.framework.MenuAction(3250003)))
      contextMenus.RefMan.contextMenuPrescription.add(
          contextMenus.RefMan.contextMenuPrescriptionEDIT_PRESCRIPTION_DRUGItem);
    contextMenus.RefMan.contextMenuPrescriptionRemovePrescriptionDrugItem =
        factory.createMenuItem(
            startControlID.intValue() + 4,
            "Remove prescription drug",
            true,
            false,
            new Integer(102300),
            true,
            false);
    if (factory
        .getUIEngine()
        .getLoggedInRole()
        .hasMenuActionRight(appForm, new ims.framework.MenuAction(3250001)))
      contextMenus.RefMan.contextMenuPrescription.add(
          contextMenus.RefMan.contextMenuPrescriptionRemovePrescriptionDrugItem);
    contextMenus.RefMan.contextMenuPrescriptionRIE_PRESCRIPTION_DRUGItem =
        factory.createMenuItem(
            startControlID.intValue() + 5,
            "RIE prescription drug",
            true,
            false,
            new Integer(102142),
            true,
            false);
    if (factory
        .getUIEngine()
        .getLoggedInRole()
        .hasMenuActionRight(appForm, new ims.framework.MenuAction(3250004)))
      contextMenus.RefMan.contextMenuPrescription.add(
          contextMenus.RefMan.contextMenuPrescriptionRIE_PRESCRIPTION_DRUGItem);
    contextMenus.RefMan.contextMenuPrescriptionRIEItem =
        factory.createMenuItem(
            startControlID.intValue() + 6, "RIE", true, false, new Integer(102142), true, false);
    if (factory
        .getUIEngine()
        .getLoggedInRole()
        .hasMenuActionRight(appForm, new ims.framework.MenuAction(3250002)))
      contextMenus.RefMan.contextMenuPrescription.add(
          contextMenus.RefMan.contextMenuPrescriptionRIEItem);
    form.registerMenu(contextMenus.RefMan.contextMenuPrescription);

    // Button Controls
    RuntimeAnchoring anchoringHelper1 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            640,
            488,
            75,
            23,
            ims.framework.enumerations.ControlAnchoring.TOPRIGHT);
    super.addControl(
        factory.getControl(
            Button.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1000),
              new Integer(anchoringHelper1.getX()),
              new Integer(anchoringHelper1.getY()),
              new Integer(anchoringHelper1.getWidth()),
              new Integer(anchoringHelper1.getHeight()),
              new Integer(-1),
              ControlState.HIDDEN,
              ControlState.ENABLED,
              ims.framework.enumerations.ControlAnchoring.TOPRIGHT,
              "Save",
              Boolean.FALSE,
              null,
              Boolean.FALSE,
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              ims.framework.utils.Color.Default,
              ims.framework.utils.Color.Default
            }));
    RuntimeAnchoring anchoringHelper2 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            717,
            488,
            75,
            23,
            ims.framework.enumerations.ControlAnchoring.TOPRIGHT);
    super.addControl(
        factory.getControl(
            Button.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1001),
              new Integer(anchoringHelper2.getX()),
              new Integer(anchoringHelper2.getY()),
              new Integer(anchoringHelper2.getWidth()),
              new Integer(anchoringHelper2.getHeight()),
              new Integer(-1),
              ControlState.HIDDEN,
              ControlState.ENABLED,
              ims.framework.enumerations.ControlAnchoring.TOPRIGHT,
              "Cancel",
              Boolean.FALSE,
              null,
              Boolean.FALSE,
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              ims.framework.utils.Color.Default,
              ims.framework.utils.Color.Default
            }));

    // Dynamic Grid Controls
    RuntimeAnchoring anchoringHelper3 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            8,
            8,
            784,
            472,
            ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT);
    super.addControl(
        factory.getControl(
            DynamicGrid.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1002),
              new Integer(anchoringHelper3.getX()),
              new Integer(anchoringHelper3.getY()),
              new Integer(anchoringHelper3.getWidth()),
              new Integer(anchoringHelper3.getHeight()),
              new Integer(-1),
              ControlState.READONLY,
              ControlState.EDITABLE,
              ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT,
              contextMenus.RefMan.contextMenuPrescription,
              Boolean.FALSE,
              Boolean.FALSE,
              Boolean.TRUE
            }));
  }
  protected void setContext(
      FormLoader loader,
      Form form,
      ims.framework.interfaces.IAppForm appForm,
      UIFactory factory,
      ims.framework.Context context,
      Boolean skipContextValidation,
      Integer startControlID,
      ims.framework.utils.SizeInfo runtimeSize,
      ims.framework.Control control,
      Integer startTabIndex)
      throws Exception {
    if (loader == null) ; // this is to avoid eclipse warning only.
    if (factory == null) ; // this is to avoid eclipse warning only.
    if (runtimeSize == null) ; // this is to avoid eclipse warning only.
    if (appForm == null) throw new RuntimeException("Invalid application form");
    if (startControlID == null) throw new RuntimeException("Invalid startControlID");
    if (control == null) ; // this is to avoid eclipse warning only.
    if (startTabIndex == null) throw new RuntimeException("Invalid startTabIndex");
    this.context = context;
    this.componentIdentifier = startControlID.toString();
    this.formInfo = form.getFormInfo();
    this.globalContext = new GlobalContext(context);

    if (skipContextValidation == null || !skipContextValidation.booleanValue()) {
      validateContext(context);
      validateMandatoryContext(context);
    }

    super.setContext(form);

    ims.framework.utils.SizeInfo designSize = new ims.framework.utils.SizeInfo(848, 632);
    if (runtimeSize == null) runtimeSize = designSize;
    form.setWidth(runtimeSize.getWidth());
    form.setHeight(runtimeSize.getHeight());
    super.setFormReferences(FormReferencesFlyweightFactory.getInstance().create(Forms.class));
    super.setImageReferences(ImageReferencesFlyweightFactory.getInstance().create(Images.class));
    super.setGlobalContext(
        ContextBridgeFlyweightFactory.getInstance()
            .create(GlobalContextBridge.class, context, false));
    super.setLocalContext(new LocalContext(context, form.getFormInfo(), componentIdentifier));

    // Label Controls
    RuntimeAnchoring anchoringHelper1 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            704,
            574,
            110,
            17,
            ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT);
    super.addControl(
        factory.getControl(
            Label.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1000),
              new Integer(anchoringHelper1.getX()),
              new Integer(anchoringHelper1.getY()),
              new Integer(anchoringHelper1.getWidth()),
              new Integer(anchoringHelper1.getHeight()),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT,
              "Section Complete?",
              new Integer(1),
              null,
              new Integer(0)
            }));

    // Button Controls
    RuntimeAnchoring anchoringHelper2 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            680,
            592,
            75,
            23,
            ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT);
    super.addControl(
        factory.getControl(
            Button.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1001),
              new Integer(anchoringHelper2.getX()),
              new Integer(anchoringHelper2.getY()),
              new Integer(anchoringHelper2.getWidth()),
              new Integer(anchoringHelper2.getHeight()),
              new Integer(startTabIndex.intValue() + 4),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT,
              "Save",
              Boolean.TRUE,
              null,
              Boolean.FALSE,
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              ims.framework.utils.Color.Default,
              ims.framework.utils.Color.Default
            }));
    RuntimeAnchoring anchoringHelper3 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            757,
            592,
            75,
            23,
            ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT);
    super.addControl(
        factory.getControl(
            Button.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1002),
              new Integer(anchoringHelper3.getX()),
              new Integer(anchoringHelper3.getY()),
              new Integer(anchoringHelper3.getWidth()),
              new Integer(anchoringHelper3.getHeight()),
              new Integer(startTabIndex.intValue() + 5),
              ControlState.ENABLED,
              ControlState.ENABLED,
              ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT,
              "Cancel",
              Boolean.FALSE,
              null,
              Boolean.FALSE,
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              ims.framework.utils.Color.Default,
              ims.framework.utils.Color.Default
            }));

    // CheckBox Controls
    RuntimeAnchoring anchoringHelper4 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            816,
            574,
            16,
            16,
            ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT);
    super.addControl(
        factory.getControl(
            CheckBox.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1003),
              new Integer(anchoringHelper4.getX()),
              new Integer(anchoringHelper4.getY()),
              new Integer(anchoringHelper4.getWidth()),
              new Integer(anchoringHelper4.getHeight()),
              new Integer(startTabIndex.intValue() + 2),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT,
              "",
              Boolean.FALSE,
              null
            }));
    RuntimeAnchoring anchoringHelper5 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            16,
            16,
            168,
            16,
            ims.framework.enumerations.ControlAnchoring.TOPLEFT);
    super.addControl(
        factory.getControl(
            CheckBox.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1004),
              new Integer(anchoringHelper5.getX()),
              new Integer(anchoringHelper5.getY()),
              new Integer(anchoringHelper5.getWidth()),
              new Integer(anchoringHelper5.getHeight()),
              new Integer(-1),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPLEFT,
              "Copy Previous Assessment",
              Boolean.TRUE,
              null
            }));

    // Grid Controls
    RuntimeAnchoring anchoringHelper6 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            16,
            40,
            816,
            520,
            ims.framework.enumerations.ControlAnchoring.ALL);
    Grid m_gridActivityTemp =
        (Grid)
            factory.getControl(
                Grid.class,
                new Object[] {
                  control,
                  new Integer(startControlID.intValue() + 1005),
                  new Integer(anchoringHelper6.getX()),
                  new Integer(anchoringHelper6.getY()),
                  new Integer(anchoringHelper6.getWidth()),
                  new Integer(anchoringHelper6.getHeight()),
                  new Integer(startTabIndex.intValue() + 1),
                  ControlState.READONLY,
                  ControlState.EDITABLE,
                  ims.framework.enumerations.ControlAnchoring.ALL,
                  Boolean.FALSE,
                  Boolean.FALSE,
                  new Integer(24),
                  Boolean.TRUE,
                  null,
                  Boolean.FALSE,
                  Boolean.FALSE,
                  new Integer(0),
                  null,
                  Boolean.FALSE,
                  Boolean.TRUE
                });
    addControl(m_gridActivityTemp);
    gridActivityGrid gridActivity =
        (gridActivityGrid)
            GridFlyweightFactory.getInstance()
                .createGridBridge(gridActivityGrid.class, m_gridActivityTemp);
    gridActivity.addStringColumn(
        "Activity",
        0,
        0,
        160,
        true,
        false,
        0,
        0,
        true,
        ims.framework.enumerations.CharacterCasing.NORMAL);
    gridActivity.addComboBoxColumn("Ability", 0, 0, 180, false, true, false, false, true, -1);
    gridActivity.addComboBoxColumn("Aids Used", 0, 0, 120, false, true, false, false, true, -1);
    gridActivity.addStringColumn(
        "Details ",
        0,
        0,
        -1,
        false,
        false,
        0,
        255,
        true,
        ims.framework.enumerations.CharacterCasing.NORMAL);
    super.addGrid(gridActivity);

    // Link Controls
    RuntimeAnchoring anchoringHelper7 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            792,
            16,
            24,
            17,
            ims.framework.enumerations.ControlAnchoring.TOPRIGHT);
    super.addControl(
        factory.getControl(
            Link.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1006),
              new Integer(anchoringHelper7.getX()),
              new Integer(anchoringHelper7.getY()),
              new Integer(anchoringHelper7.getWidth()),
              new Integer(anchoringHelper7.getHeight()),
              new Integer(-1),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPRIGHT,
              "Info",
              Boolean.FALSE,
              null
            }));
  }
  protected void setContext(
      FormLoader loader,
      Form form,
      ims.framework.interfaces.IAppForm appForm,
      UIFactory factory,
      ims.framework.Context context,
      Boolean skipContextValidation,
      Integer startControlID,
      ims.framework.utils.SizeInfo runtimeSize,
      ims.framework.Control control,
      Integer startTabIndex)
      throws Exception {
    if (loader == null) ; // this is to avoid eclipse warning only.
    if (factory == null) ; // this is to avoid eclipse warning only.
    if (runtimeSize == null) ; // this is to avoid eclipse warning only.
    if (appForm == null) throw new RuntimeException("Invalid application form");
    if (startControlID == null) throw new RuntimeException("Invalid startControlID");
    if (control == null) ; // this is to avoid eclipse warning only.
    if (startTabIndex == null) throw new RuntimeException("Invalid startTabIndex");
    this.context = context;
    this.componentIdentifier = startControlID.toString();
    this.formInfo = form.getFormInfo();
    this.globalContext = new GlobalContext(context);

    if (skipContextValidation == null || !skipContextValidation.booleanValue()) {
      validateContext(context);
      validateMandatoryContext(context);
    }

    super.setContext(form);

    ims.framework.utils.SizeInfo designSize = new ims.framework.utils.SizeInfo(432, 248);
    if (runtimeSize == null) runtimeSize = designSize;
    form.setWidth(runtimeSize.getWidth());
    form.setHeight(runtimeSize.getHeight());
    super.setGlobalContext(
        ContextBridgeFlyweightFactory.getInstance()
            .create(GlobalContextBridge.class, context, false));
    super.setLocalContext(new LocalContext(context, form.getFormInfo(), componentIdentifier));

    // Label Controls
    RuntimeAnchoring anchoringHelper1 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            16,
            96,
            148,
            17,
            ims.framework.enumerations.ControlAnchoring.TOPLEFT);
    super.addControl(
        factory.getControl(
            Label.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1000),
              new Integer(anchoringHelper1.getX()),
              new Integer(anchoringHelper1.getY()),
              new Integer(anchoringHelper1.getWidth()),
              new Integer(anchoringHelper1.getHeight()),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPLEFT,
              "Onward Referral Reason:",
              new Integer(1),
              null,
              new Integer(0)
            }));
    RuntimeAnchoring anchoringHelper2 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            16,
            120,
            89,
            17,
            ims.framework.enumerations.ControlAnchoring.TOPLEFT);
    super.addControl(
        factory.getControl(
            Label.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1001),
              new Integer(anchoringHelper2.getX()),
              new Integer(anchoringHelper2.getY()),
              new Integer(anchoringHelper2.getWidth()),
              new Integer(anchoringHelper2.getHeight()),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPLEFT,
              "Rejected Date:",
              new Integer(1),
              null,
              new Integer(0)
            }));
    RuntimeAnchoring anchoringHelper3 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            16,
            144,
            108,
            17,
            ims.framework.enumerations.ControlAnchoring.TOPLEFT);
    super.addControl(
        factory.getControl(
            Label.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1002),
              new Integer(anchoringHelper3.getX()),
              new Integer(anchoringHelper3.getY()),
              new Integer(anchoringHelper3.getWidth()),
              new Integer(anchoringHelper3.getHeight()),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPLEFT,
              "Rejection Reason:",
              new Integer(1),
              null,
              new Integer(0)
            }));
    RuntimeAnchoring anchoringHelper4 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            16,
            168,
            76,
            17,
            ims.framework.enumerations.ControlAnchoring.TOPLEFT);
    super.addControl(
        factory.getControl(
            Label.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1003),
              new Integer(anchoringHelper4.getX()),
              new Integer(anchoringHelper4.getY()),
              new Integer(anchoringHelper4.getWidth()),
              new Integer(anchoringHelper4.getHeight()),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPLEFT,
              "Rejected By:",
              new Integer(1),
              null,
              new Integer(0)
            }));
    RuntimeAnchoring anchoringHelper5 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            16,
            24,
            95,
            17,
            ims.framework.enumerations.ControlAnchoring.TOPLEFT);
    super.addControl(
        factory.getControl(
            Label.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1004),
              new Integer(anchoringHelper5.getX()),
              new Integer(anchoringHelper5.getY()),
              new Integer(anchoringHelper5.getWidth()),
              new Integer(anchoringHelper5.getHeight()),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPLEFT,
              "Discharge Date:",
              new Integer(1),
              null,
              new Integer(0)
            }));
    RuntimeAnchoring anchoringHelper6 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            16,
            72,
            175,
            17,
            ims.framework.enumerations.ControlAnchoring.TOPLEFT);
    super.addControl(
        factory.getControl(
            Label.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1005),
              new Integer(anchoringHelper6.getX()),
              new Integer(anchoringHelper6.getY()),
              new Integer(anchoringHelper6.getWidth()),
              new Integer(anchoringHelper6.getHeight()),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPLEFT,
              "Onward Referral Instructions:",
              new Integer(1),
              null,
              new Integer(0)
            }));
    RuntimeAnchoring anchoringHelper7 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            16,
            48,
            179,
            17,
            ims.framework.enumerations.ControlAnchoring.TOPLEFT);
    super.addControl(
        factory.getControl(
            Label.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1006),
              new Integer(anchoringHelper7.getX()),
              new Integer(anchoringHelper7.getY()),
              new Integer(anchoringHelper7.getWidth()),
              new Integer(anchoringHelper7.getHeight()),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPLEFT,
              "Onward Referral Organisation:",
              new Integer(1),
              null,
              new Integer(0)
            }));

    // Button Controls
    RuntimeAnchoring anchoringHelper8 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            341,
            208,
            75,
            23,
            ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT);
    super.addControl(
        factory.getControl(
            Button.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1007),
              new Integer(anchoringHelper8.getX()),
              new Integer(anchoringHelper8.getY()),
              new Integer(anchoringHelper8.getWidth()),
              new Integer(anchoringHelper8.getHeight()),
              new Integer(startTabIndex.intValue() + 8),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT,
              "Cancel",
              Boolean.FALSE,
              null,
              Boolean.FALSE,
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              ims.framework.utils.Color.Default,
              ims.framework.utils.Color.Default
            }));
    RuntimeAnchoring anchoringHelper9 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            264,
            208,
            75,
            23,
            ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT);
    super.addControl(
        factory.getControl(
            Button.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1008),
              new Integer(anchoringHelper9.getX()),
              new Integer(anchoringHelper9.getY()),
              new Integer(anchoringHelper9.getWidth()),
              new Integer(anchoringHelper9.getHeight()),
              new Integer(startTabIndex.intValue() + 7),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT,
              "Save",
              Boolean.FALSE,
              null,
              Boolean.FALSE,
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              ims.framework.utils.Color.Default,
              ims.framework.utils.Color.Default
            }));

    // TextBox Controls
    RuntimeAnchoring anchoringHelper10 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            200,
            94,
            216,
            21,
            ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT);
    super.addControl(
        factory.getControl(
            TextBox.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1009),
              new Integer(anchoringHelper10.getX()),
              new Integer(anchoringHelper10.getY()),
              new Integer(anchoringHelper10.getWidth()),
              new Integer(anchoringHelper10.getHeight()),
              new Integer(startTabIndex.intValue() + 9),
              ControlState.DISABLED,
              ControlState.DISABLED,
              ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT,
              Boolean.FALSE,
              new Integer(0),
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              null,
              Boolean.FALSE,
              ims.framework.enumerations.CharacterCasing.NORMAL,
              ims.framework.enumerations.TextTrimming.NONE,
              "",
              ""
            }));
    RuntimeAnchoring anchoringHelper11 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            200,
            142,
            216,
            21,
            ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT);
    super.addControl(
        factory.getControl(
            TextBox.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1010),
              new Integer(anchoringHelper11.getX()),
              new Integer(anchoringHelper11.getY()),
              new Integer(anchoringHelper11.getWidth()),
              new Integer(anchoringHelper11.getHeight()),
              new Integer(startTabIndex.intValue() + 5),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT,
              Boolean.FALSE,
              new Integer(500),
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              null,
              Boolean.FALSE,
              ims.framework.enumerations.CharacterCasing.NORMAL,
              ims.framework.enumerations.TextTrimming.NONE,
              "",
              ""
            }));
    RuntimeAnchoring anchoringHelper12 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            200,
            70,
            216,
            21,
            ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT);
    super.addControl(
        factory.getControl(
            TextBox.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1011),
              new Integer(anchoringHelper12.getX()),
              new Integer(anchoringHelper12.getY()),
              new Integer(anchoringHelper12.getWidth()),
              new Integer(anchoringHelper12.getHeight()),
              new Integer(startTabIndex.intValue() + 3),
              ControlState.DISABLED,
              ControlState.DISABLED,
              ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT,
              Boolean.FALSE,
              new Integer(0),
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              null,
              Boolean.FALSE,
              ims.framework.enumerations.CharacterCasing.NORMAL,
              ims.framework.enumerations.TextTrimming.NONE,
              "",
              ""
            }));
    RuntimeAnchoring anchoringHelper13 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            200,
            46,
            216,
            21,
            ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT);
    super.addControl(
        factory.getControl(
            TextBox.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1012),
              new Integer(anchoringHelper13.getX()),
              new Integer(anchoringHelper13.getY()),
              new Integer(anchoringHelper13.getWidth()),
              new Integer(anchoringHelper13.getHeight()),
              new Integer(startTabIndex.intValue() + 2),
              ControlState.DISABLED,
              ControlState.DISABLED,
              ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT,
              Boolean.FALSE,
              new Integer(0),
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              null,
              Boolean.FALSE,
              ims.framework.enumerations.CharacterCasing.NORMAL,
              ims.framework.enumerations.TextTrimming.NONE,
              "",
              ""
            }));
    RuntimeAnchoring anchoringHelper14 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            200,
            22,
            216,
            21,
            ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT);
    super.addControl(
        factory.getControl(
            TextBox.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1013),
              new Integer(anchoringHelper14.getX()),
              new Integer(anchoringHelper14.getY()),
              new Integer(anchoringHelper14.getWidth()),
              new Integer(anchoringHelper14.getHeight()),
              new Integer(startTabIndex.intValue() + 1),
              ControlState.DISABLED,
              ControlState.DISABLED,
              ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT,
              Boolean.FALSE,
              new Integer(0),
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              null,
              Boolean.FALSE,
              ims.framework.enumerations.CharacterCasing.NORMAL,
              ims.framework.enumerations.TextTrimming.NONE,
              "",
              ""
            }));

    // Date Controls
    RuntimeAnchoring anchoringHelper15 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            200,
            118,
            216,
            20,
            ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT);
    super.addControl(
        factory.getControl(
            DateControl.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1014),
              new Integer(anchoringHelper15.getX()),
              new Integer(anchoringHelper15.getY()),
              new Integer(anchoringHelper15.getWidth()),
              new Integer(anchoringHelper15.getHeight()),
              new Integer(startTabIndex.intValue() + 4),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT,
              Boolean.TRUE,
              null,
              Boolean.FALSE,
              null,
              Boolean.TRUE,
              null
            }));

    // ComboBox Controls
    RuntimeAnchoring anchoringHelper16 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            200,
            166,
            216,
            21,
            ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT);
    ComboBox m_cmbRejectedByTemp =
        (ComboBox)
            factory.getControl(
                ComboBox.class,
                new Object[] {
                  control,
                  new Integer(startControlID.intValue() + 1015),
                  new Integer(anchoringHelper16.getX()),
                  new Integer(anchoringHelper16.getY()),
                  new Integer(anchoringHelper16.getWidth()),
                  new Integer(anchoringHelper16.getHeight()),
                  new Integer(startTabIndex.intValue() + 6),
                  ControlState.UNKNOWN,
                  ControlState.UNKNOWN,
                  ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT,
                  Boolean.TRUE,
                  Boolean.FALSE,
                  SortOrder.NONE,
                  Boolean.FALSE,
                  new Integer(1),
                  null,
                  Boolean.TRUE,
                  new Integer(-1)
                });
    addControl(m_cmbRejectedByTemp);
    cmbRejectedByComboBox cmbRejectedBy =
        (cmbRejectedByComboBox)
            ComboBoxFlyweightFactory.getInstance()
                .createComboBoxBridge(cmbRejectedByComboBox.class, m_cmbRejectedByTemp);
    super.addComboBox(cmbRejectedBy);
  }
  protected void setContext(
      FormLoader loader,
      Form form,
      ims.framework.interfaces.IAppForm appForm,
      UIFactory factory,
      ims.framework.Context context,
      Boolean skipContextValidation,
      Integer startControlID,
      ims.framework.utils.SizeInfo runtimeSize,
      ims.framework.Control control,
      Integer startTabIndex)
      throws Exception {
    if (loader == null) ; // this is to avoid eclipse warning only.
    if (factory == null) ; // this is to avoid eclipse warning only.
    if (runtimeSize == null) ; // this is to avoid eclipse warning only.
    if (appForm == null) throw new RuntimeException("Invalid application form");
    if (startControlID == null) throw new RuntimeException("Invalid startControlID");
    if (control == null) ; // this is to avoid eclipse warning only.
    if (startTabIndex == null) throw new RuntimeException("Invalid startTabIndex");
    this.context = context;
    this.componentIdentifier = startControlID.toString();
    this.formInfo = form.getFormInfo();
    this.globalContext = new GlobalContext(context);

    if (skipContextValidation == null || !skipContextValidation.booleanValue()) {
      validateContext(context);
    }

    super.setContext(form);

    ims.framework.utils.SizeInfo designSize = new ims.framework.utils.SizeInfo(864, 576);
    if (runtimeSize == null) runtimeSize = designSize;
    form.setWidth(runtimeSize.getWidth());
    form.setHeight(runtimeSize.getHeight());
    super.setFormReferences(FormReferencesFlyweightFactory.getInstance().create(Forms.class));
    super.setImageReferences(ImageReferencesFlyweightFactory.getInstance().create(Images.class));
    super.setGlobalContext(
        ContextBridgeFlyweightFactory.getInstance()
            .create(GlobalContextBridge.class, context, false));
    super.setLocalContext(new LocalContext(context, form.getFormInfo(), componentIdentifier));

    // Context Menus
    contextMenus = new ContextMenus();
    contextMenus.contextMenuMosLocation = factory.createMenu(startControlID.intValue() + 1);
    contextMenus.contextMenuMosLocationSetPrimaryLocationItem =
        factory.createMenuItem(
            startControlID.intValue() + 1,
            "Set as primary location",
            true,
            false,
            new Integer(103104),
            true,
            false);
    contextMenus.contextMenuMosLocation.add(
        contextMenus.contextMenuMosLocationSetPrimaryLocationItem);
    form.registerMenu(contextMenus.contextMenuMosLocation);

    // Panel Controls
    RuntimeAnchoring anchoringHelper1 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            8,
            8,
            848,
            24,
            ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT);
    super.addControl(
        factory.getControl(
            Panel.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1000),
              new Integer(anchoringHelper1.getX()),
              new Integer(anchoringHelper1.getY()),
              new Integer(anchoringHelper1.getWidth()),
              new Integer(anchoringHelper1.getHeight()),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT,
              "Set Organisations/locations",
              new Integer(1),
              ""
            }));

    // Button Controls
    RuntimeAnchoring anchoringHelper2 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            696,
            536,
            75,
            23,
            ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT);
    super.addControl(
        factory.getControl(
            Button.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1001),
              new Integer(anchoringHelper2.getX()),
              new Integer(anchoringHelper2.getY()),
              new Integer(anchoringHelper2.getWidth()),
              new Integer(anchoringHelper2.getHeight()),
              new Integer(startTabIndex.intValue() + 2),
              ControlState.HIDDEN,
              ControlState.ENABLED,
              ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT,
              "Save",
              Boolean.FALSE,
              null,
              Boolean.FALSE,
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              ims.framework.utils.Color.Default,
              ims.framework.utils.Color.Default
            }));
    RuntimeAnchoring anchoringHelper3 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            773,
            536,
            75,
            23,
            ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT);
    super.addControl(
        factory.getControl(
            Button.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1002),
              new Integer(anchoringHelper3.getX()),
              new Integer(anchoringHelper3.getY()),
              new Integer(anchoringHelper3.getWidth()),
              new Integer(anchoringHelper3.getHeight()),
              new Integer(startTabIndex.intValue() + 3),
              ControlState.HIDDEN,
              ControlState.ENABLED,
              ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT,
              "Cancel",
              Boolean.FALSE,
              null,
              Boolean.FALSE,
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              ims.framework.utils.Color.Default,
              ims.framework.utils.Color.Default
            }));

    // Dynamic Grid Controls
    RuntimeAnchoring anchoringHelper4 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            8,
            40,
            840,
            472,
            ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT);
    super.addControl(
        factory.getControl(
            DynamicGrid.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1003),
              new Integer(anchoringHelper4.getX()),
              new Integer(anchoringHelper4.getY()),
              new Integer(anchoringHelper4.getWidth()),
              new Integer(anchoringHelper4.getHeight()),
              new Integer(startTabIndex.intValue() + 1),
              ControlState.READONLY,
              ControlState.EDITABLE,
              ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT,
              contextMenus.contextMenuMosLocation,
              Boolean.FALSE,
              Boolean.FALSE,
              Boolean.TRUE
            }));
  }
  protected void setContext(
      FormLoader loader,
      Form form,
      ims.framework.interfaces.IAppForm appForm,
      UIFactory factory,
      ims.framework.Context context,
      Boolean skipContextValidation,
      Integer startControlID,
      ims.framework.utils.SizeInfo runtimeSize,
      ims.framework.Control control,
      Integer startTabIndex)
      throws Exception {
    if (loader == null) ; // this is to avoid eclipse warning only.
    if (factory == null) ; // this is to avoid eclipse warning only.
    if (runtimeSize == null) ; // this is to avoid eclipse warning only.
    if (appForm == null) throw new RuntimeException("Invalid application form");
    if (startControlID == null) throw new RuntimeException("Invalid startControlID");
    if (control == null) ; // this is to avoid eclipse warning only.
    if (startTabIndex == null) throw new RuntimeException("Invalid startTabIndex");
    this.context = context;
    this.componentIdentifier = startControlID.toString();
    this.formInfo = form.getFormInfo();
    this.globalContext = new GlobalContext(context);

    if (skipContextValidation == null || !skipContextValidation.booleanValue()) {
      validateContext(context);
    }

    super.setContext(form);

    ims.framework.utils.SizeInfo designSize = new ims.framework.utils.SizeInfo(848, 632);
    if (runtimeSize == null) runtimeSize = designSize;
    form.setWidth(runtimeSize.getWidth());
    form.setHeight(runtimeSize.getHeight());
    super.setImageReferences(ImageReferencesFlyweightFactory.getInstance().create(Images.class));
    super.setGlobalContext(
        ContextBridgeFlyweightFactory.getInstance()
            .create(GlobalContextBridge.class, context, false));
    super.setLocalContext(new LocalContext(context, form.getFormInfo(), componentIdentifier));

    // Custom Controls
    ims.framework.CustomComponent instance1 = factory.getEmptyCustomComponent();
    RuntimeAnchoring anchoringHelper1 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            0,
            592,
            648,
            40,
            ims.framework.enumerations.ControlAnchoring.TOPLEFT);
    ims.framework.FormUiLogic m_ccPrinterForm =
        loader.loadComponent(
            103220,
            appForm,
            startControlID * 10 + 1000,
            anchoringHelper1.getSize(),
            instance1,
            startTabIndex.intValue() + 2,
            skipContextValidation);
    // ims.framework.Control m_ccPrinterControl = factory.getControl(CustomComponent.class, new
    // Object[] { control, new Integer(startControlID.intValue() + 1000), new Integer(0), new
    // Integer(592), new Integer(648), new Integer(40), ControlState.UNKNOWN, ControlState.UNKNOWN,
    // ims.framework.enumerations.ControlAnchoring.TOPLEFT, new Integer(startTabIndex.intValue() +
    // 2), m_ccPrinterForm, instance1 } );
    ims.framework.Control m_ccPrinterControl =
        factory.getControl(
            CustomComponent.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1001),
              new Integer(anchoringHelper1.getX()),
              new Integer(anchoringHelper1.getY()),
              new Integer(anchoringHelper1.getWidth()),
              new Integer(anchoringHelper1.getHeight()),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPLEFT,
              new Integer(startTabIndex.intValue() + 2),
              m_ccPrinterForm,
              instance1,
              Boolean.FALSE
            });
    super.addControl(m_ccPrinterControl);
    Menu[] menus1 = m_ccPrinterForm.getForm().getRegisteredMenus();
    for (int x = 0; x < menus1.length; x++) {
      form.registerMenu(menus1[x]);
    }

    // Button Controls
    RuntimeAnchoring anchoringHelper2 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            680,
            600,
            75,
            23,
            ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT);
    super.addControl(
        factory.getControl(
            Button.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1002),
              new Integer(anchoringHelper2.getX()),
              new Integer(anchoringHelper2.getY()),
              new Integer(anchoringHelper2.getWidth()),
              new Integer(anchoringHelper2.getHeight()),
              new Integer(startTabIndex.intValue() + 1003),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT,
              "Print",
              Boolean.FALSE,
              null,
              Boolean.FALSE,
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              ims.framework.utils.Color.Default,
              ims.framework.utils.Color.Default
            }));
    RuntimeAnchoring anchoringHelper3 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            760,
            600,
            75,
            23,
            ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT);
    super.addControl(
        factory.getControl(
            Button.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1003),
              new Integer(anchoringHelper3.getX()),
              new Integer(anchoringHelper3.getY()),
              new Integer(anchoringHelper3.getWidth()),
              new Integer(anchoringHelper3.getHeight()),
              new Integer(startTabIndex.intValue() + 1004),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT,
              "Cancel",
              Boolean.FALSE,
              null,
              Boolean.FALSE,
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              ims.framework.utils.Color.Default,
              ims.framework.utils.Color.Default
            }));

    // Dynamic Grid Controls
    RuntimeAnchoring anchoringHelper4 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            8,
            16,
            832,
            576,
            ims.framework.enumerations.ControlAnchoring.ALL);
    super.addControl(
        factory.getControl(
            DynamicGrid.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1004),
              new Integer(anchoringHelper4.getX()),
              new Integer(anchoringHelper4.getY()),
              new Integer(anchoringHelper4.getWidth()),
              new Integer(anchoringHelper4.getHeight()),
              new Integer(startTabIndex.intValue() + 1),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.ALL,
              null,
              Boolean.FALSE,
              Boolean.FALSE,
              Boolean.TRUE
            }));
  }
Beispiel #9
0
  protected void setContext(
      FormLoader loader,
      Form form,
      ims.framework.interfaces.IAppForm appForm,
      UIFactory factory,
      ims.framework.Context context,
      Boolean skipContextValidation,
      Integer startControlID,
      ims.framework.utils.SizeInfo runtimeSize,
      ims.framework.Control control,
      Integer startTabIndex)
      throws Exception {
    if (loader == null) ; // this is to avoid eclipse warning only.
    if (factory == null) ; // this is to avoid eclipse warning only.
    if (runtimeSize == null) ; // this is to avoid eclipse warning only.
    if (appForm == null) throw new RuntimeException("Invalid application form");
    if (startControlID == null) throw new RuntimeException("Invalid startControlID");
    if (control == null) ; // this is to avoid eclipse warning only.
    if (startTabIndex == null) throw new RuntimeException("Invalid startTabIndex");
    this.context = context;
    this.componentIdentifier = startControlID.toString();
    this.formInfo = form.getFormInfo();
    this.globalContext = new GlobalContext(context);

    if (skipContextValidation == null || !skipContextValidation.booleanValue()) {
      validateContext(context);
      validateMandatoryContext(context);
    }

    super.setContext(form);

    ims.framework.utils.SizeInfo designSize = new ims.framework.utils.SizeInfo(848, 632);
    if (runtimeSize == null) runtimeSize = designSize;
    form.setWidth(runtimeSize.getWidth());
    form.setHeight(runtimeSize.getHeight());
    super.setFormReferences(FormReferencesFlyweightFactory.getInstance().create(Forms.class));
    super.setImageReferences(ImageReferencesFlyweightFactory.getInstance().create(Images.class));
    super.setGlobalContext(
        ContextBridgeFlyweightFactory.getInstance()
            .create(GlobalContextBridge.class, context, false));

    // Grid Controls
    RuntimeAnchoring anchoringHelper1 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            16,
            16,
            816,
            600,
            ims.framework.enumerations.ControlAnchoring.ALL);
    Grid m_grdEWSTemp =
        (Grid)
            factory.getControl(
                Grid.class,
                new Object[] {
                  control,
                  new Integer(startControlID.intValue() + 1000),
                  new Integer(anchoringHelper1.getX()),
                  new Integer(anchoringHelper1.getY()),
                  new Integer(anchoringHelper1.getWidth()),
                  new Integer(anchoringHelper1.getHeight()),
                  new Integer(startTabIndex.intValue() + 1),
                  ControlState.UNKNOWN,
                  ControlState.UNKNOWN,
                  ims.framework.enumerations.ControlAnchoring.ALL,
                  Boolean.TRUE,
                  Boolean.FALSE,
                  new Integer(24),
                  Boolean.TRUE,
                  null,
                  Boolean.FALSE,
                  Boolean.FALSE,
                  new Integer(0),
                  null,
                  Boolean.TRUE,
                  Boolean.TRUE
                });
    addControl(m_grdEWSTemp);
    grdEWSGrid grdEWS =
        (grdEWSGrid)
            GridFlyweightFactory.getInstance().createGridBridge(grdEWSGrid.class, m_grdEWSTemp);
    grdEWS.addStringColumn(
        "Authoring Information",
        0,
        0,
        250,
        true,
        false,
        1,
        0,
        true,
        ims.framework.enumerations.CharacterCasing.NORMAL);
    grdEWS.addIntColumn("Score", 0, 0, 70, true, true, null, false, 1, true, 0);
    grdEWS.addWrapTextColumn("Details", 0, 0, 350, true, false, 0, true);
    grdEWS.addButtonColumn("Assessment", 0, 0, -1, false, true);
    super.addGrid(grdEWS);
  }
  protected void setContext(
      FormLoader loader,
      Form form,
      ims.framework.interfaces.IAppForm appForm,
      UIFactory factory,
      ims.framework.Context context,
      Boolean skipContextValidation,
      Integer startControlID,
      ims.framework.utils.SizeInfo runtimeSize,
      ims.framework.Control control,
      Integer startTabIndex)
      throws Exception {
    if (loader == null) ; // this is to avoid eclipse warning only.
    if (factory == null) ; // this is to avoid eclipse warning only.
    if (runtimeSize == null) ; // this is to avoid eclipse warning only.
    if (appForm == null) throw new RuntimeException("Invalid application form");
    if (startControlID == null) throw new RuntimeException("Invalid startControlID");
    if (control == null) ; // this is to avoid eclipse warning only.
    if (startTabIndex == null) throw new RuntimeException("Invalid startTabIndex");
    this.context = context;
    this.componentIdentifier = startControlID.toString();
    this.formInfo = form.getFormInfo();
    this.globalContext = new GlobalContext(context);

    if (skipContextValidation == null || !skipContextValidation.booleanValue()) {
      validateContext(context);
    }

    super.setContext(form);

    ims.framework.utils.SizeInfo designSize = new ims.framework.utils.SizeInfo(650, 632);
    if (runtimeSize == null) runtimeSize = designSize;
    form.setWidth(runtimeSize.getWidth());
    form.setHeight(runtimeSize.getHeight());
    super.setFormReferences(FormReferencesFlyweightFactory.getInstance().create(Forms.class));
    super.setImageReferences(ImageReferencesFlyweightFactory.getInstance().create(Images.class));
    super.setGlobalContext(
        ContextBridgeFlyweightFactory.getInstance()
            .create(GlobalContextBridge.class, context, false));
    super.setLocalContext(new LocalContext(context, form.getFormInfo(), componentIdentifier));

    // Button Controls
    RuntimeAnchoring anchoringHelper1 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            556,
            600,
            75,
            23,
            ims.framework.enumerations.ControlAnchoring.TOPLEFT);
    super.addControl(
        factory.getControl(
            Button.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1000),
              new Integer(anchoringHelper1.getX()),
              new Integer(anchoringHelper1.getY()),
              new Integer(anchoringHelper1.getWidth()),
              new Integer(anchoringHelper1.getHeight()),
              new Integer(-1),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPLEFT,
              "Close",
              Boolean.FALSE,
              null,
              Boolean.TRUE,
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              ims.framework.utils.Color.Default,
              ims.framework.utils.Color.Default
            }));

    // Dynamic Grid Controls
    RuntimeAnchoring anchoringHelper2 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            20,
            16,
            610,
            573,
            ims.framework.enumerations.ControlAnchoring.ALL);
    super.addControl(
        factory.getControl(
            DynamicGrid.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1001),
              new Integer(anchoringHelper2.getX()),
              new Integer(anchoringHelper2.getY()),
              new Integer(anchoringHelper2.getWidth()),
              new Integer(anchoringHelper2.getHeight()),
              new Integer(-1),
              ControlState.EDITABLE,
              ControlState.EDITABLE,
              ims.framework.enumerations.ControlAnchoring.ALL,
              null,
              Boolean.FALSE,
              Boolean.TRUE,
              Boolean.TRUE
            }));
  }
  protected void setContext(
      FormLoader loader,
      Form form,
      ims.framework.interfaces.IAppForm appForm,
      UIFactory factory,
      ims.framework.Context context,
      Boolean skipContextValidation,
      Integer startControlID,
      ims.framework.utils.SizeInfo runtimeSize,
      ims.framework.Control control,
      Integer startTabIndex)
      throws Exception {
    if (loader == null) ; // this is to avoid eclipse warning only.
    if (factory == null) ; // this is to avoid eclipse warning only.
    if (runtimeSize == null) ; // this is to avoid eclipse warning only.
    if (appForm == null) throw new RuntimeException("Invalid application form");
    if (startControlID == null) throw new RuntimeException("Invalid startControlID");
    if (control == null) ; // this is to avoid eclipse warning only.
    if (startTabIndex == null) throw new RuntimeException("Invalid startTabIndex");
    this.context = context;
    this.componentIdentifier = startControlID.toString();
    this.formInfo = form.getFormInfo();
    this.globalContext = new GlobalContext(context);

    if (skipContextValidation == null || !skipContextValidation.booleanValue()) {
      validateContext(context);
    }

    super.setContext(form);

    form.setDarkHeight(60);
    ims.framework.utils.SizeInfo designSize = new ims.framework.utils.SizeInfo(352, 408);
    if (runtimeSize == null) runtimeSize = designSize;
    form.setWidth(runtimeSize.getWidth());
    form.setHeight(runtimeSize.getHeight());
    super.setImageReferences(ImageReferencesFlyweightFactory.getInstance().create(Images.class));
    super.setGlobalContext(
        ContextBridgeFlyweightFactory.getInstance()
            .create(GlobalContextBridge.class, context, false));

    // Label Controls
    RuntimeAnchoring anchoringHelper1 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            16,
            16,
            41,
            17,
            ims.framework.enumerations.ControlAnchoring.TOPLEFT);
    super.addControl(
        factory.getControl(
            Label.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1000),
              new Integer(anchoringHelper1.getX()),
              new Integer(anchoringHelper1.getY()),
              new Integer(anchoringHelper1.getWidth()),
              new Integer(anchoringHelper1.getHeight()),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPLEFT,
              "Name:",
              new Integer(1),
              null,
              new Integer(0)
            }));

    // Button Controls
    RuntimeAnchoring anchoringHelper2 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            256,
            368,
            80,
            24,
            ims.framework.enumerations.ControlAnchoring.TOPLEFT);
    super.addControl(
        factory.getControl(
            Button.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1001),
              new Integer(anchoringHelper2.getX()),
              new Integer(anchoringHelper2.getY()),
              new Integer(anchoringHelper2.getWidth()),
              new Integer(anchoringHelper2.getHeight()),
              new Integer(startTabIndex.intValue() + 6),
              ControlState.ENABLED,
              ControlState.ENABLED,
              ims.framework.enumerations.ControlAnchoring.TOPLEFT,
              "Cancel",
              Boolean.FALSE,
              null,
              Boolean.FALSE,
              Boolean.FALSE,
              Boolean.FALSE,
              null,
              ims.framework.utils.Color.Default,
              ims.framework.utils.Color.Default
            }));
    RuntimeAnchoring anchoringHelper3 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            168,
            368,
            80,
            24,
            ims.framework.enumerations.ControlAnchoring.TOPLEFT);
    super.addControl(
        factory.getControl(
            Button.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1002),
              new Integer(anchoringHelper3.getX()),
              new Integer(anchoringHelper3.getY()),
              new Integer(anchoringHelper3.getWidth()),
              new Integer(anchoringHelper3.getHeight()),
              new Integer(startTabIndex.intValue() + 5),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPLEFT,
              "Ok",
              Boolean.FALSE,
              null,
              Boolean.FALSE,
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              ims.framework.utils.Color.Default,
              ims.framework.utils.Color.Default
            }));

    // TextBox Controls
    RuntimeAnchoring anchoringHelper4 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            88,
            16,
            168,
            21,
            ims.framework.enumerations.ControlAnchoring.TOPLEFT);
    super.addControl(
        factory.getControl(
            TextBox.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1003),
              new Integer(anchoringHelper4.getX()),
              new Integer(anchoringHelper4.getY()),
              new Integer(anchoringHelper4.getWidth()),
              new Integer(anchoringHelper4.getHeight()),
              new Integer(startTabIndex.intValue() + 1),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPLEFT,
              Boolean.FALSE,
              new Integer(30),
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              null,
              Boolean.TRUE,
              ims.framework.enumerations.CharacterCasing.NORMAL,
              ims.framework.enumerations.TextTrimming.NONE,
              "",
              ""
            }));

    // Grid Controls
    RuntimeAnchoring anchoringHelper5 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            16,
            72,
            320,
            280,
            ims.framework.enumerations.ControlAnchoring.TOPLEFT);
    Grid m_grdUsersTemp =
        (Grid)
            factory.getControl(
                Grid.class,
                new Object[] {
                  control,
                  new Integer(startControlID.intValue() + 1004),
                  new Integer(anchoringHelper5.getX()),
                  new Integer(anchoringHelper5.getY()),
                  new Integer(anchoringHelper5.getWidth()),
                  new Integer(anchoringHelper5.getHeight()),
                  new Integer(startTabIndex.intValue() + 4),
                  ControlState.READONLY,
                  ControlState.EDITABLE,
                  ims.framework.enumerations.ControlAnchoring.TOPLEFT,
                  Boolean.TRUE,
                  Boolean.FALSE,
                  new Integer(24),
                  Boolean.TRUE,
                  null,
                  Boolean.FALSE,
                  Boolean.FALSE,
                  new Integer(0),
                  null,
                  Boolean.FALSE,
                  Boolean.TRUE
                });
    addControl(m_grdUsersTemp);
    grdUsersGrid grdUsers =
        (grdUsersGrid)
            GridFlyweightFactory.getInstance().createGridBridge(grdUsersGrid.class, m_grdUsersTemp);
    grdUsers.addStringColumn(
        "Name",
        0,
        0,
        -1,
        true,
        false,
        0,
        0,
        true,
        ims.framework.enumerations.CharacterCasing.NORMAL);
    super.addGrid(grdUsers);

    // Image Buttons Controls
    RuntimeAnchoring anchoringHelper6 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            304,
            16,
            30,
            30,
            ims.framework.enumerations.ControlAnchoring.TOPLEFT);
    super.addControl(
        factory.getControl(
            ImageButton.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1005),
              new Integer(anchoringHelper6.getX()),
              new Integer(anchoringHelper6.getY()),
              new Integer(anchoringHelper6.getWidth()),
              new Integer(anchoringHelper6.getHeight()),
              new Integer(startTabIndex.intValue() + 3),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPLEFT,
              this.getImages().Core.ClearEnabled24,
              this.getImages().Core.ClearDisabled24,
              "Clear",
              Boolean.FALSE,
              Boolean.FALSE,
              Boolean.TRUE,
              Boolean.FALSE,
              null
            }));
    RuntimeAnchoring anchoringHelper7 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            272,
            16,
            30,
            30,
            ims.framework.enumerations.ControlAnchoring.TOPLEFT);
    super.addControl(
        factory.getControl(
            ImageButton.class,
            new Object[] {
              control,
              new Integer(startControlID.intValue() + 1006),
              new Integer(anchoringHelper7.getX()),
              new Integer(anchoringHelper7.getY()),
              new Integer(anchoringHelper7.getWidth()),
              new Integer(anchoringHelper7.getHeight()),
              new Integer(startTabIndex.intValue() + 2),
              ControlState.UNKNOWN,
              ControlState.UNKNOWN,
              ims.framework.enumerations.ControlAnchoring.TOPLEFT,
              this.getImages().Core.FindEnabled24,
              this.getImages().Core.FindDisabled24,
              "Search",
              Boolean.FALSE,
              Boolean.TRUE,
              Boolean.TRUE,
              Boolean.FALSE,
              null
            }));
  }