Examples of FlexCellFormatter


Examples of com.google.gwt.gen2.table.override.client.FlexTable.FlexCellFormatter

   * Test ghost row count with spans.
   */
  public void testGhostRowSpans() {
    // Initialize the table
    FixedWidthFlexTable testTable = getFixedWidthFlexTable();
    FlexCellFormatter cellFormatter = testTable.getFlexCellFormatter();
    for (int row = 0; row < 3; row++) {
      for (int cell = 0; cell < 3; cell++) {
        testTable.setHTML(row, cell, "");
      }
    }

    // Set colspan
    assertGhostCount(3, testTable);
    cellFormatter.setColSpan(0, 1, 3);
    assertGhostCount(5, testTable);
    cellFormatter.setColSpan(0, 1, 2);
    assertGhostCount(4, testTable);
    cellFormatter.setColSpan(0, 1, 1);
    assertGhostCount(3, testTable);
    cellFormatter.setColSpan(0, 1, 0);
    assertGhostCount(3, testTable);

    // Set rowspan
    assertGhostCount(3, testTable);
    cellFormatter.setRowSpan(0, 1, 3);
    assertGhostCount(4, testTable);
    cellFormatter.setRowSpan(0, 1, 2);
    assertGhostCount(4, testTable);
    cellFormatter.setRowSpan(0, 1, 1);
    assertGhostCount(3, testTable);
  }
View Full Code Here

Examples of com.google.gwt.gen2.table.override.client.FlexTable.FlexCellFormatter

   */
  private FixedWidthFlexTable createHeaderTable() {
    FixedWidthFlexTable headerTable = new FixedWidthFlexTable();

    // Level 1 headers
    FlexCellFormatter headerFormatter = headerTable.getFlexCellFormatter();
    headerTable.setHTML(0, 0, "User Information");
    headerFormatter.setColSpan(0, 0, 13);

    // Create the select all checkbox
    final CheckBox selectAll = new CheckBox();
    selectAll.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        if (selectAll.getValue()) {
          getDataTable().selectAllRows();
        } else {
          getDataTable().deselectAllRows();
        }
      }
    });

    // Level 2 headers
    headerTable.setWidget(1, 0, selectAll);
    headerFormatter.setRowSpan(1, 0, 2);
    headerFormatter.setHorizontalAlignment(1, 0,
        HasHorizontalAlignment.ALIGN_CENTER);
    headerTable.setHTML(1, 1, "First and Last Name");
    headerFormatter.setColSpan(1, 1, 2);
    headerFormatter.setRowSpan(1, 1, 2);
    headerTable.setHTML(1, 2, "General Info");
    headerFormatter.setColSpan(1, 2, 3);
    headerTable.setHTML(1, 3, "Favorite Color");
    headerFormatter.setColSpan(1, 3, 1);
    headerFormatter.setRowSpan(1, 3, 2);
    headerTable.setHTML(1, 4, "Preferred Sport");
    headerFormatter.setColSpan(1, 4, 1);
    headerFormatter.setRowSpan(1, 4, 2);
    headerTable.setHTML(1, 5, "School Info");
    headerFormatter.setColSpan(1, 5, 3);
    headerTable.setHTML(1, 6, "Login Info");
    headerFormatter.setColSpan(1, 6, 2);

    // Level 3 headers
    headerTable.setHTML(2, 0, "Age");
    headerTable.setHTML(2, 1, "Gender");
    headerTable.setHTML(2, 2, "Race");
View Full Code Here

Examples of com.google.gwt.gen2.table.override.client.FlexTable.FlexCellFormatter

    // Add the main layout to the page
    layout.setWidth("99%");
    layout.setCellPadding(0);
    layout.setCellSpacing(5);
    final FlexCellFormatter formatter = layout.getFlexCellFormatter();
    RootPanel.get().add(layout);

    // Initialize the tables
    {
      // Create the tables
      scrollTable = createScrollTable();
      scrollTable.setHeight("400px");

      // Add the scroll table to the layout
      layout.setWidget(0, 1, scrollTable);
      formatter.setWidth(0, 1, "100%");
      formatter.setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_TOP);
    }

    // Initialize the options menu
    {
      // Attach a tree listener
      Tree menu = new Tree();
      menu.addSelectionHandler(new SelectionHandler<TreeItem>() {
        public void onSelection(SelectionEvent<TreeItem> event) {
          Widget option = optionMap.get(event.getSelectedItem());
          if (option != null) {
            optionWrapper.setWidget(option);
          }
        }
      });

      // Add it to the layout inside a scroll panel
      ScrollPanel scrollPanel = new ScrollPanel(menu);
      scrollPanel.setAlwaysShowScrollBars(true);
      scrollPanel.setPixelSize(MENU_WIDTH, MENU_HEIGHT);
      scrollPanel.getElement().getStyle().setProperty("border",
          "1px solid #999");
      layout.setWidget(0, 0, scrollPanel);
      formatter.setWidth(0, 0, MENU_WIDTH + "px");
      formatter.setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);

      // Initialize the options in the menu
      initOptions(menu);
    }

    // Initialize the options area
    {
      optionWrapper.getElement().getStyle().setProperty("borderTop",
          "3px solid #aaa");
      optionWrapper.setWidget(new Label("Select an option from the menu"));
      layout.setWidget(1, 0, optionWrapper);
      formatter.setColSpan(1, 0, 2);
      formatter.setHorizontalAlignment(1, 0,
          HasHorizontalAlignment.ALIGN_CENTER);
    }

    // Do any required post processing
    onModuleLoaded();
