Пример #1
0
 @Override
 public void refreshAllPortletStates() {
   for (int col = 0; col < portletTabs.size(); col++) {
     List<TabItem> list = new ArrayList<TabItem>(portletTabs.get(col));
     for (int row = 0; row < list.size(); row++) {
       TabItem tab = list.get(row);
       if (tab.getItemCount() > 0 && tab.getItem(0) instanceof AppPortlet) {
         AppPortlet appPortlet = (AppPortlet) tab.getItem(0);
         appPortlet.updateUserPortlet(row, col);
       }
     }
   }
 }
Пример #2
0
 /** Remove all portlets (without recording them as closed in the user portlet cache) */
 public void removeAllPortlets() {
   for (int col = 0; col < portletTabs.size(); col++) {
     List<TabItem> list = new ArrayList<TabItem>(portletTabs.get(col));
     for (int row = 0; row < list.size(); row++) {
       TabItem tab = list.get(row);
       if (tab.getItemCount() > 0 && tab.getItem(0) instanceof AppPortlet) {
         AppPortlet appPortlet = (AppPortlet) tab.getItem(0);
         tab.remove(appPortlet);
       }
       tabPanel.remove(tab);
     }
   }
   portletTabs = new ArrayList<List<TabItem>>();
 }
Пример #3
0
 @Override
 public void onEnter(Component component, PreviewEvent pe) {
   if (!isManaged()) return;
   if (component instanceof HeaderItem) {
     pe.preventDefault();
     TabItem item = (TabItem) component.getParent();
     stepInto(item, pe, true);
   } else if (component instanceof TabPanel) {
     pe.preventDefault();
     TabPanel panel = (TabPanel) component;
     TabItem item = panel.getSelectedItem();
     if (item != null && item.getItemCount() > 0) {
       item.getItem(0).focus();
     }
   }
 }