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

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


      });
      table.setWidget(2, 0, metrics);
    }
    table.getFlexCellFormatter().setColSpan(2, 0, 2);
    table.getFlexCellFormatter().setRowSpan(1, 3, 2);
    final DecoratedTabPanel optpanel = new DecoratedTabPanel();
    optpanel.add(makeAxesPanel(), "Axes");
    optpanel.add(makeKeyPanel(), "Key");
    optpanel.add(makeStylePanel(), "Style");
    optpanel.selectTab(0);
    table.setWidget(1, 3, optpanel);

    final DecoratorPanel decorator = new DecoratorPanel();
    decorator.setWidget(table);
    final VerticalPanel graphpanel = new VerticalPanel();
    graphpanel.add(decorator);
    {
      final VerticalPanel graphvbox = new VerticalPanel();
      graphvbox.add(graphstatus);

      graph.setVisible(false);

      // Put the graph image element and the zoombox elements inside the absolute panel
      graphbox.add(graph, 0, 0);
      zoom_box.setVisible(false);
      graphbox.add(zoom_box, 0, 0);
      graph.addMouseOverHandler(new MouseOverHandler() {
        public void onMouseOver(final MouseOverEvent event) {
          final Style style = graphbox.getElement().getStyle();
          style.setCursor(Cursor.CROSSHAIR);
        }
      });
      graph.addMouseOutHandler(new MouseOutHandler() {
        public void onMouseOut(final MouseOutEvent event) {
          final Style style = graphbox.getElement().getStyle();
          style.setCursor(Cursor.AUTO);
        }
      });

      graphvbox.add(graphbox);
      graph.addErrorHandler(new ErrorHandler() {
        public void onError(final ErrorEvent event) {
          graphstatus.setText("Oops, failed to load the graph.");
        }
      });
      graph.addLoadHandler(new LoadHandler() {
        public void onLoad(final LoadEvent event) {
          graphbox.setWidth(graph.getWidth() + "px");
          graphbox.setHeight(graph.getHeight() + "px");
        }
      });

      graphpanel.add(graphvbox);
    }
    final DecoratedTabPanel mainpanel = new DecoratedTabPanel();
    mainpanel.setWidth("100%");
    mainpanel.add(graphpanel, "Graph");
    mainpanel.add(stats_table, "Stats");
    mainpanel.add(logs, "Logs");
    mainpanel.add(build_data, "Version");
    mainpanel.selectTab(0);
    mainpanel.addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>() {
      public void onBeforeSelection(final BeforeSelectionEvent<Integer> event) {
        clearError();
        final int item = event.getItem();
        switch (item) {
          case 1: refreshStats(); return;
View Full Code Here


   */
  @ShowcaseSource
  @Override
  public Widget onInitialize() {
    // Create a tab panel
    DecoratedTabPanel tabPanel = new DecoratedTabPanel();
    tabPanel.setWidth("400px");
    tabPanel.setAnimationEnabled(true);

    // Add a home tab
    String[] tabTitles = constants.cwTabPanelTabs();
    HTML homeText = new HTML(constants.cwTabPanelTab0());
    tabPanel.add(homeText, tabTitles[0]);

    // Add a tab with an image
    VerticalPanel vPanel = new VerticalPanel();
    vPanel.add(new Image(Showcase.images.gwtLogo()));
    tabPanel.add(vPanel, tabTitles[1]);

    // Add a tab
    HTML moreInfo = new HTML(constants.cwTabPanelTab2());
    tabPanel.add(moreInfo, tabTitles[2]);

    // Return the content
    tabPanel.selectTab(0);
    tabPanel.ensureDebugId("cwTabPanel");
    return tabPanel;
  }
View Full Code Here

  }

  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);
  }
View Full Code Here

        openHandler = createOpenHandler();

        TreeImages images = GWT.create(TreeImages.class);

        RootPanel rootPanel = RootPanel.get();
        DecoratedTabPanel decoratedTabPanel = new DecoratedTabPanel();
        decoratedTabPanel.setAnimationEnabled(true);
        rootPanel.add(decoratedTabPanel, 10, 10);
        decoratedTabPanel.setSize("870px", "480px");

        AbsolutePanel absolutePanel = new AbsolutePanel();
        absolutePanel.setSize("847px", "425px");

        DecoratorPanel decoratorPanelWest = new DecoratorPanel();
        absolutePanel.add(decoratorPanelWest, 10, 10);
        decoratorPanelWest.setSize("240px", "400px");

        AbsolutePanel treePanel = new AbsolutePanel();
        treePanel.setSize("230px", "395px");
        decoratorPanelWest.setWidget(treePanel);

        ScrollPanel treeScrollPanel = new ScrollPanel();
        treePanel.add(treeScrollPanel, 10, 10);
        treeScrollPanel.setSize("210px", "375px");

        final Tree tree = getTree(images);
        treeScrollPanel.setWidget(tree);

        final DecoratorPanel decoratorPanelCenter = new DecoratorPanel();

        absolutePanel.add(decoratorPanelCenter, 256, 10);
        decoratorPanelCenter.setSize("400px", "402px");

        AbsolutePanel centerAbsolutePanel = new AbsolutePanel();
        centerAbsolutePanel.setSize("97%", "100%");

        this.header = new HTML("Select an item");
        this.header.setDirectionEstimator(true);
        centerAbsolutePanel.add(this.header, 10, 10);
        this.header.setSize("450px", "50px");
        this.header.setStyleName("header-style");

        this.details = new HTML("No item selected");
        centerAbsolutePanel.add(this.details, 10, 76);
        this.details.setSize("450px", "156px");

        HTML html = new HTML("<hr />", true);
        centerAbsolutePanel.add(html, 10, 43);
        html.setSize("380px", "15px");

        this.frame = new NamedFrame("download-frame");
        frame.setStyleName("download-frame");
        rootPanel.add(frame);

        this.exportButton = new Button("Export site", new ClickHandler() {

            public void onClick(ClickEvent event) {
                frame.setUrl(exportHref);
            }
        });
        this.exportButton.setEnabled(false);
        centerAbsolutePanel.add(this.exportButton, 10, 359);
        decoratorPanelCenter.setWidget(centerAbsolutePanel);
        centerAbsolutePanel.setSize("400px", "393px");

        DecoratorPanel decoratorPanelEast = new DecoratorPanel();
        absolutePanel.add(decoratorPanelEast, 672, 10);
        decoratorPanelEast.setSize("165px", "405px");
        AbsolutePanel absolutePanelImportLink = new AbsolutePanel();
        absolutePanelImportLink.setSize("162px", "395px");

        final Anchor importAnchor = new Anchor("Import site");
        absolutePanelImportLink.add(importAnchor, 10, 10);
        importAnchor.setWidth("90%");

        decoratorPanelEast.setWidget(absolutePanelImportLink);

        decoratedTabPanel.add(absolutePanel, "Export/Import sites", false);
        importAnchor.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {
                DialogBox dialogBox = createDialogBox();
                dialogBox.setPopupPosition(267, 60);
                dialogBox.show();
            }
        });

        decoratedTabPanel.selectTab(0);
    }
View Full Code Here

TOP

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

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.