View Full Code Here

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

                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

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

                        }

                        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

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

        boolean isRTL = LocaleInfo.getCurrentLocale().isRTL();
        topPanel = new FlexTable();
        topPanel.setCellPadding(0);
        topPanel.setCellSpacing(0);
        topPanel.setStyleName(DEFAULT_STYLE_NAME + "-top");
        FlexCellFormatter formatter = topPanel.getFlexCellFormatter();

        // Setup the links cell
        linksPanel = new HorizontalPanel();
        topPanel.setWidget(0, 0, linksPanel);
        formatter.setStyleName(0, 0, DEFAULT_STYLE_NAME + "-links");
        if (isRTL) {
            formatter.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_LEFT);
        } else {
            formatter.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT);
        }
        formatter.setColSpan(0, 0, 2);

        // Setup the title cell
        setTitleWidget(null);
        formatter.setStyleName(1, 0, DEFAULT_STYLE_NAME + "-title");

        formatter.setStyleName(1, 1, DEFAULT_STYLE_NAME + "-options");
        if (isRTL) {
            formatter.setHorizontalAlignment(1, 1, HasHorizontalAlignment.ALIGN_LEFT);
        } else {
            formatter.setHorizontalAlignment(1, 1, HasHorizontalAlignment.ALIGN_RIGHT);
        }

        RowFormatter rowFormatter = topPanel.getRowFormatter();

        // Align the content to the top
View Full Code Here

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

    super(true, true);
    setStylePrimaryName(DEFAULT_STYLENAME);

    // Wrap contents in a table
    layoutTable = new FlexTable();
    FlexCellFormatter formatter = layoutTable.getFlexCellFormatter();
    layoutTable.setCellSpacing(0);
    setWidget(layoutTable);

    // Add a label
    setLabel("");
    formatter.setColSpan(0, 0, 3);

    // Add content widget
    layoutTable.setWidget(1, 0, content);

    // Add accept and cancel buttons
View Full Code Here

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

   */
  private DecoratorPanel createDecoratedForm() {
    // Create a table to layout the form options
    FlexTable layout = new FlexTable();
    layout.setCellSpacing(6);
    FlexCellFormatter cellFormatter = layout.getFlexCellFormatter();

    // Add a title to the form
    layout.setHTML(0, 0, "Enter Search Criteria");
    cellFormatter.setColSpan(0, 0, 2);
    cellFormatter.setHorizontalAlignment(0, 0,
        HasHorizontalAlignment.ALIGN_CENTER);

    // Add some standard form options
    layout.setHTML(1, 0, "Name");
    layout.setWidget(1, 1, new TextBox());
View Full Code Here

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

     
     
      FlexTable flexPanel = new FlexTable();
      flexPanel.setStylePrimaryName("DisclosureTable");
      flexPanel.setCellSpacing(4);
      FlexCellFormatter cf = flexPanel.getFlexCellFormatter();
     
      int row = 0;
     
      cf.setColSpan(row, 0, 2);
      flexPanel.setWidget(row, 0, new HTML("<a target=\"_blank\" href=\"" +uriResLink+ "\">" +uri+ "</a>"));
      cf.setAlignment(row, 0, HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_TOP);
      row++;
     
     
      List<PropValue> props = entity.getProps();
      for ( PropValue pv : props ) {
       
        String htmlStr;
        HTML html;
       
        // column 0
        html = new HTML();
        String propName = pv.getPropName();
        String propUri = pv.getPropUri();
        if ( propName == null ) {
          propName = "?";
        }
        if ( propUri != null ) {
          htmlStr = "<a target=\"_blank\" href=\"" +propUri+ "\">" +propName+ "</a>";
        }
        else {
          htmlStr = propName;
        }
        html.setHTML("<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
        html = new HTML();
        String valueName = pv.getValueName();
        String valueUri = pv.getValueUri();
        if ( valueName == null ) {
          valueName = "?";
        }
        if ( valueUri != null ) {
          htmlStr = "<a target=\"_blank\" href=\"" +valueUri+ "\">" +valueName+ "</a>";
          html.setHTML(htmlStr);
        }
        else {
          htmlStr = valueName;
          html.setText(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

    Widget title = new TLabel("Mappings",
          "Lists the current mappings.. "
    );
   
   
    FlexCellFormatter cf = flexPanel.getFlexCellFormatter();
    cf.setColSpan(row, 1, 3);
    cf.setAlignment(row, 1,
        HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_MIDDLE
    );
    cf.setWidth(row, 1, "100%");
    flexPanel.setWidget(row, 1, title);
    row++;
   
  }
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.