コード例 #1
0
ファイル: GenForm.java プロジェクト: HobbesFNM/openMAXIMS
  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();

    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.setLocalContext(new LocalContext(context, form.getFormInfo(), componentIdentifier));

    // Button Controls
    RuntimeAnchoring anchoringHelper1 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            765,
            600,
            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(startTabIndex.intValue() + 4),
              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
            }));
    RuntimeAnchoring anchoringHelper2 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            688,
            600,
            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() + 3),
              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,
            8,
            600,
            75,
            23,
            ims.framework.enumerations.ControlAnchoring.BOTTOMLEFT);
    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() + 2),
              ControlState.ENABLED,
              ControlState.HIDDEN,
              ims.framework.enumerations.ControlAnchoring.BOTTOMLEFT,
              "Edit",
              Boolean.FALSE,
              null,
              Boolean.FALSE,
              Boolean.TRUE,
              Boolean.FALSE,
              null,
              ims.framework.utils.Color.Default,
              ims.framework.utils.Color.Default
            }));

    // Grid Controls
    RuntimeAnchoring anchoringHelper4 =
        new RuntimeAnchoring(
            designSize,
            runtimeSize,
            8,
            8,
            832,
            584,
            ims.framework.enumerations.ControlAnchoring.ALL);
    Grid m_grdSiteCollectionTypeTemp =
        (Grid)
            factory.getControl(
                Grid.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.DISABLED,
                  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_grdSiteCollectionTypeTemp);
    grdSiteCollectionTypeGrid grdSiteCollectionType =
        (grdSiteCollectionTypeGrid)
            GridFlyweightFactory.getInstance()
                .createGridBridge(grdSiteCollectionTypeGrid.class, m_grdSiteCollectionTypeTemp);
    grdSiteCollectionType.addStringColumn(
        "Type",
        0,
        0,
        600,
        true,
        false,
        0,
        0,
        true,
        ims.framework.enumerations.CharacterCasing.NORMAL);
    grdSiteCollectionType.addBoolColumn("Select", 0, 0, -1, false, false, 0, true);
    super.addGrid(grdSiteCollectionType);
  }
コード例 #2
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);
    }

    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);
  }
コード例 #3
0
ファイル: GenForm.java プロジェクト: HobbesFNM/openMAXIMS
  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);
  }
コード例 #4
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));
    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
            }));
  }
コード例 #5
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);
    }

    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
            }));
  }