Beispiel #1
0
  public void deleteNode() {
    String projectPath = LFWPersTool.getProjectWithBcpPath();
    String projectModuleName = LFWPersTool.getCurrentProjectModuleName();
    PortletApplicationDefinition portletApp =
        PortalConnector.getPortletApp(projectPath, projectModuleName);
    PortletDefinition portletDefinition = (PortletDefinition) this.getData();
    if (portletApp.getPortlet(portletDefinition.getPortletName()) != null) {
      portletApp.getPortlets().remove(portletApp.getPortlet(portletDefinition.getPortletName()));
      PortalConnector.savePortletAppToXml(projectPath, projectModuleName, portletApp);
    }

    /** 删除 portlet分类中的配置 */
    if (this.getParentItem() instanceof CategoryTreeItem) {
      Display display = PortalConnector.getDisplay(projectPath, projectModuleName);
      PortletDisplayCategory portletDisplayCategory =
          (PortletDisplayCategory) this.getParentItem().getData();
      for (PortletDisplayCategory pdc : display.getCategory()) {
        if (pdc.getId().equals(portletDisplayCategory.getId())) {
          removeDisplay(pdc, portletDefinition);
          break;
        }
      }
      PortalConnector.saveDisplayToXml(projectPath, projectModuleName, display);
    }
    dispose();
  }
 private void refreshNode() {
   Tree tree = LFWPersTool.getTree();
   TreeItem[] tis = tree.getSelection();
   if (tis == null || tis.length == 0) return;
   TreeItem ti = tis[0];
   ti.removeAll();
   LFWExplorerTreeView.getLFWExploerTreeView(null).refreshDirtoryTreeItem();
 }