Class LayoutProperty


  • public final class LayoutProperty
    extends Object
    Properties for layout algorithms that are used by the UI to fill the property sheet and thus allow user edit.
    Author:
    Mathieu Bastian
    • Constructor Detail

      • LayoutProperty

        public LayoutProperty​(org.openide.nodes.Node.Property property,
                              String category,
                              String canonicalName)
    • Method Detail

      • createProperty

        public static LayoutProperty createProperty​(Layout layout,
                                                    Class valueType,
                                                    String propertyName,
                                                    String propertyCategory,
                                                    String propertyDescription,
                                                    String getMethod,
                                                    String setMethod)
                                             throws NoSuchMethodException
        Create a property. The parameter propertyName will be used as the canonical name of the LayoutProperty.
        Parameters:
        layout - The layout instance
        valueType - The type of the property value, ex: Double.class
        propertyName - The display name of the property
        propertyCategory - A category string or null for using default category
        propertyDescription - A description string for the property
        getMethod - The name of the get method for this property, must exist to make Java reflexion working.
        setMethod - The name of the set method for this property, must exist to make Java reflexion working.
        Returns:
        the created property
        Throws:
        NoSuchMethodException - if the getter or setter methods cannot be found
      • createProperty

        public static LayoutProperty createProperty​(Layout layout,
                                                    Class valueType,
                                                    String propertyName,
                                                    String propertyCategory,
                                                    String propertyDescription,
                                                    String getMethod,
                                                    String setMethod,
                                                    Class<? extends PropertyEditor> editorClass)
                                             throws NoSuchMethodException
        Create a property, with a particular PropertyEditor. A particular editor must be specified when the property type don't have a registered editor class. The parameter propertyName will be used as the canonical name of the LayoutProperty.
        Parameters:
        layout - The layout instance
        valueType - The type of the property value, ex: Double.class
        propertyName - The display name of the property
        propertyCategory - A category string or null for using default category
        propertyDescription - A description string for the property
        getMethod - The name of the get method for this property, must exist to make Java reflexion working.
        setMethod - The name of the set method for this property, must exist to make Java reflexion working.
        editorClass - A PropertyEditor class for the given type
        Returns:
        the created property
        Throws:
        NoSuchMethodException - if the getter or setter methods cannot be found
      • createProperty

        public static LayoutProperty createProperty​(Layout layout,
                                                    Class valueType,
                                                    String propertyName,
                                                    String propertyCategory,
                                                    String propertyCanonicalName,
                                                    String propertyDescription,
                                                    String getMethod,
                                                    String setMethod)
                                             throws NoSuchMethodException
        Create a property. The parameter propertyName will be used as the canonical name of the LayoutProperty.
        Parameters:
        layout - The layout instance
        valueType - The type of the property value, ex: Double.class
        propertyName - The display name of the property
        propertyCategory - A category string or null for using default category
        propertyCanonicalName - Canonical name for the LayoutProperty. It should be unique and not localized
        propertyDescription - A description string for the property
        getMethod - The name of the get method for this property, must exist to make Java reflexion working.
        setMethod - The name of the set method for this property, must exist to make Java reflexion working.
        Returns:
        the created property
        Throws:
        NoSuchMethodException - if the getter or setter methods cannot be found
      • createProperty

        public static LayoutProperty createProperty​(Layout layout,
                                                    Class valueType,
                                                    String propertyName,
                                                    String propertyCategory,
                                                    String propertyCanonicalName,
                                                    String propertyDescription,
                                                    String getMethod,
                                                    String setMethod,
                                                    Class<? extends PropertyEditor> editorClass)
                                             throws NoSuchMethodException
        Create a property, with a particular PropertyEditor. A particular editor must be specified when the property type don't have a registered editor class. The parameter propertyName will be used as the canonical name of the LayoutProperty.
        Parameters:
        layout - The layout instance
        valueType - The type of the property value, ex: Double.class
        propertyName - The display name of the property
        propertyCategory - A category string or null for using default category
        propertyCanonicalName - Canonical name for the LayoutProperty. It should be unique and not localized
        propertyDescription - A description string for the property
        getMethod - The name of the get method for this property, must exist to make Java reflexion working.
        setMethod - The name of the set method for this property, must exist to make Java reflexion working.
        editorClass - A PropertyEditor class for the given type
        Returns:
        the created property
        Throws:
        NoSuchMethodException - if the getter or setter methods cannot be found
      • getProperty

        public org.openide.nodes.Node.Property getProperty()
        Return the underlying Property.
        Returns:
        the instance of Node.Property
      • getCategory

        public String getCategory()
        Return the category of the property
      • getCanonicalName

        public String getCanonicalName()