Examples of FlexCellFormatter


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

   
  }
 
  private void _addNoMappingsRow(int row) {
    flexPanel.getRowFormatter().setStyleName(row, "MappingsTable-row");
    FlexCellFormatter cf = flexPanel.getFlexCellFormatter();
//    _setAlignments(row);
    cf.setColSpan(row, 1, 3);
    cf.setAlignment(row, 1,
        HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_MIDDLE
    );
//    cf.setWidth(row, 1, "100%");
    HTML noYet = new HTML("<font color=\"gray\">(<i>No&nbsp;mappings</i>)</font>");
    flexPanel.setWidget(row, 0, noYet);
View Full Code Here

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

  private void _addRow(CheckBox cb, Widget left, Widget center, Widget right, String style,
      final MappingAssoc ma
  ) {
    final int row = flexPanel.getRowCount();
    FlexCellFormatter cf = flexPanel.getFlexCellFormatter();
    flexPanel.getRowFormatter().setStyleName(row, style);
   
   
    HorizontalPanel hp = new HorizontalPanel();
   
    if ( cb != null ) {
      hp.add(cb);
    }
   
//    hp.add(Main.images.delete().createImage());
   
    // #169: metadata association per mapping
    Widget mdWidget = _prepareMappingMetadata(row, ma);
    hp.add(mdWidget);
   
    flexPanel.setWidget(row, 0, new FocusableRowElement(row, hp));
   
    flexPanel.setWidget(row, 1, new FocusableRowElement(row, left));
   
    flexPanel.getCellFormatter().setStyleName(row, 2, "MappingsTable-row");
    flexPanel.setWidget(row, 2, new FocusableRowElement(row, center));
       
    flexPanel.setWidget(row, 3, new FocusableRowElement(row, right));

    if ( center instanceof Image ) {
      Image img = (Image) center;
      String width = String.valueOf(img.getWidth());
      cf.setWidth(row, 2, width);
    }   
    _setAlignments(row);
   
   
    // add (empty) row for expansion
    flexPanel.getRowFormatter().setStyleName(row + 1, style);
    cf.setColSpan(row + 1, 0, 4);
    cf.setAlignment(row + 1, 0,
        HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_MIDDLE
    );

  }
View Full Code Here

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

    );

  }
 
  private void _setAlignments(int row) {
    FlexCellFormatter cf = flexPanel.getFlexCellFormatter();
    cf.setAlignment(row, 0,
        HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
    );
    cf.setWidth(row, 1, "50%");
    cf.setWidth(row, 3, "50%");
     
    cf.setAlignment(row, 1,
        HasHorizontalAlignment.ALIGN_RIGHT, HasVerticalAlignment.ALIGN_MIDDLE
    );
    cf.setAlignment(row, 2,
        HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_MIDDLE
    );
    cf.setAlignment(row, 3,
        HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
    );
  }
View Full Code Here

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

   * @param y the the table row to add the cell to
   */
  private void addColorCell(FlexTable table, String color, int y) {
  int x = table.getCellCount(y);
  table.insertCell(y, x);
  FlexCellFormatter fcf = table.getFlexCellFormatter();
  fcf.setWidth(y, x, SWATCH_SIZE + "px");
  fcf.setHeight(y, x, SWATCH_SIZE + "px");
  Element el = fcf.getElement(y, x);
  el.getStyle().setBackgroundColor(color);
  }
View Full Code Here

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

   
    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

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

    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();
          String pass = passBox.getText();
          String domain = domainBox.getText();
          String host = domainBox.getText();
          boolean sasl = authCheck.isChecked();
          if(serverConfig.isChecked())
          {
            int port = Integer.parseInt(portBox.getText());
            //JabberApp.instance().onLogin(host, port, domain, sasl, user, pass);
          }
          else
          {
            //JabberApp.instance().onLogin(user, pass);
          }
      }
       
      });
    
      cellFormatter.setHorizontalAlignment(3, 0,
            HasHorizontalAlignment.ALIGN_CENTER);
     
      cellFormatter.setColSpan(3, 0, 2);

      return layout;
    }
View Full Code Here

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

                                            this.readOnly );

        layout.setWidget( 0,
                          0,
                          getPatternLabel( this.pattern ) );
        FlexCellFormatter formatter = layout.getFlexCellFormatter();
        formatter.setAlignment( 0,
                                0,
                                HasHorizontalAlignment.ALIGN_LEFT,
                                HasVerticalAlignment.ALIGN_BOTTOM );
        formatter.setStyleName( 0,
                                0,
                                "modeller-fact-TypeHeader" );

        List<FieldConstraint> sortedConst = sortConstraints( pattern.getFieldConstraints() );
        pattern.setFieldConstraints( sortedConst );
