Package com.ca.commons.naming

Examples of com.ca.commons.naming.RDN


        {
            for (int i=0; i<cobbleStones.length; i++)
            {
                SmartNode sn = ((SmartNode) cobbleStones[i]);
               
                RDN rdn = sn.getRDN();
                if (rdn.isEmpty() == false)  
                {            
                    newDN.addChildRDN(rdn);
                }   
            }   
        }
View Full Code Here


       
        // for each tree level, grab the current node pointer (parent)

        for (int i=0;i< nodeDN.size();i++)
        {
            RDN rdn = nodeDN.getRDN(i);

            Enumeration children = parent.children();
            parent = null;
           
            // search children trying to find matching RDN
View Full Code Here

   
    // - and who would have thought such a simple task could get so nickity -
    
    protected String getUniqueCopyRDN(DN activeDN, DN copyDN)
    {
        RDN testRDN =   copyDN.getLowestRDN();
        String testValue = copyDN.getLowestRDN().getRawVal();
        String testClass = copyDN.getLowestRDN().getAtt();

        // XXX translation of this is ugly!  Can't see how to improve it off hand however.
        String copyPrefix = testClass + "=" + CBIntText.get("Copy");
        String copyPrefix2 = CBIntText.get("of");
       
        boolean originalExists = false;
       
        int copyNumber = 0;

        SmartNode parent = getNodeForDN(activeDN);
       
        if (parent != null// can't think why it *would* equal null, mind you...
        {
            Enumeration children = parent.children();

            /**
             *    Loop through all children, doing two things;
             *    a) check if there is already a child with the name
             *       we're going to add (i.e. we need to do find a new name)
             *    b) check if there are already copies (i.e we need to
             *       produce a unique "Copy (512) of ..." name)
             */
      
            SmartNode child;
            while (children.hasMoreElements())
            {
                child = (SmartNode)children.nextElement();
                RDN childRDN = child.getRDN();
                String childRDNString = childRDN.toString();
                if ((!originalExists ) && childRDN.equals(testRDN))   // test if there is already a doo-dad of this name
                {
                    originalExists = true;    // ... there is, we have work to do!
                }
               
                if (childRDNString.startsWith(copyPrefix)==true) // we have a contender
View Full Code Here

    {
        if ((nodeDN==null)) return false;

        if (nodeDN.size()==0) return false;

        RDN nodeRDN = nodeDN.getLowestRDN();
        SmartNode parent = getNodeForDN(nodeDN.parentDN());
        SmartNode child = null;

        Enumeration children = parent.children();
View Full Code Here

        void setValue(SmartNode node)
        {
            this.node = node;

            RDN rdn = node.getRDN();

            int size = rdn.size();

            multi = node.isMultiValued();
       
            trimExcessComponents();           // just clearing the decks.
       
            Dimension prefSize = renderer.getPreferredSize();
       
            setSize(prefSize);

            first.setText(rdn.getRawVal(0))// this is the last step for single valued RDNs
   
            /*
             *    Handle possible multi-valued components by
             *    alternately adding '+' sign labels and
             *    more text fields.
             */
            
            for (int i=1; i<size; i++)
            {
                makeLight();
                JLabel plus = new JLabel("+");
                plus.setForeground(Color.red);
                add(plus);
                makeHeavy();
                JTextField nextField = new JTextField(rdn.getRawVal(i));
                nextField.setBorder(thinBorder);
                nextField.addActionListener(listener);
                add(nextField);
            }   
           
View Full Code Here

         *    @return the newly edited RDN.
         */
        
        RDN getValue()
        {
            RDN returnRDN = node.getRDN();
           
            try
            {
/*               
                if (multi==false)
                {
                    returnRDN.setRawVal(first.getText());
                    return returnRDN;
                }
                else
                {
*/               
                    int size = getComponentCount();
                    for (int i=0; i<size; i = i+2)
                    {
                        JTextField currentTextField = (JTextField) getComponent(i);
                        String text = currentTextField.getText();
                        text = text.trim();
                        if (text.length() == 0)
                            text = " ";
                        returnRDN.setRawVal(text, (i/2));
                    }
                    return returnRDN;
//                }
            }
            catch (NamingException e)
View Full Code Here

TOP

Related Classes of com.ca.commons.naming.RDN

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.