Beispiel #1
0
  public TabItem getTab(Portlet portlet) {
    //	Search using the internal list, in case it's already been removed from the tabPanel by GXT
    for (List<TabItem> tabs : portletTabs) {
      for (TabItem tab : tabs) {
        for (Component component : tab.getItems()) {
          if (component.hashCode() == portlet.hashCode())
            if (component.getClass().getName().equals(portlet.getClass().getName())) {
              return tab;
            }
        }
      }
    }

    return null;
  }
Beispiel #2
0
  @Override
  public Portlet getByIdentity(String identity) {
    if (identity == null) return null;

    for (List<TabItem> tabs : portletTabs) {
      for (TabItem tab : tabs) {
        for (Component component : tab.getItems()) {
          if (component instanceof AppPortlet) {
            AppPortlet appPortlet = (AppPortlet) component;
            if (identity.equals(appPortlet.getPortletIdentity())) return appPortlet;
          }
        }
      }
    }

    return null;
  }