Beispiel #1
0
  /**
   * Remove tab or tabpane.
   *
   * <p>If Tablink has TabPane,romve TabPane with TabLink. </pre>
   *
   * {@inheritDoc}
   */
  @Override
  public boolean remove(int index) {
    Widget widget = tabs.getWidget(index);

    if (widget instanceof TabLink) {
      TabLink link = (TabLink) widget;
      if (link.getTabPane() != null) {
        link.getTabPane().removeFromParent();
      }
      return tabs.remove(index);
    } else if (widget instanceof TabPane) {
      return tabContent.remove(widget);
    }

    return super.remove(widget);
  }
Beispiel #2
0
  /** {@inheritDoc} */
  @Override
  public boolean remove(IsWidget child) {

    if (child instanceof Tab) {
      Tab tab = (Tab) child;

      TabLink link = tab.asTabLink();

      if (link.getTabPane() != null) {
        link.getTabPane().removeFromParent();
      }
      return tabs.remove(link);
    } else if (child instanceof DropdownTab) {
      DropdownTab tab = (DropdownTab) child;

      List<Tab> tabList = tab.getTabList();

      for (Tab tab2 : tabList) {
        tabContent.remove(tab2.getTabPane());
      }
      return super.remove(child);
    }

    return super.remove(child);
  }
Beispiel #3
0
  private void add(TabPane child) {

    if (child.isCreateTabLink()) {
      TabLink tabLink = new TabLink(child);
      tabs.add(tabLink);
    }
    tabContent.add(child);
  }
Beispiel #4
0
  private void add(DropdownTab dropdownTab) {

    tabs.add(dropdownTab);

    List<Tab> tabList = dropdownTab.getTabList();
    for (Tab tab : tabList) {
      TabPane tabPane = tab.getTabPane();
      tabContent.add(tabPane);
    }
  }
Beispiel #5
0
  private void add(final TabLink child) {

    if (child.isCreateTabPane() && child.getTabPane() == null) {
      TabPane pane = new TabPane(child.getText());
      child.setTablePane(pane);
      tabContent.add(pane);
    } else if (child.getTabPane() != null) {
      tabContent.add(child.getTabPane());
    }
    tabs.add(child);
  }
Beispiel #6
0
  /**
   * remove TabLink or TabPane.
   *
   * <p>{@inheritDoc}
   */
  @Override
  public boolean remove(Widget w) {

    if (w instanceof TabLink) {
      TabLink link = (TabLink) w;

      if (link.getTabPane() != null) {
        link.getTabPane().removeFromParent();
      }
      return tabs.remove(w);
    } else if (w instanceof TabPane) {
      return tabContent.remove(w);
    }

    return super.remove(w);
  }
Beispiel #7
0
  public void setTabPosition(String position) {
    if (tabs.getParent() != null) {
      remove(tabs);
      remove(tabContent);
    }

    if (position.equalsIgnoreCase("below")) {
      setStyle(Bootstrap.Tabs.BELOW);
      super.add(tabContent);
      super.add(tabs);
    } else if (position.equalsIgnoreCase("left")) {
      setStyle(Bootstrap.Tabs.LEFT);
      super.add(tabs);
      super.add(tabContent);
    } else if (position.equalsIgnoreCase("right")) {
      setStyle(Bootstrap.Tabs.RIGHT);
      super.add(tabs);
      super.add(tabContent);
    } else {
      setStyle(Bootstrap.Tabs.ABOVE);
      super.add(tabs);
      super.add(tabContent);
    }
  }
Beispiel #8
0
 @Override
 public void clear() {
   tabContent.clear();
   tabs.clear();
 }