示例#1
0
  /**
   * Injects the <tt>Widget Factory</tt> into other classes.
   *
   * @param widgetFactory <tt>Widget Factory</tt> that has been configured for this session to
   *     inject.
   */
  private void injectWidgetFactory(OpenXDataWidgetFactory widgetFactory) {

    // Inject Widget Factory into Utilities.
    Utilities.setWidgetFactory(widgetFactory);

    // Inject Widget Factory into MainViewControllerFacade
    MainViewControllerFacade.setWidgetFactory(widgetFactory);
  }
  /**
   * Binds a <code>User Mapped Form</code> to the <code>Tree view.</code>
   *
   * @param formDef <code>FormDef</code> to bind.
   */
  private static void bindMappedFormToTreeView(FormDef formDef) {
    StudyDef xDef = formDef.getStudy();
    if (xDef != null) {
      TreeItem formRoot = constructTreeItem(xDef);
      loadForm(formDef, formRoot, false);
    }

    Utilities.initializeTreeView(tree);
  }
  /**
   * Loads a study and its contents in this view.
   *
   * @param studyDef the study definition object.
   */
  public static void loadStudy(StudyDef studyDef) {

    TreeItem studyRoot =
        new CompositeTreeItem(new TreeItemWidget(images.note(), studyDef.getName(), popup));
    studyRoot.setUserObject(studyDef);
    tree.addItem(studyRoot);

    if (studyDef.getForms() != null) {
      for (FormDef def : studyDef.getForms()) loadForm(def, studyRoot, false);
    }

    Utilities.selectFirstItemOnTreeView(tree);
  }