@Override
 public void performAction(SiteNode sn) throws Exception {
   Session session = Model.getSingleton().getSession();
   String url = new URI(sn.getHierarchicNodeName(), false).toString();
   if (sn.isLeaf()) {
     url = Pattern.quote(url);
   } else {
     url = Pattern.quote(url + "/") + ".*";
   }
   session.getExcludeFromSpiderRegexs().add(url);
 }
예제 #2
0
 @Override
 public boolean isEnableForComponent(Component invoker) {
   treeSite = getTree(invoker);
   if (treeSite != null) {
     SiteNode node = (SiteNode) treeSite.getLastSelectedPathComponent();
     if (node != null && !node.isRoot()) {
       this.setEnabled(true);
     } else {
       this.setEnabled(false);
     }
     return true;
   }
   return false;
 }
예제 #3
0
 @Override
 public boolean isEnableForComponent(Component invoker) {
   contextId = -1;
   if (invoker instanceof JTree
       && SiteMapPanel.CONTEXT_TREE_COMPONENT_NAME.equals(invoker.getName())) {
     JTree contextTree = (JTree) invoker;
     SiteNode node = (SiteNode) contextTree.getLastSelectedPathComponent();
     if (node == null || node.isRoot()) {
       return false;
     }
     contextId = ((Target) node.getUserObject()).getContext().getIndex();
     return isEnabledForContext(contextId);
   }
   return false;
 }
예제 #4
0
 @Override
 public StructuralNode getParent() throws DatabaseException {
   if (parent == null && !this.isRoot()) {
     parent = new StructuralSiteNode((SiteNode) node.getParent());
   }
   return parent;
 }
 @Override
 public void performAction(SiteNode sn) {
   try {
     performAction(sn.getNodeName(), new StructuralSiteNode(sn).getRegexPattern());
   } catch (DatabaseException e) {
     // Ignore
   }
 }
예제 #6
0
  private void deleteHistory(HistoryReference ref) {

    if (ref == null) {
      return;
    }
    extension.removeFromHistoryList(ref);

    SiteNode node = ref.getSiteNode();
    if (node == null) {
      return;
    }

    Session session = Model.getSingleton().getSession();
    SiteMap map = session.getSiteTree();

    if (node.getHistoryReference() == ref) {
      // same active Node
      PopupDeleteMenu.delete(map, node);
    } else {
      node.getPastHistoryReference().remove(ref);
    }
  }