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

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


    content.setWidth("100%");
    status = new HorizontalPanel();
    status.setWidth("100%");
    status.setStylePrimaryName("lab-Header-Status");
    status.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
    main = new FlexTable();
    main.setWidth("100%");
    main.setCellSpacing(0);
    main.insertRow(0);
    main.insertCell(0, 0);
    main.getFlexCellFormatter().setHeight(0, 0, "12");
View Full Code Here


   * The lower region contains the title, info and button menu controls.
   *
   * @return a table containing the lower controls
   */
  private void buildLower() {
  FlexTable table = new FlexTable();
  table.setWidth("100%");
  table.setCellSpacing(0);
  table.setCellPadding(0);
  table.insertRow(0);
  table.insertCell(0, 0);
  table.insertCell(0, 1);
  table.getFlexCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE);
    table.getFlexCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_LEFT);
  table.getFlexCellFormatter().setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_MIDDLE);
    table.getFlexCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_RIGHT);
    Image logo = Icons.editorIcons.Logo().createImage();
    logo.setStylePrimaryName("lab-Header-Logo");
    HorizontalPanel titlePanel = new HorizontalPanel();
    titlePanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    titlePanel.getElement().getStyle().setOverflow(Overflow.HIDDEN);
    title = new Anchor("", "");
    title.setStylePrimaryName("lab-Header-Title");
    title.setTitle("Click to rename this document");
    title.addClickHandler(this);
    info = new HTML();
    info.setStylePrimaryName("lab-Header-Info");
    info.setHTML("not saved");
    titlePanel.add(logo);
    titlePanel.add(title);
    titlePanel.add(info);
    HorizontalPanel actionsPanel = new HorizontalPanel();
    actionsPanel.setHeight("30px");
    actionsPanel.setStylePrimaryName("lab-Header-Actions");
    MenuBar menu = new MenuBar(false);
    saveMenuItem = addMenuItem(menu, null, "Save Now", new CurrentDocumentSaveCommand(false));
    menu.addSeparator();
    saveAndCloseMenuItem = addMenuItem(menu, null, "Save & Close", new CurrentDocumentSaveAndCloseCommand());
    saveAndCloseMenuItem.setStylePrimaryName("lab-HighlightedMenuItem");
    actionsPanel.add(menu);
    table.setWidget(0, 0, titlePanel);
    table.setWidget(0, 1, actionsPanel);
    main.setWidget(1, 0, table);
  }
View Full Code Here

    this.getElement().getStyle().setZIndex(DIALOG_ZINDEX);
    titleLabel = new Label();
    titleLabel.setText(title);
    closeButton = new PushButton(Icons.editorIcons.CloseBlue().createImage());
    closeButton.setStylePrimaryName("CloseButton");
    mainPanel = new FlexTable();
    mainPanel.setCellSpacing(0);
    mainPanel.setCellPadding(0);
    mainPanel.setWidth("100%");
    mainPanel.insertRow(0);
    mainPanel.insertCell(0, 0);
