Exemple #1
0
  /** This is the entry point method. */
  public void onModuleLoad() {
    loading = new LoadingWindow();

    VLayout main = new VLayout();
    main.setWidth("100%");
    main.setHeight100();
    main.setAlign(Alignment.CENTER);

    Layout imgLayout = new Layout();
    content = new HLayout();
    content.setHeight100();

    Img header = new Img("GarsComLogo.jpg");
    header.setWidth(600);
    header.setHeight(130);
    header.setAlign(Alignment.CENTER);
    imgLayout.addMember(header);
    imgLayout.setWidth("100%");
    imgLayout.setAlign(Alignment.CENTER);

    main.addMember(imgLayout);
    main.addMember(content);

    Tabs tabs = new Tabs();
    content.addMember(tabs);

    main.draw();
  }
Exemple #2
0
  /**
   * Generates the view layout. Takes the getFieldOrder and generates a field for each entry in the
   * dataMap
   *
   * @return
   */
  private Layout getViewForm() {
    Layout panel = new VLayout();
    panel.setWidth(300);
    panel.setDefaultHeight(10);

    for (String field : getFieldOrder()) {
      UIFormFieldValue uiField = dataMap.get(field);
      if (uiField == null) {
        log("!!uiField for " + field + " was null!");
      }

      addViewElement(panel, field, uiField.getLabel(), uiField.getValue());
    }

    final Button editButton = new Button("Edit " + getFormLabel());
    editButton.setPadding(5);
    editButton.addClickHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            switchToEdit();
          }
        });
    if (dataMap.get("editable") != null)
      editButton.setDisabled(!(Boolean) (dataMap.get("editable").getValue()));

    panel.addMember(editButton);

    return panel;
  }