View Full Code Here

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

                          0,
                          createTextBox() );
        layout.setWidget( 0,
                          1,
                          createEditIcon() );
        FlexCellFormatter formatter = layout.getFlexCellFormatter();
        formatter.setAlignment( 0,
                                0,
                                HasHorizontalAlignment.ALIGN_LEFT,
                                HasVerticalAlignment.ALIGN_BOTTOM );
        //Let the TextArea expand the first cell to fit
        formatter.setWidth( 0,
                            0,
                            "1px" );

        formatter.setAlignment( 0,
                                1,
                                HasHorizontalAlignment.ALIGN_LEFT,
                                HasVerticalAlignment.ALIGN_TOP );

        if ( this.readOnly ) {
View Full Code Here

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

    table.setWidth(cm.getTotalWidth() + "px");

    List<HeaderGroupConfig> configs = cm.getHeaderGroups();

    FlexCellFormatter cf = table.getFlexCellFormatter();
    RowFormatter rf = table.getRowFormatter();

    rows = 0;
    for (HeaderGroupConfig config : configs) {
      rows = Math.max(rows, config.getRow() + 1);
    }
    rows += 1;

    for (int i = 0; i < rows; i++) {
      rf.setStyleName(i, "x-grid3-hd-row");
      rf.getElement(i).setAttribute("role", "presentation");
    }

    int cols = cm.getColumnCount();

    for (HeaderGroupConfig config : cm.getHeaderGroups()) {
      int col = config.getColumn();
      int row = config.getRow();
      int rs = config.getRowspan();
      int cs = config.getColspan();

      Group group = createNewGroup(config);
      group.render(DOM.createDiv());

      boolean hide = true;
      if (rows > 1) {
        for (int i = col; i < (col + cs); i++) {
          if (!cm.isHidden(i)) {
            hide = false;
          }
        }
      }
      if (hide) {
        continue;
      }

      table.setWidget(row, col, group);
      cf.setStyleName(row, col, "x-grid3-header x-grid3-hd x-grid3-cell");

      HorizontalAlignment align = config.getHorizontalAlignment();
      if (align == HorizontalAlignment.RIGHT) {
        cf.setHorizontalAlignment(row, col, HasHorizontalAlignment.ALIGN_RIGHT);
      } else if (align == HorizontalAlignment.LEFT) {
        cf.setHorizontalAlignment(row, col, HasHorizontalAlignment.ALIGN_LEFT);
      } else {
        cf.setHorizontalAlignment(row, col, HasHorizontalAlignment.ALIGN_CENTER);
      }

      int ncs = cs;
      if (cs > 1) {
        for (int i = col; i < (col + cs); i++) {
          if (cm.isHidden(i)) {
            ncs -= 1;
          }
        }
      }

      cf.setRowSpan(row, col, rs);
      cf.setColSpan(row, col, ncs);
    }

    for (int i = 0; i < cols; i++) {
      Head h = createNewHead(cm.getColumn(i));
      if (cm.isHidden(i)) {
        continue;
      }
      int rowspan = 1;
      if (rows > 1) {
        for (int j = rows - 2; j >= 0; j--) {
          if (!cm.hasGroup(j, i)) {
            rowspan += 1;
          }
        }
      }

      h.render(DOM.createDiv());
      int row;
      if (rowspan > 1) {
        row = (rows - 1) - (rowspan - 1);
      } else {
        row = rows - 1;
      }

      h.row = row;

      if (rowspan > 1) {
        table.setWidget(row, i, h);
        table.getFlexCellFormatter().setRowSpan(row, i, rowspan);
      } else {
        table.setWidget(row, i, h);
      }
      cf.setStyleName(row, i, "x-grid3-header x-grid3-hd x-grid3-cell x-grid3-td-" + cm.getColumnId(i));
      cf.getElement(row, i).setAttribute("role", "presentation");

      HorizontalAlignment align = cm.getColumnAlignment(i);
      if (align == HorizontalAlignment.RIGHT) {
        table.getCellFormatter().setHorizontalAlignment(row, i, HasHorizontalAlignment.ALIGN_RIGHT);
        table.getCellFormatter().getElement(row, i).getFirstChildElement().getStyle().setPropertyPx("paddingRight", 16);
View Full Code Here

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

    fileField.addClickHandler(fileSelectHandler);

    final TextBox idField = new TextBox();
    final HTML responseField = new HTML();
   
      final FlexCellFormatter cellFormatter = flexTable.getFlexCellFormatter();

    final TextBox usernameField = new TextBox();
    final PasswordTextBox passwordField = new PasswordTextBox();
    final Button loginButton = new Button("Login");
    final ScrollPanel scrollPanel = new ScrollPanel();

    submitButton.addStyleName("sendButton");
    submitButton.setEnabled(false);
    monitorButton.setEnabled(true);   
    goHomeButton.setEnabled(true);
   
    idField.setWidth("400px");
    responseField.setWidth("640px");
    responseField.setVisible(false);

    scrollPanel.add(flexTable);
    scrollPanel.setSize("800px", "600px");
    scrollPanel.addStyleName("cw-ScollPanel");
   
      flexTable.addStyleName("cw-FlexTable");
      flexTable.setCellSpacing(2);
      flexTable.setCellPadding(3);
   
    // Add the fields to the RootPanel
    if (RootPanel.get("nameFieldContainer") != null) {
      //main page
      RootPanel.get("nameFieldContainer").add(fileField);
      RootPanel.get("idFieldContainer").add(idField);
      RootPanel.get("sendButtonContainer").add(submitButton);
      RootPanel.get("responseContainer").add(responseField);
      RootPanel.get("monitorButtonContainer").add(monitorButton);
    }
    else if (RootPanel.get("usernameFieldContainer") != null) {
      //login page
      RootPanel.get("usernameFieldContainer").add(usernameField);
      RootPanel.get("passwordFieldContainer").add(passwordField);
      RootPanel.get("loginButtonContainer").add(loginButton);
    }
    else {
      //results page
      RootPanel.get("homeButtonContainer").add(goHomeButton);     
      RootPanel.get("tableContainer").add(scrollPanel);
        cellFormatter.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER);
        //cellFormatter.setColSpan(0, 0, 0); 
        //we no longer use timer scheduling, just run it once
        timer.run();     
      // Program a Timer to execute this every N seconds
        //no more auto-refresh: user will refresh manually
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.