Class PathInputPart

  • All Implemented Interfaces:
    IParameterDescriptor

    public class PathInputPart
    extends AbstractPart
    UI part descriptor for a path. This UI part supports the following types: String and URI.

    Use setForSaveAs(boolean) to specify if the path is for saving a file (by default it is assumed the path is for saving a file). That choice affect which browsing dialog is invoked when using the browse button.

    • Constructor Detail

      • PathInputPart

        public PathInputPart​(ParameterDescriptor paramDescriptor,
                             String browseTitle,
                             boolean forSaveAs)
        Creates a new PathInputPart object with a given parameter descriptor.
        Parameters:
        paramDescriptor - the parameter descriptor for this UI part.
        browseTitle - the title to use for the path browsing dialog.
        forSaveAs - true if the path is to save a file (vs to open one).
    • Method Detail

      • checkType

        protected void checkType()
        Description copied from class: AbstractPart
        Checks the types supported by this UI part.
        Overrides:
        checkType in class AbstractPart
      • getFilterNames

        public String getFilterNames()
        Gets the names to used for the browse filter.
        Returns:
        the names to used for the browse filter.
      • getFilterExtensions

        public String getFilterExtensions()
        Gets the extensions to use for the browse filter.
        Returns:
        the extensions to use for the browse filter.
      • setBrowseFilters

        public void setBrowseFilters​(String filterNames,
                                     String filterExtensions)
        Sets the names and extensions to use for the browse filter. Both strings must have the same number of names/extensions parts separated by a \t. Use a semi-colon (;) to separate multiple extensions. For example: "Documents (*.txt;*.odt)\tAll Files (*.*)" and *.txt;*.odt\t*.*".
        Parameters:
        filterNames - the names to use for the browse filter.
        filterExtensions - the extensions to use for the browse filter.
      • getBrowseTitle

        public String getBrowseTitle()
        Gets the title of the path browsing dialog.
        Returns:
        the title of the path browsing dialog.
      • setBrowseTitle

        public void setBrowseTitle​(String browseTitle)
        Sets the title of the path browsing dialog.
        Parameters:
        browseTitle - the new title of the path browsing dialog.
      • isForSaveAs

        public boolean isForSaveAs()
        Indicates if the path is to save a file (vs to open one).
        Returns:
        true if the path is to save a file (vs to open one).
      • setForSaveAs

        public void setForSaveAs​(boolean forSaveAs)
        Sets the flag indicating if the path is to save a file (vs to open one).
        Parameters:
        forSaveAs - true if the path is to save a file (vs to open one).
      • isAllowEmpty

        public boolean isAllowEmpty()
        Indicates if the input text can be empty.
        Returns:
        true if the input text can be empty, false otherwise.
      • setAllowEmpty

        public void setAllowEmpty​(boolean allowEmpty)
        Sets the flag indicating if the input text can be empty.
        Parameters:
        allowEmpty - true if the input text can be empty, false otherwise.