javax.swing

Class JTree.DynamicUtilTreeNode

  • All Implemented Interfaces:
    Serializable, Cloneable, MutableTreeNode, TreeNode
    Enclosing class:
    JTree

    public static class JTree.DynamicUtilTreeNode
    extends DefaultMutableTreeNode
    DynamicUtilTreeNode can wrap vectors/hashtables/arrays/strings and create the appropriate children tree nodes as necessary. It is dynamic in that it will only create the children as necessary.

    Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see XMLEncoder.

    • Field Detail

      • hasChildren

        protected boolean hasChildren
        Does the this JTree have children? This property is currently not implemented.
      • childValue

        protected Object childValue
        Value to create children with.
      • loadedChildren

        protected boolean loadedChildren
        Have the children been loaded yet?
    • Constructor Detail

      • JTree.DynamicUtilTreeNode

        public JTree.DynamicUtilTreeNode(Object value,
                                 Object children)
        Creates a node with the specified object as its value and with the specified children. For the node to allow children, the children-object must be an array of objects, a Vector, or a Hashtable -- even if empty. Otherwise, the node is not allowed to have children.
        Parameters:
        value - the Object that is the value for the new node
        children - an array of Objects, a Vector, or a Hashtable used to create the child nodes; if any other object is specified, or if the value is null, then the node is not allowed to have children
    • Method Detail

      • createChildren

        public static void createChildren(DefaultMutableTreeNode parent,
                          Object children)
        Adds to parent all the children in children. If children is an array or vector all of its elements are added is children, otherwise if children is a hashtable all the key/value pairs are added in the order Enumeration returns them.
      • loadChildren

        protected void loadChildren()
        Loads the children based on childValue. If childValue is a Vector or array each element is added as a child, if childValue is a Hashtable each key/value pair is added in the order that Enumeration returns the keys.
      • getChildAt

        public TreeNode getChildAt(int index)
        Subclassed to load the children, if necessary.
        Specified by:
        getChildAt in interface TreeNode
        Overrides:
        getChildAt in class DefaultMutableTreeNode
        Parameters:
        index - an index into this node's child array
        Returns:
        the TreeNode in this node's child array at the specified index

Traduction non disponible

Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.

Document créé le 30/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/swing/jtree.dynamicutiltreenode.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.

Références

  1. Consulter le document html Langue du document :fr Manuel PHP : https://docs.oracle.com, JTree.DynamicUtilTreeNode

Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.

Table des matières Haut