View Full Code Here

   * The upper region contains the Google Docs links, status and logo.
   *
   * @return a table containing the upper controls
   */
  private void buildUpper() {
  FlexTable table = new FlexTable();
  table.setWidth("100%");
  table.setCellSpacing(0);
  table.setCellPadding(0);
  table.insertRow(0);
  table.insertCell(0, 0);
  table.insertCell(0, 1);
  table.getFlexCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);
    table.getFlexCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_LEFT);
  table.getFlexCellFormatter().setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_TOP);
    table.getFlexCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_RIGHT);
    table.getFlexCellFormatter().setStylePrimaryName(0, 0, "lab-Header-Links");
    table.getFlexCellFormatter().setStylePrimaryName(0, 1, "lab-Header-Links");
    /* Upper Header Panel */
    leftLinks = new HorizontalPanel();
    Anchor projectLink = new Anchor("Project", "http://code.google.com/p/latex-lab", "_blank");
    Anchor wikiLink = new Anchor("Wiki", "http://code.google.com/p/latex-lab/w/list", "_blank");
    Anchor issuesLink = new Anchor("Issues", "http://code.google.com/p/latex-lab/issues/list", "_blank");
    Anchor devLink = new Anchor("Development Version", "http://dev.latexlab.org/docs", "_blank");
    Anchor texLink = new Anchor("TeXnicCenter", "http://www.texniccenter.org/", "_blank");
    leftLinks.add(projectLink);
    leftLinks.add(wikiLink);
    leftLinks.add(issuesLink);
    leftLinks.add(devLink);
    leftLinks.add(texLink);
    rightLinks = new HorizontalPanel();
    author = new Label();
    Anchor docsLink = new Anchor("Docs Home", "http://docs.google.com/", "_blank");
    Anchor helpLink = new Anchor("Help", "http://code.google.com/p/latex-lab/wiki/UsingLaTeXLab", "_blank");
    Anchor acLink = new Anchor("Access Control", "https://www.google.com/accounts/IssuedAuthSubTokens", "_blank");
    signoutLink = new Anchor("Sign Out");
    signoutLink.addClickHandler(new ClickHandler(){
      public void onClick(ClickEvent event) {
        CommandEvent.fire(new SystemSignOutCommand());
      }
    });
    rightLinks.add(author);
    rightLinks.add(docsLink);
    rightLinks.add(acLink);
    rightLinks.add(helpLink);
    rightLinks.add(signoutLink);
    table.setWidget(0, 0, leftLinks);
    table.setWidget(0, 1, rightLinks);
    main.setWidget(0, 0, table);
  }
View Full Code Here

    searchLink.setTitle("Allows to search terms in all registered ontologies");
   
    linksPanel1.setSpacing(4);
    linksPanel2.setSpacing(4);
   
    FlexTable flexPanel = this;
    flexPanel.setWidth("100%");
//    flexPanel.setBorderWidth(1);
    int row = 0;
   
    flexPanel.getFlexCellFormatter().setRowSpan(row, 0, 2);
    flexPanel.setWidget(row, 0, Orr.images.mmior().createImage());
    flexPanel.getFlexCellFormatter().setWidth(row, 0, "10%");
    flexPanel.getFlexCellFormatter().setAlignment(row, 0,
        HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
    );

    flexPanel.setWidget(row, 1, linksPanel1);
    flexPanel.getFlexCellFormatter().setAlignment(row, 1,
        HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_TOP
    );

    row++;
    flexPanel.setWidget(row, 0, linksPanel2);
    flexPanel.getFlexCellFormatter().setAlignment(row, 0,
        HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_BOTTOM
    );
  }
