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

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


        return decPanel;
    }

    public DecoratorPanel getNoJNDIDbPanel() {
        layoutB.setCellSpacing( 6 );
        FlexCellFormatter cellFormatter = layoutB.getFlexCellFormatter();

        layoutB.setHTML( 0,
                         0,
                         "" );
        cellFormatter.setColSpan( 0,
                                  0,
                                  2 );
        cellFormatter.setHorizontalAlignment( 0,
                                              0,
                                              HasHorizontalAlignment.ALIGN_CENTER );

        layoutB.setHTML( 1,
                         0,
View Full Code Here


        return decPanel;
    }

    public DecoratorPanel getJNDIDbPanel() {
        layoutC.setCellSpacing( 6 );
        FlexCellFormatter cellFormatter = layoutC.getFlexCellFormatter();

        layoutC.setHTML( 0,
                         0,
                         "" );
        cellFormatter.setColSpan( 0,
                                  0,
                                  2 );
        cellFormatter.setHorizontalAlignment( 0,
                                              0,
                                              HasHorizontalAlignment.ALIGN_CENTER );

        layoutC.setHTML( 1,
                         0,
View Full Code Here

    tbody.<XElement> cast().removeChildren();
    DomHelper.insertHtml("afterBegin", tbody, renderHiddenHeaders(getColumnWidths()).asString());

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

    for (int i = 0; i < rows; i++) {
      rf.setStyleName(i, styles.headRow());
    }

    int cols = cm.getColumnCount();

    String cellClass = styles.header() + " " + styles.head();

    if (rows > 1) {
      Map<Integer, Integer> map = new HashMap<Integer, Integer>();
      for (int i = 0; i < rows - 1; i++) {
        for (HeaderGroupConfig config : cm.getHeaderGroups()) {
          int col = config.getColumn();
          int row = config.getRow();
          Integer start = map.get(row);

          if (start == null || col < start) {
            map.put(row, col);
          }
        }
      }
    }

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

      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, cellClass);

      HorizontalAlignmentConstant align = config.getHorizontalAlignment();
      cf.setHorizontalAlignment(row, col, align);

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

      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);
      }
      ColumnConfig<M, ?> cc = cm.getColumn(i);
      String s = cc.getCellClassName() == null ? "" : " " + cc.getCellClassName();
      cf.setStyleName(row, i, cellClass + s);
      cf.getElement(row, i).setPropertyInt("gridColumnIndex", i);

      HorizontalAlignmentConstant align = cm.getColumnAlignment(i);
      if (align != null) {
        table.getCellFormatter().setHorizontalAlignment(row, i, align);
        if (align == HasHorizontalAlignment.ALIGN_RIGHT) {
View Full Code Here

    }

    public DecoratorPanel getDbTypePanel() {
        FlexTable layoutA = new FlexTable();
        layoutA.setCellSpacing( 6 );
        FlexCellFormatter cellFormatter = layoutA.getFlexCellFormatter();

        // Add a title to the form
        layoutA.setHTML( 0,
                         0,
                         "RDBMS Info" );
        cellFormatter.setColSpan( 0,
                                  0,
                                  2 );
        cellFormatter.setHorizontalAlignment( 0,
                                              0,
                                              HasHorizontalAlignment.ALIGN_CENTER );

        layoutA.setHTML( 1,
                         0,
View Full Code Here

        return decPanel;
    }

    public DecoratorPanel getNoJNDIDbPanel() {
        layoutB.setCellSpacing( 6 );
        FlexCellFormatter cellFormatter = layoutB.getFlexCellFormatter();

        layoutB.setHTML( 0,
                         0,
                         "" );
        cellFormatter.setColSpan( 0,
                                  0,
                                  2 );
        cellFormatter.setHorizontalAlignment( 0,
                                              0,
                                              HasHorizontalAlignment.ALIGN_CENTER );

        layoutB.setHTML( 1,
                         0,
View Full Code Here

        return decPanel;
    }

    public DecoratorPanel getJNDIDbPanel() {
        layoutC.setCellSpacing( 6 );
        FlexCellFormatter cellFormatter = layoutC.getFlexCellFormatter();

        layoutC.setHTML( 0,
                         0,
                         "" );
        cellFormatter.setColSpan( 0,
                                  0,
                                  2 );
        cellFormatter.setHorizontalAlignment( 0,
                                              0,
                                              HasHorizontalAlignment.ALIGN_CENTER );

        layoutC.setHTML( 1,
                         0,
View Full Code Here

                0,
                vh );
        layout.getCellFormatter().setStyleName( 0,
                0,
                "metadata-Widget" ); //NON-NLS
        FlexCellFormatter formatter = layout.getFlexCellFormatter();
        formatter.setHorizontalAlignment( 0,
                0,
                HasHorizontalAlignment.ALIGN_LEFT );

        refresh = new ImageButton( images.refresh() );

        refresh.addClickHandler( clickHandler );

        layout.setWidget( 0,
                1,
                refresh );
        formatter.setHorizontalAlignment( 0,
                1,
                HasHorizontalAlignment.ALIGN_RIGHT );

        wrapper.setStyleName( "version-browser-Border" );
View Full Code Here

                        }

                        layout.setWidget( 1,
                                0,
                                history );
                        FlexCellFormatter formatter = layout.getFlexCellFormatter();

                        formatter.setColSpan( 1,
                                0,
                                2 );

                        Button open = new Button( constants.View() );

                        open.addClickHandler( new ClickHandler() {

                            public void onClick( ClickEvent event ) {
                                showVersion( history.getValue( history.getSelectedIndex() ) );
                            }

                        } );

                        layout.setWidget( 2,
                                0,
                                open );
                        formatter.setColSpan( 2,
                                1,
                                3 );
                        formatter.setHorizontalAlignment( 2,
                                1,
                                HasHorizontalAlignment.ALIGN_CENTER );

                        showStaticIcon();
View Full Code Here

  public GWT_SNS_Main() {
    //
    FlexTable layout = new FlexTable();
    layout.setCellSpacing(6);
    layout.setWidth(mainWidth+"px");
    FlexCellFormatter cellFormatter = layout.getFlexCellFormatter();
    //layout.setBorderWidth(1);
   
     
      cellFormatter.setColSpan(0, 0, 2);
      //将第一行合并成一行.
      cellFormatter.setHorizontalAlignment(0, 1,
          HasHorizontalAlignment.ALIGN_CENTER);
      //设置第一行的对齐是.中心对齐.
    layout.setWidget(0, 0, new TopPanel());
   
    //设置面板中间的部分.中间的部分是包括一个左菜单.和一个center.
    cellFormatter.setWidth(1, 0, (mainWidth * 0.15 )+"px" );
    cellFormatter.setWidth(1, 1, (mainWidth * 0.85 )+"px" );
    cellFormatter.setHorizontalAlignment(1, 0,
        HasHorizontalAlignment.ALIGN_CENTER);
    cellFormatter.setVerticalAlignment(1, 0,
        HasVerticalAlignment.ALIGN_TOP);
    cellFormatter.setHorizontalAlignment(1, 1,
        HasHorizontalAlignment.ALIGN_CENTER);
    cellFormatter.setVerticalAlignment(1, 1,
        HasVerticalAlignment.ALIGN_TOP);
   
   
    layout.setWidget(1, 0, new LeftPanel());
    layout.setWidget(1, 1, new CenterPanel());
View Full Code Here

        layout.setWidget(0, 0, new Image(images.question()));
        break;
    }

    layout.setWidget(0, 1, new HTML(msg));
    FlexCellFormatter cellFormatter = layout.getFlexCellFormatter();
    cellFormatter.setHorizontalAlignment(0, 1,
        HasHorizontalAlignment.ALIGN_CENTER);
    cellFormatter.setColSpan(1, 0, 2);
    cellFormatter.setColSpan(2, 0, 2);
    cellFormatter.setWidth(0, 0, "15%");
    cellFormatter.setWidth(0, 1, "85%");
    cellFormatter.setHorizontalAlignment(1, 0,
        HasHorizontalAlignment.ALIGN_CENTER);
    cellFormatter.setHorizontalAlignment(2, 0,
        HasHorizontalAlignment.ALIGN_CENTER);
    return layout;
  }
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.