net.sf.okapi.common.uidescription

## Class AbstractPart

- java.lang.Object
- - net.sf.okapi.common.uidescription.AbstractPart

- All Implemented Interfaces:
    IParameterDescriptor
  Direct Known Subclasses:
    CheckboxPart, CheckListPart, CodeFinderPart, FolderInputPart, ListSelectionPart, PathInputPart, SeparatorPart, SpinInputPart, TextInputPart, TextLabelPart

      public abstract class AbstractPart
      extends java.lang.Object
      implements IParameterDescriptor

  Base UI part descriptor. All other UI part descriptors are derived from this one.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected IContainerPart` | `container`
    `protected boolean` | `enabledOnSelection`
    `protected boolean` | `labelFlushed`
    `protected boolean` | `labelNextToInput`
    `protected AbstractPart` | `masterPart`
    `protected ParameterDescriptor` | `paramDescriptor`
    `protected boolean` | `vertical`
    `protected boolean` | `withLabel`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractPart(ParameterDescriptor paramDescriptor)` Creates a new BasePart object with a given parameter description.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `checkType()` Checks the types supported by this UI part.
    `IContainerPart` | `getContainer()` Gets the container part of this part.
    `java.lang.String` | `getDisplayName()` Gets the localizable name of this parameter.
    `AbstractPart` | `getMasterPart()` Gets the master part associated with this UI part.
    `java.lang.String` | `getName()` Gets the programming name of this parameter.
    `java.lang.Object` | `getParent()` Gets the object where this parameter is instantiated.
    `java.lang.reflect.Method` | `getReadMethod()` Gets the method to obtain the current value of this parameter.
    `java.lang.String` | `getShortDescription()` Gets the short localizable description of this parameter.
    `java.lang.reflect.Type` | `getType()` Gets the type of this parameter.
    `java.lang.reflect.Method` | `getWriteMethod()` Gets the method to set a new value for this this parameter.
    `boolean` | `isEnabledOnSelection()` Indicates how this part is enabled in relation to its master part.
    `boolean` | `isLabelFlushed()` Indicates if the label of this UI part should be flushed next to the part.
    `boolean` | `isLabelNextToInput()` Indicates that the label for this part is to be displayed next to the input field.
    `boolean` | `isVertical()` Indicates if this UI part should be arranged vertically.
    `boolean` | `isWithLabel()` Indicates if this UI part should be displayed with a label.
    `void` | `setContainer(IContainerPart container)` Sets the container part for this part.
    `void` | `setDisplayName(java.lang.String displayName)` Sets the localizable name of this parameter.
    `void` | `setLabelFlushed(boolean labelFlushed)` Sets the flag indicating if the label of this UI part should be flushed next to the part.
    `void` | `setLabelNextToInput(boolean labelNextToInput)` Sets the indicator that tells if the label for this part is to be displayed next to the input field.
    `void` | `setMasterPart(AbstractPart masterPart, boolean enabledOnSelection)` Binds this part to a master part.
    `void` | `setShortDescription(java.lang.String shortDescription)` Gets the short localizable description of this parameter.
    `void` | `setVertical(boolean vertical)` Sets the flag indicating if this UI part should be arranged vertically.
    `void` | `setWithLabel(boolean withLabel)` Sets the flag indicating if this UI part should be displayed with a label.

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

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

