Class TreeControl.DefaultValueRepresentationStrategy<V>

    • Constructor Detail

      • DefaultValueRepresentationStrategy

        public DefaultValueRepresentationStrategy​(java.lang.Class<V> valueClass)
        Value class constructor with a default converter. This implementation uses a DefaultStringLiteralConverter.
        Parameters:
        valueClass - The class indicating the type of value to convert.
        Throws:
        java.lang.NullPointerException - if the given value class is null.
      • DefaultValueRepresentationStrategy

        public DefaultValueRepresentationStrategy​(Converter<V,​java.lang.String> converter)
        Converter constructor.
        Parameters:
        converter - The converter to use for displaying the value as a string.
        Throws:
        java.lang.NullPointerException - if the given converter is null.
    • Method Detail

      • getConverter

        public Converter<V,​java.lang.String> getConverter()
        Returns:
        The converter to use for displaying the value as a string.
      • createComponent

        public <N extends VComponent createComponent​(TreeControl treeControl,
                                                       TreeModel model,
                                                       TreeNodeModel<N> treeNode,
                                                       boolean editable,
                                                       boolean selected,
                                                       boolean focused)
        Creates a component to represent the given tree node.

        This implementation returns a label with string value of the given value using the object's toString() method.

        Type Parameters:
        N - The type of value contained in the node.
        Parameters:
        treeControl - The component containing the model.
        model - The model containing the value.
        treeNode - The node containing the value.
        editable - Whether values in this column are editable.
        selected - true if the value is selected.
        focused - true if the value has the focus.
        Returns:
        A new component to represent the given value.