View Full Code Here

   
    add(createForm(editing));
  }

  private Widget createForm(boolean editing) {
    FlexTable panel = new FlexTable();
   
    if ( ! editing ) {
      panel.setStylePrimaryName("MetadataPanel");
      panel.setBorderWidth(1);
    }
   
    int row = 0;

    if ( editing ) {
      String grpDescription = attrGroup.getDescription();
      if ( grpDescription != null && grpDescription.length() > 0 ) {
        Widget w = new Label(grpDescription);
        panel.getFlexCellFormatter().setColSpan(row, 0, 2);
        panel.setWidget(row, 0, w);
        panel.getFlexCellFormatter().setAlignment(row, 0,
            HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
        );
        row++;
      }
    }

   
   
   
    ChangeListener cl = null;
   
    if ( editing ) {
      cl = new ChangeListener () {
        public void onChange(Widget sender) {
          formChanged();
        }
      };
     
      CellPanel buttons = createButtons();
      panel.getFlexCellFormatter().setColSpan(row, 0, 2);
      panel.setWidget(row, 0, buttons);
      panel.getFlexCellFormatter().setAlignment(row, 0,
          HasHorizontalAlignment.ALIGN_RIGHT, HasVerticalAlignment.ALIGN_MIDDLE
      );
      row++;
    }
   

    AttrDef[] attrDefs = attrGroup.getAttrDefs();
    for ( AttrDef attr : attrDefs ) {
     
      if ( attr.isInternal() ) {
        continue;
      }
     
      Widget widget;
     
      // TODO: need to handle dynamic refresh of options? (Main.refreshOptions)
      final List<Option> options = attr.getOptions();
     
      final String optionsVocabulary = attr.getOptionsVocabulary();
     
      // not listBoxes if we are just viewing
     
      // Bofore, the following section was conditioned by:
//      if ( editing && options.size() > 0 ) {
      // and now by:
      if ( editing && (optionsVocabulary != null || options.size() > 0) ) {
       
        if ( Orr.getMetadataBaseInfo().getResourceTypeUri().equals(attr.getUri()) ) {
          // the special case for the "resourceType"
         
          // #183: Don't ask user whether the submitted ontology is a mapping
          boolean includeIsMapCheck = false;
         
          widget = resourceTypeWidget = new ResourceTypeWidget(attr, editing, includeIsMapCheck,
            new ChangeListener () {
              public void onChange(Widget sender) {
                  formChanged();
              }
            }
          );
        }
        else {
          boolean allowUserOption = attr.isAllowUserDefinedOption();
          if ( allowUserOption ) {
            widget = new FieldWithChoose(attr, cl);
          }
          else {
            ListBox listBox = OrrUtil.createListBox(options, cl);
            widget = listBox;
          }
        }
      }
      else if ( !editing ) {
        int nl = attr.getNumberOfLines();
        ViewOnlyCell voCell = new ViewOnlyCell(nl, "600");
        widget = voCell;
      }
      else {
        int nl = attr.getNumberOfLines();
        TextBoxBase tb = OrrUtil.createTextBoxBase(nl, "600", cl);
        widget = tb;
      }
     
      if ( resourceTypeWidget != null && resourceTypeWidget.resourceTypeAttrDef == attr ) {
        // we handle this as a special case.
      }
      else {
        widgets.put(attr.getUri(), new Elem(attr, widget));
      }
     
      String label = attr.getLabel();
      String tooltip = "<b>" +label+ "</b>:<br/>" +
                        attr.getTooltip() +
                        "<br/><br/><div align=\"right\">(" +attr.getUri()+ ")</div>";
      panel.setWidget(row, 0, new TLabel(label, editing && attr.isRequired(), tooltip ));
     
//      panel.getFlexCellFormatter().addStyleName(row, 0, "MetadataPanel-header");
      panel.getFlexCellFormatter().setWidth(row, 0, "250");
      panel.getFlexCellFormatter().setAlignment(row, 0,
          HasHorizontalAlignment.ALIGN_RIGHT, HasVerticalAlignment.ALIGN_MIDDLE
      );

      panel.setWidget(row, 1, widget);
      panel.getFlexCellFormatter().setAlignment(row, 1,
          HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
      );
      row++;
    }
   
View Full Code Here

  public Widget getWidget() {
    return widget;
  }

  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++;

    createUsernameAndPasswordTextBoxes();
   
    panel.setWidget(row, 0, new Label("Username:"));
    panel.setWidget(row, 1, userName);
    panel.getFlexCellFormatter().setAlignment(row, 0,
        HasHorizontalAlignment.ALIGN_RIGHT, HasVerticalAlignment.ALIGN_MIDDLE
    );
    panel.getFlexCellFormatter().setAlignment(row, 1,
        HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
    );
    row++;

    panel.setWidget(row, 0, new Label("Password:"));
    panel.setWidget(row, 1, userPassword);
    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, 2);
    panel.setWidget(row, 0, rememberMeCheckBox);
    panel.getFlexCellFormatter().setAlignment(row, 0,
        HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
    );

    HorizontalPanel loginCell = new HorizontalPanel();
    loginCell.add(loginButton);
    panel.setWidget(row, 1, loginCell);
    panel.getFlexCellFormatter().setAlignment(row, 1,
        HasHorizontalAlignment.ALIGN_RIGHT, 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++;
   
    HorizontalPanel infoResetPassword = new HorizontalPanel();
    infoResetPassword.setSpacing(3);
    infoResetPassword.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
    infoResetPassword.add(new HTML("Forgot your password?"));
   
    infoResetPassword.add(resetPasswordButton);
    panel.getFlexCellFormatter().setColSpan(row, 0, 3);
    panel.setWidget(row, 0, infoResetPassword);
    panel.getFlexCellFormatter().setAlignment(row, 0,
        HasHorizontalAlignment.ALIGN_RIGHT, HasVerticalAlignment.ALIGN_MIDDLE
    );
    row++;
   
    HorizontalPanel infoCreateAccount = new HorizontalPanel();
    infoCreateAccount.setSpacing(3);
    infoCreateAccount.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
    infoCreateAccount.add(new HTML("Not registered?"));
   
    infoCreateAccount.add(createAccountButton);
    panel.getFlexCellFormatter().setColSpan(row, 0, 3);
    panel.setWidget(row, 0, infoCreateAccount);
    panel.getFlexCellFormatter().setAlignment(row, 0,
        HasHorizontalAlignment.ALIGN_RIGHT, HasVerticalAlignment.ALIGN_MIDDLE
    );
    row++;
   
    userName.setFocus(true);
View Full Code Here

  }
 
 
  private FlexTable _getPropertiesTable(EntityInfo entity) {
   
    FlexTable flexPanel = new FlexTable();
    flexPanel.setStylePrimaryName("OntologyTable");
    flexPanel.setBorderWidth(1);
    flexPanel.setCellSpacing(4);
    FlexCellFormatter cf = flexPanel.getFlexCellFormatter();
   
    int row = 0;
   
//    String uri = entity.getUri();
//    cf.setColSpan(row, 0, 2);
//    flexPanel.setWidget(row, 0, new Label(uri));
//    cf.setStyleName(row, 0, "OntologyTable-header");
//    cf.setAlignment(row, 0, HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_TOP);
//    row++;
   
   
    flexPanel.setWidget(row, 0, new Label("Predicate"));
    cf.setStyleName(row, 0, "OntologyTable-header");
    cf.setAlignment(row, 0, HasHorizontalAlignment.ALIGN_RIGHT, HasVerticalAlignment.ALIGN_MIDDLE);
   
    flexPanel.setWidget(row, 1, new Label("Object"));
    cf.setStyleName(row, 1, "OntologyTable-header");
    cf.setAlignment(row, 1, HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE);
    row++;
   
    List<PropValue> props = entity.getProps();
    for ( PropValue pv : props ) {
     
      cf.setStyleName(row, 0, "OntologyTable-row");
      cf.setStyleName(row, 1, "OntologyTable-row");

      String htmlStr;
     
      // column 0
      String propName = pv.getPropName();
      String propUri = pv.getPropUri();
      if ( propName == null ) {
        propName = "?";
      }
      if ( propUri != null ) {
        Hyperlink link = new Hyperlink(propUri, propUri);
//        Hyperlink link = new Hyperlink(propName, propUri);
        if ( propUri != null ) {
          link.setTitle(propUri);
        }
        flexPanel.setWidget(row, 0, link);
      }
      else {
        htmlStr = propName;
        HTML html = new HTML("<b>" +htmlStr+ "</b>:");
        if ( propUri != null ) {
          html.setTitle(propUri);
        }
        flexPanel.setWidget(row, 0, html);
      }
      cf.setAlignment(row, 0, HasHorizontalAlignment.ALIGN_RIGHT, HasVerticalAlignment.ALIGN_TOP);

     
      // column 1
      String valueName = pv.getValueName();
      String valueUri = pv.getValueUri();
      if ( valueName == null ) {
        valueName = "?";
      }
      if ( valueUri != null ) {
        Hyperlink link = new Hyperlink(valueUri, valueUri);
//        Hyperlink link = new Hyperlink(valueName, valueUri);
        if ( valueUri != null ) {
          link.setTitle(valueUri);
        }
        flexPanel.setWidget(row, 1, link);
      }
      else {
        htmlStr = valueName;
        HTML html = new HTML(htmlStr);
        if ( valueUri != null ) {
          html.setTitle(valueUri);
        }
        flexPanel.setWidget(row, 1, html);
      }
      cf.setAlignment(row, 1, HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_TOP);

     
      row++;
View Full Code Here

 
  private Widget createAdvancedForm()
  {
    iJabConstants constants = (iJabConstants) GWT.create(iJabConstants.class);
      // Create a table to layout the form options
      FlexTable layout = new FlexTable();
      layout.setCellSpacing(6);
      layout.setWidth("300px");
      FlexCellFormatter cellFormatter = layout.getFlexCellFormatter();

      // Add a title to the form
      /*
      layout.setHTML(0, 0,constants.iJabLogin());
      cellFormatter.setColSpan(0, 0, 2);
      cellFormatter.setHorizontalAlignment(0, 0,
          HasHorizontalAlignment.ALIGN_CENTER);
  */
      // Add some standard form options
      final TextBox userBox = new TextBox();
      userBox.setText("imdev");
      layout.setHTML(0, 0, constants.user());
      layout.setWidget(0, 1, userBox);
      final PasswordTextBox  passBox = new PasswordTextBox ();
      passBox.setText("imdev631");
     
      layout.setHTML(1, 0, constants.password());
      layout.setWidget(1, 1, passBox);

      // Create some advanced options
      Grid advancedOptions = new Grid(5, 2);
      advancedOptions.setCellSpacing(6);
     
      final TextBox hostBox = new TextBox();
      final TextBox portBox = new TextBox();
      final TextBox domainBox = new TextBox();
      final CheckBox authCheck = new CheckBox("SASL");
      authCheck.setChecked(false);
     
      hostBox.setEnabled(false);
    portBox.setEnabled(false);
    domainBox.setEnabled(false);
    authCheck.setEnabled(false);
           
      final CheckBox serverConfig = new CheckBox(constants.defineServerConfig());
      advancedOptions.setWidget(0, 0, serverConfig);
      serverConfig.addClickListener(new ClickListener()
      {
      public void onClick(Widget sender) {
        if(serverConfig.isChecked())
        {
          hostBox.setEnabled(true);
          portBox.setEnabled(true);
          domainBox.setEnabled(true);
          authCheck.setEnabled(true);
        }
        else
        {
          hostBox.setEnabled(false);
          portBox.setEnabled(false);
          domainBox.setEnabled(false);
          authCheck.setEnabled(false);
        }
       
      }
       
      });
     
      serverConfig.setChecked(false);
     
      advancedOptions.setHTML(1, 0, constants.domain());
      advancedOptions.setWidget(1, 1, hostBox);
     
      advancedOptions.setHTML(2, 0, constants.host());
      advancedOptions.setWidget(2, 1, portBox);
     
      advancedOptions.setHTML(3, 0, constants.port());
      advancedOptions.setWidget(3, 1, domainBox);
     
      advancedOptions.setWidget(4, 0, authCheck);

      // Add advanced options to form in a disclosure panel
      DisclosurePanel advancedDisclosure = new DisclosurePanel(
          constants.moreOptions());
      advancedDisclosure.setAnimationEnabled(true);
      advancedDisclosure.ensureDebugId("cwDisclosurePanel");
      advancedDisclosure.setContent(advancedOptions);
      layout.setWidget(2, 0, advancedDisclosure);
     
      Button loginButton = new Button(constants.login());
     
      layout.setWidget(3, 0,loginButton);
      loginButton.addSelectionListener(new SelectionListener<ButtonEvent>()
      {
      public void componentSelected(ButtonEvent ce)
      {
        String user = userBox.getText();
View Full Code Here

  private ToolbarPart tools;
  private WindowManager windowManager;
 
  protected DocsAdvancedEditorView(String userEmail) {
  toolbars = new HashMap<String, ToolbarWindow>();
    contentPane = new FlexTable();
    contentPane.setWidth("100%");
    contentPane.setHeight("100%");
    contentPane.setCellSpacing(0);
    contentPane.setCellPadding(0);
    contentPane.setBorderWidth(0);
View Full Code Here

TOP

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

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.