- - ### Field Detail

    - #### paramDescriptor

          protected ParameterDescriptor paramDescriptor

    - #### container

          protected IContainerPart container

    - #### vertical

          protected boolean vertical

    - #### labelFlushed

          protected boolean labelFlushed

    - #### withLabel

          protected boolean withLabel

    - #### labelNextToInput

          protected boolean labelNextToInput

    - #### masterPart

          protected AbstractPart masterPart

    - #### enabledOnSelection

          protected boolean enabledOnSelection

  - ### Constructor Detail

    - #### AbstractPart

          public AbstractPart(ParameterDescriptor paramDescriptor)

      Creates a new BasePart object with a given parameter description.
      Parameters:
        `paramDescriptor` - the parameter description for this UI part.

  - ### Method Detail

    - #### getDisplayName

          public java.lang.String getDisplayName()

      Description copied from interface: `IParameterDescriptor`
      Gets the localizable name of this parameter.
      Specified by:
        `getDisplayName` in interface `IParameterDescriptor`
      Returns:
        the localizable name of this parameter.

    - #### getName

          public java.lang.String getName()

      Description copied from interface: `IParameterDescriptor`
      Gets the programming name of this parameter. the name must follow the JavaBean naming conventions. For example, a parameter accessible by `getMyText` and `setMyText` must be named `myText`
      Specified by:
        `getName` in interface `IParameterDescriptor`
      Returns:
        the programming name of this parameter.

    - #### getParent

          public java.lang.Object getParent()

      Description copied from interface: `IParameterDescriptor`
      Gets the object where this parameter is instantiated.
      Specified by:
        `getParent` in interface `IParameterDescriptor`
      Returns:
        the object where this parameter is instantiated.

    - #### getReadMethod

          public java.lang.reflect.Method getReadMethod()

      Description copied from interface: `IParameterDescriptor`
      Gets the method to obtain the current value of this parameter.
      Specified by:
        `getReadMethod` in interface `IParameterDescriptor`
      Returns:
        the method to get the current value of this parameter.

    - #### getShortDescription

          public java.lang.String getShortDescription()

      Description copied from interface: `IParameterDescriptor`
      Gets the short localizable description of this parameter.
      Specified by:
        `getShortDescription` in interface `IParameterDescriptor`
      Returns:
        the short localizable description of this parameter.

    - #### getType

          public java.lang.reflect.Type getType()

      Description copied from interface: `IParameterDescriptor`
      Gets the type of this parameter.
      Specified by:
        `getType` in interface `IParameterDescriptor`
      Returns:
        the type of this parameter.

    - #### getWriteMethod

          public java.lang.reflect.Method getWriteMethod()

      Description copied from interface: `IParameterDescriptor`
      Gets the method to set a new value for this this parameter.
      Specified by:
        `getWriteMethod` in interface `IParameterDescriptor`
      Returns:
        the method to set a new value of this parameter.

    - #### setDisplayName

          public void setDisplayName(java.lang.String displayName)

      Description copied from interface: `IParameterDescriptor`
      Sets the localizable name of this parameter.
      Specified by:
        `setDisplayName` in interface `IParameterDescriptor`
      Parameters:
        `displayName` - the new localizable name of this parameter.

    - #### setShortDescription

          public void setShortDescription(java.lang.String shortDescription)

      Description copied from interface: `IParameterDescriptor`
      Gets the short localizable description of this parameter.
      Specified by:
        `setShortDescription` in interface `IParameterDescriptor`
      Parameters:
        `shortDescription` - the new short localizable description of this parameter.

    - #### isWithLabel

          public boolean isWithLabel()

      Indicates if this UI part should be displayed with a label. When this option is not set: no label is displayed and the entry field takes the space where the label would be.
      Returns:
        true if this UI part should be displayed with a label.

    - #### setWithLabel

          public void setWithLabel(boolean withLabel)

      Sets the flag indicating if this UI part should be displayed with a label.
      Parameters:
        `withLabel` - true if this UI part should be displayed with a label.

    - #### isVertical

          public boolean isVertical()

      Indicates if this UI part should be arranged vertically. By default it is not.
      Returns:
        true if this UI part should be arranged vertically.

    - #### setVertical

          public void setVertical(boolean vertical)

      Sets the flag indicating if this UI part should be arranged vertically.
      Parameters:
        `vertical` - the new flag indicating if this UI part should be arranged vertically.

    - #### isLabelFlushed

          public boolean isLabelFlushed()

      Indicates if the label of this UI part should be flushed next to the part.
      Returns:
        true if the label of this UI part should be flushed next to the part.

    - #### setLabelFlushed

          public void setLabelFlushed(boolean labelFlushed)

      Sets the flag indicating if the label of this UI part should be flushed next to the part.
      Parameters:
        `labelFlushed` - the new flag indicating if the label of this UI part should be flushed next to the part.

    - #### getContainer

          public IContainerPart getContainer()

      Gets the container part of this part.
      Returns:
        the container part of this part or null.

    - #### setContainer

          public void setContainer(IContainerPart container)

      Sets the container part for this part.
      Parameters:
        `container` - the new container part for this part.

    - #### setMasterPart

          public void setMasterPart(AbstractPart masterPart,
                                    boolean enabledOnSelection)

      Binds this part to a master part. Use this to make this part be enabled or disabled depending on the specified master part.
      Parameters:
        `masterPart` - the UI part that enables or disables this part.
        `enabledOnSelection` - true if this part is enabled only when the master part is selected, false to enable this part when the master part is not selected.

    - #### getMasterPart

          public AbstractPart getMasterPart()

      Gets the master part associated with this UI part.
      Returns:
        the master part associated with this UI part, or null if there is none.

    - #### isEnabledOnSelection

          public boolean isEnabledOnSelection()

      Indicates how this part is enabled in relation to its master part.
      Returns:
        true if this part is enabled only when the master part is selected, false to enable this part when the master part is not selected.

    - #### isLabelNextToInput

          public boolean isLabelNextToInput()

      Indicates that the label for this part is to be displayed next to the input field.
      Returns:
        true if the label for this part is to be displayed next to the input field.

    - #### setLabelNextToInput

          public void setLabelNextToInput(boolean labelNextToInput)

      Sets the indicator that tells if the label for this part is to be displayed next to the input field.
      Parameters:
        `labelNextToInput` - true to set the indicator so the label for this part is to be displayed next to the input field.

    - #### checkType

          protected void checkType()

      Checks the types supported by this UI part.
      Throws:
        `OkapiNotImplementedException` - if this UI part does not support the type of the parameter description it is created with.