Пример #1
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);
  }
Пример #2
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);
  }
Пример #3
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);
  }
Пример #4
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);
  }