Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.FlexTable$FlexCellFormatter


      }
    };
   
    this.setBorderWidth(1);
   
    FlexTable flexPanel = new FlexTable();
    int row = 0;
    this.add(flexPanel);

    //////////////////////////////////////////////////////////////
    // handle the related attribute
    AttrDef attr2 = relatedAttrs.get(0);
    String label = attr2.getLabel();
    int nl = attr2.getNumberOfLines();
    resourceTypeRelatedField = OrrUtil.createTextBoxBase(nl, "400", cl);
    String tooltip = "<b>" +label+ "</b>:<br/>" +
              attr2.getTooltip() +
              "<br/><br/><div align=\"right\">(" +attr2.getUri()+ ")</div>";

    flexPanel.setWidget(row, 0, new TLabel("Name:", editing && attr.isRequired(), tooltip ));
    flexPanel.getFlexCellFormatter().setColSpan(row, 1, 2);
    flexPanel.setWidget(row, 1, resourceTypeFieldWithChoose);
    flexPanel.getFlexCellFormatter().setAlignment(row, 0,
        HasHorizontalAlignment.ALIGN_RIGHT, HasVerticalAlignment.ALIGN_MIDDLE
    );
    flexPanel.getFlexCellFormatter().setAlignment(row, 1,
        HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
    );
    row++;

    flexPanel.setWidget(row, 0, new TLabel(label, editing && attr2.isRequired(), tooltip ));
    flexPanel.getFlexCellFormatter().setColSpan(row, 1, 2);
    flexPanel.setWidget(row, 1, resourceTypeRelatedField);
//    flexPanel.getFlexCellFormatter().setWidth(row, 0, "250");
    flexPanel.getFlexCellFormatter().setAlignment(row, 0,
        HasHorizontalAlignment.ALIGN_RIGHT, HasVerticalAlignment.ALIGN_MIDDLE
    );
    flexPanel.getFlexCellFormatter().setAlignment(row, 1,
        HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
    );
    row++;
    //////////////////////////////////////////////////////////////
   
View Full Code Here


    //////////////////////////////////////////////////////////////
    // handle the related attribute
    AttrDef attr2 = relatedAttrs.get(0);
    String label = attr2.getLabel();
    FlexTable panel = new FlexTable();
    int row = 0;
    int nl = attr2.getNumberOfLines();
    resourceTypeRelatedField = OrrUtil.createTextBoxBase(nl, "330", cl);
    String tooltip = "<b>" +label+ "</b>:<br/>" +
              attr2.getTooltip() +
              "<br/><br/><div align=\"right\">(" +attr2.getUri()+ ")</div>";
   
    TLabel tlabel = new TLabel(label, editing && attr2.isRequired(), tooltip);
   
    HorizontalPanel hpRelated = new HorizontalPanel();
    hpRelated.add(tlabel);
    hpRelated.add(resourceTypeRelatedField);
    panel.setWidget(row, 0, hpRelated);
   
//    panel.setWidget(row, 0, tlabel);
//    panel.setWidget(row, 0, resourceTypeRelatedField);
//    panel.getFlexCellFormatter().setWidth(row, 0, "250");
   
    panel.getFlexCellFormatter().setAlignment(row, 0,
        HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
    );
//    panel.getFlexCellFormatter().setAlignment(row, 1,
//        HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
//    );
View Full Code Here

    if ( useTableScroll ) {
      tableScroll.setSize("1000", "180");
    }
   
    FlexTable flexPanel = new FlexTable();
//    flexPanel.setBorderWidth(1);
//    flexPanel.setWidth("850");
    flexPanel.setWidth("100%");
    int row = 0;
   
    // general information
//    HTML infoLabel = new HTML(INTRO);
//    flexPanel.getFlexCellFormatter().setColSpan(row, 0, 4);
//    flexPanel.setWidget(row, 0, infoLabel);
//    flexPanel.getFlexCellFormatter().setAlignment(row, 0,
//        HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
//    );
//    row++;
   
   
   
    classNamePanel = createClassNamePanel();

   
    flexPanel.getFlexCellFormatter().setColSpan(row, 0, 3);
    flexPanel.setWidget(row, 0, classNamePanel);
