コード例 #1
0
ファイル: AppTabPortal.java プロジェクト: blacatena/SBAM-Dev
  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;
  }
コード例 #2
0
ファイル: AppTabPortal.java プロジェクト: blacatena/SBAM-Dev
  @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;
  }