Package org.jwall.web.policy

Examples of org.jwall.web.policy.Resource


          setIcon( WebPolicyEditor.getIcon( ctx ) );
          return this;
        }

        if( arg1.getType() == TreeNode.RESOURCE_NODE ){
          Resource c = (Resource) arg1;
         
          String path = c.getName();
          if( path == null || path.equals( "" ) )
            path = "/";
         
          setText("<html><b>" + path + "</b>");
          setIcon( AbstractPolicyTreeRenderer.getIcon( c ) );
View Full Code Here


   
    resources = new Vector<AbstractTreeNode>();
    for( TreeNode ch : node.children() ){
      if( ch.getType() == TreeNode.RESOURCE_NODE ){
       
        Resource res = (Resource) ch;
        if( res.getName().matches(exp) ){
          resources.add( res );
        }
      }
    }
   
View Full Code Here

      return new String[0];
  }
 
  public void mergeResources( TreeNode node, String exp ) throws SyntaxException {
   
    Resource newRes = new Resource( exp );
   
    Vector<Resource> res = new Vector<Resource>();
    for( TreeNode ch : node.children() ){
      if( ch.getType() == TreeNode.RESOURCE_NODE ){
        Resource r = (Resource) ch;
        if( r.getName().matches( exp ) ){
          res.add( r);
          newRes.children().addAll( r.children() );
          //mergeChildren( newRes, r.children() );
          //for( TreeNode c : r.children() )
          //  merge( newRes.children(), c );
        }
      }
View Full Code Here

            setToolTipText("This node may be used for specifying the relative base-path of your profile.");
            return this;
        }

        if( arg1.getType() == TreeNode.RESOURCE_NODE ){
            Resource c = (Resource) arg1;

            String path = c.getName();
            if( path == null || path.equals( "" ) )
                path = "/";


            StringBuffer t = new StringBuffer( "<html>");

            if( c.isInherited() ){
                setInheritanceColors();
                t.append( "<i>" );
            }

            t.append("<b>" + path + "</b>" );

            if( c.hasExtensions() )
                t.append( ", extends: <b><i>" + c.getExtensionAsString() + "</i></b>" );

            if( c.isInherited() ){
                t.append( "</i>" );
            }

            t.append("</html>");

            setText( t.toString() );
            setIcon( AbstractPolicyTreeRenderer.getIcon( c ) );
            return this;
        }


        if( arg1.getType() == TreeNode.HEADER_NODE ){
            Header p = (Header) arg1;

            StringBuffer s = new StringBuffer("<html>");
            if( p.isInherited() ){
                setInheritanceColors();
                s.append("<i>");
            }

            s.append( "Header: <b>"+p.getName()+"</b>");

            s.append(", Regexp: <b>" + p.getRegexp() + "</b>");

            if( p.isRequired() )
                s.append(", Required: <b>"+p.isRequired()+"</b>");

            setText( s.toString() );
            setIcon( WebPolicyEditor.getIcon(p) );

            if( p.isInherited() )
                s.append("</i>");

            s.append("</html>");
            return this;
        }

        if( arg1.getType() == TreeNode.COOKIE_NODE ){
            Cookie c = (Cookie) arg1;

            StringBuffer s = new StringBuffer("<html>Cookie: <b>" + c.getName() + "</b>");
            s.append(", Regexp: <b>" + c.getRegexp() + "</b>" );
            if( c.isRequired() )
                s.append(", Required: <b>" + c.isRequired() + "</b>");

            s.append("</html>");
            setText( s.toString() );
            setIcon( WebPolicyEditor.getIcon( c ) );
            return this;
View Full Code Here

   */
  public void actionPerformed(ActionEvent e, AbstractTreeNode node) {
    log.debug("ClassTreeModel.actionPerformed( ActionEvent, TreeNode)");

    if (e.getActionCommand() == AbstractTreeAction.TREE_INSERT_RESOURCE) {
      Resource res = new Resource("class0");
      insertNode(node, res);

      if (node.getParent() != null)
        notify(node.getParent());

View Full Code Here

      if (AbstractTreeAction.TREE_INSERT_RESOURCE == e.getActionCommand()) {

        log.debug("Inserting new location...");

        Resource res = new Resource("Loc" + Resource.LAST_ID++);
        node.add(res);
        rmodel.notify(node);

        if (node.getParent() != null)
          rmodel.notify(node.getParent());
View Full Code Here

   */
  public LinkedList<TreeNode> getAllChildren(TreeNode node) {
    LinkedList<TreeNode> list = new LinkedList<TreeNode>(node.children());

    if (inherit != null && node.getType() == TreeNode.RESOURCE_NODE) {
      Resource r = (Resource) node;
      if (r.hasExtensions())
        list.addAll(inherit.getInheritedChildren(r));
    }

    if (filter != null) {

View Full Code Here

      m.setValue(name.getText());
      return m;
    }

    if (nodeType == TreeNode.RESOURCE_NODE) {
      Resource res = (Resource) node;
      res.setName(name.getText());
      if (value.getText() != null)
        res.setExtensions(value.getText().trim());

      return res;
    }

    if (nodeType == TreeNode.INCLUDE_FILTER_NODE) {
View Full Code Here

      p.setAlignmentY(Component.CENTER_ALIGNMENT);
      scope.addKeyListener(this);
    }

    if (node.getType() == TreeNode.RESOURCE_NODE) {
      Resource r = (Resource) node;
      JLabel l1 = new JLabel("Name: ");
      l1.setAlignmentY(Component.CENTER_ALIGNMENT);
      l1.setFont(f);
      p.add(l1);
      p.setAlignmentY(Component.CENTER_ALIGNMENT);

      name = new JTextField(10);
      name.setAlignmentY(Component.CENTER_ALIGNMENT);
      name.addKeyListener(this);
      name.setText(r.getName());

      p.add(name);

      if (r.getExtensions().length > 0) {
        JLabel l2 = new JLabel("extends: ");
        l2.setAlignmentY(Component.CENTER_ALIGNMENT);
        l2.setFont(f);
        p.add(l2);
        value = new JTextField(10);
        StringBuffer b = new StringBuffer();
        for (int i = 0; i < r.getExtensions().length; i++) {
          b.append(r.getExtensions()[i]);
          if (i + 1 < r.getExtensions().length)
            b.append(",");
        }
        value.setText(b.toString());
        value.setAlignmentY(Component.CENTER_ALIGNMENT);
        value.addFocusListener(this);
View Full Code Here

      if (AbstractTreeAction.TREE_INSERT_RESOURCE == e.getActionCommand()) {

        log.finest("Inserting new location...");

        Resource res = new Resource("Loc" + Resource.LAST_ID++);
        node.add(res);
        treeModel.notify(node);

        if (node.getParent() != null)
          treeModel.notify(node.getParent());
View Full Code Here

TOP

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

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.