/**
   * Create a Dynamic tree. The code comes from the GWT show case :
   * http://gwt.google.com/samples/Showcase/Showcase.html#!CwTabPanel
   */
  @SuppressWarnings("deprecation")
  private DecoratedTabPanel createTabPanel() {
    // Create a tab panel
    DecoratedTabPanel tabPanel = new DecoratedTabPanel();
    tabPanel.setWidth("400px");
    tabPanel.setAnimationEnabled(true);

    // Add a home tab
    String[] tabTitles = {"Home", "GWT Logo", "More info"};
    HTML homeText =
        new HTML("Click one of the tabs to see more content. <br/> You can drag me now !");
    tabPanel.add(homeText, tabTitles[0]);

    // Add a tab with an image
    /*
     * VerticalPanel vPanel = new VerticalPanel(); vPanel.add(new
     * Image(Showcase.images.gwtLogo()));
     */
    // TODO add gwt logo
    VerticalPanel vPanel = new VerticalPanel();
    vPanel.add(new com.google.gwt.user.client.ui.Image(Image.INSTANCE.gwtLogo()));
    tabPanel.add(new com.google.gwt.user.client.ui.Image(Image.INSTANCE.gwtLogo()), tabTitles[1]);

    // Add a tab
    HTML moreInfo = new HTML("Tabs are highly customizable using CSS.");
    tabPanel.add(moreInfo, tabTitles[2]);

    // Return the content
    tabPanel.selectTab(0);
    tabPanel.ensureDebugId("cwTabPanel");
    return tabPanel;
  }
Ejemplo n.º 2
0
 private void addTabPanel() {
   DecoratedTabPanel tPanel = new DecoratedTabPanel();
   tPanel.setWidth("450px");
   for (int i = 1; i <= 5; i++) {
     Widget tabContent = new TabPanelSampleContent(i);
     String tabLabel = "Panel " + i;
     tPanel.add(tabContent, tabLabel);
   }
   tPanel.selectTab(0);
   tPanel.setAnimationEnabled(true);
   RootPanel.get("tab-panel").add(tPanel);
 }
Ejemplo n.º 3
0
  private void initTabs() {

    // Create a tab panel
    final DecoratedTabPanel tabPanel = new DecoratedTabPanel();
    tabPanel.setAnimationEnabled(true);

    for (final ContactModel contactModel : contactList) {

      final FlexTable o_layout = new FlexTable();
      o_layout.setCellSpacing(6);
      FlexCellFormatter o_cellFormatter = o_layout.getFlexCellFormatter();
      o_cellFormatter.setColSpan(0, 0, 2);

      tabPanel.add(o_layout, contactModel.getNikeName());

      final ListBox dropBox = new ListBox(false);

      for (AlbumModel album : contactModel.getAlbumList()) {
        dropBox.addItem(album.getName());
      }

      o_layout.setWidget(0, 0, dropBox);

      dropBox.addChangeHandler(
          new ChangeHandler() {

            @Override
            public void onChange(ChangeEvent event) {
              initPhotoLayout(contactModel, dropBox.getSelectedIndex(), o_layout);
            }
          });

      tabPanel.addSelectionHandler(
          new SelectionHandler<Integer>() {
            @Override
            public void onSelection(SelectionEvent<Integer> event) {
              FlexTable currentPhotoTable = (FlexTable) tabPanel.getWidget(event.getSelectedItem());
              ListBox currentDropBox = (ListBox) currentPhotoTable.getWidget(0, 0);
              currentDropBox.setSelectedIndex(0);
            }
          });
      initPhotoLayout(contactModel, 0, o_layout);
    }

    tabPanel.selectTab(0);

    RootPanel.get("kirin_tabs").add(tabPanel);
  }
Ejemplo n.º 4
0
 public void loadTopHoriPanel() {
   final Irtk irtk = new Irtk();
   bizPanel.setWidth("100px");
   bizPanel.setAnimationEnabled(true);
   vendorPanel.add(revenueButton);
   bizPanel.add(vendorPanel, "Revenue");
   irtk.topHoriPanel.add(bizPanel);
   RootPanel.get("topPanel").add(bizPanel);
   revenueButton.addClickHandler(
       new ClickHandler() {
         public void onClick(ClickEvent event) {
           //  RootPanel.get("flexTable").remove(irtk.flexTable);
           // irtk.flexTable.removeAllRows();
           //  RootPanel.get("flexTable").add(irtk.flexTable);
           dialogBox.setText("Testing");
         }
       });
 }