net.sf.okapi.common.uidescription

## Class PathInputPart

- java.lang.Object
- - net.sf.okapi.common.uidescription.AbstractPart
  - - net.sf.okapi.common.uidescription.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.

- - ### Field Summary

    - ### Fields inherited from class net.sf.okapi.common.uidescription.AbstractPart

      `container, enabledOnSelection, labelFlushed, labelNextToInput, masterPart, paramDescriptor, vertical, withLabel`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PathInputPart(ParameterDescriptor paramDescriptor, java.lang.String browseTitle, boolean forSaveAs)` Creates a new PathInputPart object with a given parameter descriptor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `checkType()` Checks the types supported by this UI part.
    `java.lang.String` | `getBrowseTitle()` Gets the title of the path browsing dialog.
    `java.lang.String` | `getFilterExtensions()` Gets the extensions to use for the browse filter.
    `java.lang.String` | `getFilterNames()` Gets the names to used for the browse filter.
    `boolean` | `isAllowEmpty()` Indicates if the input text can be empty.
    `boolean` | `isForSaveAs()` Indicates if the path is to save a file (vs to open one).
    `void` | `setAllowEmpty(boolean allowEmpty)` Sets the flag indicating if the input text can be empty.
    `void` | `setBrowseFilters(java.lang.String filterNames, java.lang.String filterExtensions)` Sets the names and extensions to use for the browse filter.
    `void` | `setBrowseTitle(java.lang.String browseTitle)` Sets the title of the path browsing dialog.
    `void` | `setForSaveAs(boolean forSaveAs)` Sets the flag indicating if the path is to save a file (vs to open one).

    - ### Methods inherited from class net.sf.okapi.common.uidescription.AbstractPart

      `getContainer, getDisplayName, getMasterPart, getName, getParent, getReadMethod, getShortDescription, getType, getWriteMethod, isEnabledOnSelection, isLabelFlushed, isLabelNextToInput, isVertical, isWithLabel, setContainer, setDisplayName, setLabelFlushed, setLabelNextToInput, setMasterPart, setShortDescription, setVertical, setWithLabel`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PathInputPart

          public PathInputPart(ParameterDescriptor paramDescriptor,
                       java.lang.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 java.lang.String getFilterNames()

      Gets the names to used for the browse filter.
      Returns:
        the names to used for the browse filter.

    - #### getFilterExtensions

          public java.lang.String getFilterExtensions()

      Gets the extensions to use for the browse filter.
      Returns:
        the extensions to use for the browse filter.

    - #### setBrowseFilters

          public void setBrowseFilters(java.lang.String filterNames,
                              java.lang.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 java.lang.String getBrowseTitle()

      Gets the title of the path browsing dialog.
      Returns:
        the title of the path browsing dialog.

    - #### setBrowseTitle

          public void setBrowseTitle(java.lang.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.