//    flexPanel.setWidget(row, 0, new TLabel(label, true, tooltip));
    flexPanel.getFlexCellFormatter().setAlignment(row, 0,
        HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
    );

    row++;

   
    if ( useTableScroll ) {
      contentsContainer.add(tableScroll);
    }
   
   
    if ( true ) {
      VerticalPanel vp = new VerticalPanel();
//      vp.setBorderWidth(1);
      vp.setWidth("100%");
      vp.add(flexPanel);
      vp.add(contentsContainer);

      return vp;
    }
    else {

      flexPanel.getFlexCellFormatter().setColSpan(row, 0, 4);
      flexPanel.setWidget(row, 0, contentsContainer);
      flexPanel.getFlexCellFormatter().setAlignment(row, 0,
          HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
      );
      row++;

      return flexPanel;
View Full Code Here

  public Widget getWidget() {
    return widget;
  }

  protected void createForm() {
    flexTable = new FlexTable();
    int row = 0;
   
    for ( Elem elem : elems ) {
      AttrDef attrDef = elem.attrDef;
      Widget widget = elem.widget;
View Full Code Here

      preserveOriginalBaseNamespace.setChecked(false);
    }
   
    clear();
   
    FlexTable panel = new FlexTable();
    panel.setWidth("100%");
//    panel.setBorderWidth(1);
    int row = 0;
   
    String info;
    if ( allowLoadOptions ) {
      info = "Please specify your ontology file.";
    }
    else {
      info = "This panel shows the contents of the loaded ontology.";
    }
    panel.setWidget(row, 0, new HTML(info));
    panel.getFlexCellFormatter().setAlignment(row, 0,
        HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
    );
   
    HorizontalPanel hp = new HorizontalPanel();
    hp.setSpacing(3);
    hp.add(statusLoad);
   
//    if ( allowLoadOptions ) {
//      hp.add(loadButton);
//    }
   
    panel.setWidget(row, 1, hp);
    panel.getFlexCellFormatter().setAlignment(row, 1,
        HasHorizontalAlignment.ALIGN_RIGHT, HasVerticalAlignment.ALIGN_MIDDLE
    );
    row++;

    add(panel);
View Full Code Here

 
 
  private Widget createWidget(boolean allowLoadOptions) {
   
    FlexTable panel = new FlexTable();
   
    int row = 0;
   
    if ( allowLoadOptions ) {
      panel.getFlexCellFormatter().setColSpan(row, 0, 2);
      panel.setWidget(row, 0, prepareUploadPanel());
      panel.getFlexCellFormatter().setAlignment(row, 1,
          HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_MIDDLE
      );
      row++;
     
      panel.getFlexCellFormatter().setColSpan(row, 0, 2);
      panel.setWidget(row, 0, preserveOriginalBaseNamespace);
      panel.getFlexCellFormatter().setAlignment(row, 1,
          HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_MIDDLE
      );
      row++;
     
    }
   
    HorizontalPanel buttons = new HorizontalPanel();
    buttons.add(loadButton);
    buttons.add(detailsButton);
   
    panel.getFlexCellFormatter().setColSpan(row, 0, 2);
//    statusField2.setWidth("400");
//    statusField2.setReadOnly(true);
//    panel.setWidget(row, 0, statusField2);
    panel.setWidget(row, 0, buttons);
    panel.getFlexCellFormatter().setAlignment(row, 0,
        HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
    );

//    panel.setWidget(row, 1, detailsButton);
//    panel.getFlexCellFormatter().setAlignment(row, 1,
//        HasHorizontalAlignment.ALIGN_RIGHT, HasVerticalAlignment.ALIGN_MIDDLE
//    );
    row++;

   
    if ( INCLUDE_RDF ) {
      CellPanel resultPanel = new VerticalPanel();
      textArea.setReadOnly(true);
      textArea.setSize("400px", "100px");

      panel.getFlexCellFormatter().setColSpan(row, 0, 2);
      panel.setWidget(row, 0, resultPanel);

      DecoratorPanel decPanel = new DecoratorPanel();
      decPanel.setWidget(textArea);
      resultPanel.add(decPanel);
      row++;
View Full Code Here

   
    formPanel.setEncoding(FormPanel.ENCODING_MULTIPART);
    formPanel.setMethod(FormPanel.METHOD_POST);

   
    FlexTable panel = new FlexTable();
    formPanel.setWidget(panel);
   
   
   
    rb0 = new RadioButton("grp", "Local file:");

   
    final HorizontalPanel uploadContainer = new HorizontalPanel();
    uploadContainer.add(upload);
    rb0.setChecked(true);
//    upload.setEnabled(true);   // --> this method is not available
    ClickListener clickListener = new ClickListener() {
      private TextBox chooseLabel;
      public void onClick(Widget sender) {
        statusLoad.setText("");
//        statusField2.setText("");
//        upload.setEnabled(rb0.isChecked());  // --> this method is not available
        uploadContainer.clear();
        if ( rb0.isChecked() ) {
          uploadContainer.add(upload);
        }
        else {
          if ( chooseLabel == null ) {
            chooseLabel = new TextBox();
            chooseLabel.setText("");
            chooseLabel.setEnabled(false);
          }
          uploadContainer.add(chooseLabel);
        }
       
        if ( selectButton != null ) {
          selectButton.setEnabled(rb1.isChecked());
        }
      }
    };
    rb0.addClickListener(clickListener);
   
    if ( rb1 != null ) {
      rb1.addClickListener(clickListener);
    }

    int row = 0;

    panel.setWidget(row, 0, rb0);
    panel.getFlexCellFormatter().setAlignment(row, 0,
        HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
    );
    panel.setWidget(row, 1, uploadContainer);
    panel.getFlexCellFormatter().setAlignment(row, 1,
        HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
    );
//    panel.setWidget(row, 2, new Label("To submit a new ontology"));
    row++;
View Full Code Here

    if ( lines == null || lines.length == 0 ) {
      Window.alert("No details are available");
      return;
    }
   
    FlexTable table = new FlexTable();
    table.setStylePrimaryName("inline");
   
    table.getFlexCellFormatter().setColSpan(0, 0, 2);
    table.getFlexCellFormatter().setAlignment(0, 0,
        HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_MIDDLE);
    table.setWidget(0, 0, new Label("MMI attribute"));
   
    table.getFlexCellFormatter().setAlignment(0, 1,
        HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_MIDDLE);
    table.setWidget(0, 1, new Label("Note"));
   
   
    for ( int lin = 0; lin < lines.length; lin++ ) {
      String[] vals = lines[lin].split("\\|");
      for ( int col = 0; col < vals.length; col++ ) {
        table.setWidget(lin+1, col, new Label(vals[col]));
      }
 
    }
    VerticalPanel vp = new VerticalPanel();
    vp.setWidth("400");
View Full Code Here

  private void dispatchCreate() {
    _enable(true);
  }

  private Widget createForm() {
    FlexTable panel = new FlexTable();
    panel.setCellSpacing(5);
   
    int row = 0;
   
    panel.getFlexCellFormatter().setColSpan(row, 0, 3);
    panel.setWidget(row, 0, new HTML("<strong>Your account in the MMI Ontology Registry and Repository</strong>"));
    panel.getFlexCellFormatter().setAlignment(row, 0,
        HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_MIDDLE
    );
    row++;

   
    LoginResult loginResult = PortalControl.getInstance().getLoginResult();
    String userLoggedIn = (loginResult != null && loginResult.getError() == null) ?
        loginResult.getUserName() : null;
   
    HTML tipForPassword = null;
   
    for ( String name : tbs.keySet() ) {
      Entry entry = tbs.get(name);
      TextBox tb = entry.tb;
     
      if ( (tb instanceof PasswordTextBox) && userLoggedIn != null && tipForPassword == null ) {
        tipForPassword = new HTML("<font color=\"gray\"><i>Fill in the following if you want to change your password:</i></font>");
        panel.getFlexCellFormatter().setColSpan(row, 0, 3);
        panel.setWidget(row, 0, tipForPassword);
        panel.getFlexCellFormatter().setAlignment(row, 0,
            HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
        );
        row++;
      }
     
      panel.setWidget(row, 0, new Label(entry.label+ ":"));

      panel.setWidget(row, 1, tb);
      panel.getFlexCellFormatter().setAlignment(row, 0,
          HasHorizontalAlignment.ALIGN_RIGHT, HasVerticalAlignment.ALIGN_MIDDLE
      );
      panel.getFlexCellFormatter().setAlignment(row, 1,
          HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
      );
     
      row++;
     
    }

    panel.getFlexCellFormatter().setColSpan(row, 0, 3);
    panel.setWidget(row, 0, statusLabel);
    panel.getFlexCellFormatter().setAlignment(row, 0,
        HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
    );
    row++;
   
    createUpdateButton.setText(userLoggedIn == null ? "Create" : "Update");
    HorizontalPanel loginCell = new HorizontalPanel();
    loginCell.add(createUpdateButton);
    panel.getFlexCellFormatter().setColSpan(row, 0, 3);
    panel.setWidget(row, 0, loginCell);
    panel.getFlexCellFormatter().setAlignment(row, 0,
        HasHorizontalAlignment.ALIGN_RIGHT, HasVerticalAlignment.ALIGN_MIDDLE
    );
    row++;
   
   
View Full Code Here

      for (DocumentServiceEntry entry : entries) {
        if (!entry.isStarred()) {
          continue;
        }
        final String id = entry.getDocumentId();
        FlexTable docTable = new FlexTable();
        docTable.insertRow(0);
        docTable.insertCell(0, 0);
        docTable.insertCell(0, 1);
        docTable.insertCell(0, 2);
        docTable.insertRow(1);
        docTable.insertCell(1, 0);
        docTable.insertCell(1, 1);
        docTable.insertCell(1, 2);
        docTable.insertRow(2);
        docTable.insertCell(2, 0);
        docTable.insertCell(2, 1);
        docTable.insertCell(2, 2);
        docTable.setStylePrimaryName("lab-Explorer-Document");
        Anchor link = new Anchor();
        link.setText(entry.getTitle());
        link.setTarget("_blank");
        if (entry.getType().equalsIgnoreCase("document")) {
          link.setHref("/docs?docid=" + entry.getDocumentId());
        }
        ToggleButton star = new ToggleButton(
            Icons.editorIcons.StarEmpty().createImage(),
            Icons.editorIcons.StarFull().createImage());
        star.setDown(entry.isStarred());
        star.addClickHandler(new ClickHandler(){
          public void onClick(ClickEvent event) {
            ToggleButton btn = (ToggleButton)event.getSource();
            if (btn.isDown()) {
              CommandEvent.fire(new SystemStarDocumentCommand(id));
            } else {
              CommandEvent.fire(new SystemUnstarDocumentCommand(id));
            }
          }
        });
        Label info = new Label(entry.getEdited().toString() + " by " + entry.getEditor());
        info.setStylePrimaryName("lab-Explorer-Document-Info");
        docTable.setWidget(0, 0, star);
        docTable.setWidget(0, 1, Icons.editorIcons.Document().createImage());
        docTable.setWidget(0, 2, link);
        docTable.setWidget(1, 2, info);
        if (entry.getFolders().length > 0) {
          Label folderLabel = new Label(entry.getFolders()[0]);
          folderLabel.setStylePrimaryName("lab-Explorer-Document-Folder");
        HorizontalPanel folderPanel = new HorizontalPanel();
        folderPanel.add(folderLabel);
          docTable.setWidget(2, 2, folderPanel);
        }
        panel.add(docTable);
        totalEntries++;
      }
      if (totalEntries == 0) {
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.FlexTable$FlexCellFormatter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.