Class ToolEntry

    • Field Detail

      • PALETTE_TYPE_TOOL

        public static final java.lang.Object PALETTE_TYPE_TOOL
        Type Identifier
    • Constructor Detail

      • ToolEntry

        public ToolEntry​(java.lang.String label,
                         java.lang.String shortDesc,
                         ImageDescriptor iconSmall,
                         ImageDescriptor iconLarge)
        Creates a new ToolEntry. Any parameter can be null.
        Parameters:
        label - the entry's name
        shortDesc - the entry's description
        iconSmall - the entry's small icon
        iconLarge - the entry's large icon
      • ToolEntry

        public ToolEntry​(java.lang.String label,
                         java.lang.String description,
                         ImageDescriptor iconSmall,
                         ImageDescriptor iconLarge,
                         java.lang.Class tool)
        Constructor to create a new ToolEntry. Any parameter can be null.
        Parameters:
        label - the entry's name
        description - the entry's description
        iconSmall - the entry's small icon
        iconLarge - the entry's large icon
        tool - the type of tool that this entry uses
        Since:
        3.1
    • Method Detail

      • createTool

        public Tool createTool()
        Creates the tool of the type specified by setToolClass(Class) for this ToolEntry. The tool is also configured with the properties set in setToolProperty(Object, Object). Sub-classes overriding this method should ensure that their tools are also configured with those properties.
        Returns:
        the tool for this entry
      • getToolProperty

        public java.lang.Object getToolProperty​(java.lang.Object key)
        Returns the property value for the specified property key.
        Parameters:
        key - the property key
        Returns:
        the value for the requested property
        Since:
        3.1
      • setToolClass

        public void setToolClass​(java.lang.Class toolClass)
        Sets the type of tool to be created. This provides clients with a method of specifying a different type of tool to be created without having to sub-class. The provided class should have a default constructor for this to work successfully.
        Parameters:
        toolClass - the type of tool to be created by this entry
        Since:
        3.1
      • setToolProperty

        public void setToolProperty​(java.lang.Object key,
                                    java.lang.Object value)
        Clients can use this method to configure the associated tool without having to sub-class.
        Parameters:
        key - the property name
        value - a value of type associated with the given property
        Since:
        3.1
        See Also:
        Tool.setProperties(Map)