Package org.jwall.web.policy.ext

Examples of org.jwall.web.policy.ext.CheckToken


            setText( "<html>Parameter Types</html>" );
            setIcon( WebPolicyEditor.getIcon( "org.jwall.web.policy.ParameterTypes" ) );
        }

        if( arg1.getType() == TreeNode.CHECK_TOKEN_NODE ){
            CheckToken ct = (CheckToken) arg1;

            StringBuffer s = new StringBuffer( "<html>Check Token: <i>" );

            s.append( ct.getToken() );
            s.append( "</i> " );

            if( ct.getValue() != null ){
                s.append( ", value: <i>" );
                s.append( ct.getValue() );
                s.append( "</i>" );
            }

            s.append( "</html>" );
            setText( s.toString() );
            setIcon( WebPolicyEditor.getIcon( "org.jwall.web.policy.CheckToken" ) );
        }

        if( arg1.getType() == TreeNode.CREATE_TOKEN_NODE ){
            CreateToken ct = (CreateToken) arg1;
            TimeFormat fmt = new TimeFormat();
            StringBuffer s = new StringBuffer( "<html>Create Token: <i>" );
            s.append( ct.getToken() );

            if( ct.getValue() != null ){
                s.append( "</i>, value: " );
                s.append( ct.getValue() );
            }
           
            s.append( "</i>, expires: <i>" );
            s.append( fmt.format( ct.getLifeTime().longValue() ) );
            s.append( "</i></html>" );
            setText( s.toString() );
            setIcon( WebPolicyEditor.getIcon( "org.jwall.web.policy.CreateToken" ) );
        }
View Full Code Here


      }

      if (AbstractTreeAction.TREE_INSERT_CHECKTOKEN == e
          .getActionCommand()) {
        log.debug("Inserting check-token node...");
        CheckToken ct = new CheckToken();

        node.add(ct);
        rmodel.notify(node);

        jtree.startEditingAtPath(new TreePath(PolicyTreeModel
View Full Code Here

      return inc;
    }

    if (nodeType == TreeNode.CHECK_TOKEN_NODE) {
      CheckToken ct = (CheckToken) node;
      if (name.getText() != null)
        ct.setToken(name.getText());

      if (value.getText() != null)
        ct.setValue(value.getText());

      return ct;
    }

    if (nodeType == TreeNode.CREATE_TOKEN_NODE) {
      CreateToken ct = (CreateToken) node;
      if (name.getText() != null) {
        ct.setToken(name.getText());
      }
      ct.setLifeTime(Long.parseLong(value.getText()) * 1000);

      if (value2.getText() != null)
        ct.setValue(value2.getText());

      return ct;
    }

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

      p.add(name);
    }

    if (node.getType() == TreeNode.CHECK_TOKEN_NODE) {
      CheckToken ct = (CheckToken) node;
      JLabel l1 = new JLabel("Token: ");
      l1.setFont(f);
      l1.setAlignmentY(Component.CENTER_ALIGNMENT);
      p.add(l1);

      name = new JTextField(10);
      name.addKeyListener(this);
      name.setAlignmentY(Component.CENTER_ALIGNMENT);
      name.setText(ct.getToken());

      p.add(name);

      value = new JTextField(6);
      value.addKeyListener(this);
      value.setAlignmentY(Component.CENTER_ALIGNMENT);
      value.setText(ct.getValue());

      p.add(value);
    }

    if (node.getType() == TreeNode.CREATE_TOKEN_NODE) {
      CreateToken ct = (CreateToken) node;
      JLabel l1 = new JLabel("Token: ");
      l1.setFont(f);
      l1.setAlignmentY(Component.CENTER_ALIGNMENT);
      p.add(l1);

      name = new JTextField(10);
      name.addKeyListener(this);
      name.setAlignmentY(Component.CENTER_ALIGNMENT);
      name.setText(ct.getToken());

      p.add(name);

      JLabel l3 = new JLabel("value: ");
      l3.setFont(f);
      l3.setAlignmentY(Component.CENTER_ALIGNMENT);
      p.add(l3);

      value2 = new JTextField(6);
      value2.setAlignmentY(Component.CENTER_ALIGNMENT);
      value2.addKeyListener(this);
      if (ct.getValue() != null)
        value2.setText(ct.getValue());
      p.add(value2);

      JLabel l2 = new JLabel("expires: ");
      l2.setFont(f);
      l2.setAlignmentY(Component.CENTER_ALIGNMENT);
      p.add(l2);

      value = new JTextField(8);
      value.setAlignmentY(Component.CENTER_ALIGNMENT);
      value.setText(ct.getLifeTime().toString());

      p.add(value);
    }

    if (node.getType() == TreeNode.LIMIT_NODE) {
View Full Code Here

TOP

Related Classes of org.jwall.web.policy.ext.CheckToken

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.