Esempio n. 1
0
 private void removeDisplay(PortletDisplayCategory pdc, PortletDefinition portletDefinition) {
   for (PortletDisplay pd : pdc.getPortletDisplayList()) {
     if (pd.getId().equals(portletDefinition.getPortletName())) {
       pdc.getPortletDisplayList().remove(pd);
       break;
     }
   }
 }
Esempio n. 2
0
 /**
  * 增加右键菜单
  *
  * @param manager
  */
 public void addMenuListener(IMenuManager manager) {
   DeletePortletAction deletePortletAction = new DeletePortletAction();
   manager.add(deletePortletAction);
   if (getParentItem() instanceof CategoryTreeItem) {
     PortletDisplayCategory portletDisplayCategory =
         (PortletDisplayCategory) getParentItem().getData();
     PortletDefinition portlet = (PortletDefinition) getData();
     for (PortletDisplay pd : portletDisplayCategory.getPortletDisplayList()) {
       if (pd.getId().equals(portlet.getPortletName())) {
         if (pd.getDynamic()) {
           manager.add(new DynamicAction(true, "checked.gif"));
         } else {
           manager.add(new DynamicAction(false, "un_checked.gif"));
         }
         break;
       }
     }
   }
 }