Package org.jwall.web.policy

Examples of org.jwall.web.policy.TreeNode


       
    }
   
    public static String getPath( TreeNode res ){
        TreeNode cur = res;
        StringBuffer s = new StringBuffer();
       
        while( cur != null ){
            if( cur.getName().startsWith( "/" ) || ( s.length() > 0 && s.charAt( 0 ) == '/' ) )
                s.insert( 0, cur.getName() );
            else
                s.insert( 0, "/" + cur.getName() );

            cur = cur.getParent();
        }
       
        String p = s.toString();
       
        while( p.indexOf("//") >= 0 )
View Full Code Here


    String exp = rtmd.getRegularExpression();
    if( exp == null )
      return;
   
    try {
      TreeNode parent = node.getParent();
      mergeResources( parent, exp );
      rtm.notify( parent );
      return;
    } catch (Exception ex){
      ex.printStackTrace();
View Full Code Here

  {
    if( ! dst.matches( src ) )
      return;
   
    for( TreeNode ch : src.children() ){
      TreeNode dch = getAppopriateChild( dst, ch );
      if( dch == null ){
        dch = ch.copy();
      } else {
        merge( dch, ch );
      }
View Full Code Here

    dst.children().addAll( newChilds );
  }
 
 
  public void merge( Collection<TreeNode> nodes, TreeNode node ) throws SyntaxException{
    TreeNode dst = null;
   
    Iterator<TreeNode> it = nodes.iterator();
    while( dst == null && it.hasNext() ){
      dst = it.next();
      if(! dst.matches( node ) )
        dst = null;
    }
   
    if( dst == null ){
      nodes.add( node.copy() );
View Full Code Here

  public Object getChild(Object parent, int index) {
    log.debug("getChild( {}, {} )", parent, index);

    if (parent instanceof TreeNode) {
      TreeNode p = (TreeNode) parent;
      return p.getChildAt(index);
    }

    return null;
  }
View Full Code Here

  public int getChildCount(Object parent) {

    if (parent instanceof TreeNode) {

      TreeNode node = (TreeNode) parent;
      return node.children().size();
    }

    return 0;
  }
View Full Code Here

  }

  public int getIndexOfChild(Object parent, Object child) {
    if (parent instanceof TreeNode) {

      TreeNode node = (TreeNode) parent;
      return node.getIndex((TreeNode) child);
    }

    return 0;
  }
View Full Code Here

  public boolean isLeaf(Object node) {
    log.debug("isLeaf( {} )", node);

    if (node instanceof TreeNode) {
      TreeNode n = (TreeNode) node;

      return n.children().size() == 0;
    }

    return true;
  }
View Full Code Here

    if (e.getSource() == this.jtree) {
      if (jtree.getSelectionCount() == 0)
        WebPolicyEditor.getWindow().getStatusBar().setMessage("");
      else {

        TreeNode tn = (TreeNode) jtree.getSelectionPath()
            .getLastPathComponent();
        for (ResourceTreeSelectionListener rts : rtsListener)
          rts.treeNodeSelected(tn, this.rmodel.getProfile());
      }
    }
View Full Code Here

      return;
    }

    if (rmodel.isEditable() && e.getKeyCode() == KeyEvent.VK_F2) {
      if (jtree.getSelectionPath() != null) {
        TreeNode node = (TreeNode) jtree.getSelectionPath()
            .getLastPathComponent();
        if (node.isInherited()) {

          int r = JOptionPane
              .showConfirmDialog(
                  this,
                  "You are about to edit an inherited node. Your changes will affect all resources, which inherit this element.",
View Full Code Here

TOP

Related Classes of org.jwall.web.policy.TreeNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.