Class DisplayColumn

java.lang.Object
org.applecommander.ui.DisplayColumn

public class DisplayColumn extends Object

A DisplayColumn supports formatted output from various FileStores in a dynamic fashion. The intent is to provide a flexible display interface across interfaces that does not rely on hard-coded implementations.

The Builder should be utilized to construct the DisplayColumn.

The read-only settings include:

  • title is the column title
  • alignment is the alignment of the column data
  • mode is the display mode that the column applies to (native, detail, or both)
  • columnDataType is the (simplified) data type
  • getValueFn is the method reference to get the column's value
  • formatFn is the function that takes the column's value and prepares it for display

The editable attributes are:

  • setValueFn is the method reference to set the value; note that the builder wraps the actual setter with a conversion function
  • editInLine indicates if this specific cell can be edited in a grid; at this time this is only used for the name field
  • maxLength is the maximum length of the input
  • options are the options available for selection
  • validCharacters is a CharacterMapper to transform input text
  • validInputPattern is a Pattern used to validate the input
  • Method Details

    • getTitle

      public String getTitle()
      The column title.
    • getAlignment

      public ColumnAlignment getAlignment()
      Retrieve the column alignment.
    • supports

      public boolean supports(DisplayMode mode)
      Indicates if this DisplayColumn supports the DisplayMode. In this manner, the columns can be filtered out. Or it can be ignored to display everything.
    • getDataType

      public ColumnDataType getDataType()
      Indicates the (generic) data type of this column.
    • getValue

      public Object getValue(FileEntry fileEntry)
      Get the column value for this FileEntry.
    • getDisplayText

      public String getDisplayText(FileEntry fileEntry)
      Convert the column into a formatted string for display.
    • formatObject

      public String formatObject(Object object)
      Explicitly format the object. This, for instance, is used by JavaFX when it is managing the data types.
    • setValue

      public void setValue(FileEntry fileEntry, String value)
    • isEditable

      public boolean isEditable()
      Indicates if this field is editable
    • canEditInLine

      public boolean canEditInLine()
      Indicates this column can be edited directly in the file viewer. Typically just the name.
    • getMaxLength

      public int getMaxLength()
      Indicates the maximum length for the input. 0 means not applicable.
    • getOptions

      public List<ColumnOption> getOptions()
      Get list of options (if any) when editing.
    • getValidCharacters

      public CharacterMapper getValidCharacters()
      Get the CharacterMapper that maps the input string into the valid set of characters.
    • getValidInputPattern

      public Pattern getValidInputPattern()
      Get the valid input regex. If input does not match this regex, it will be ignored. The intent is to be able to limit to numbers, or the valid filename characters.
    • builder

      public static <T extends FileEntry> DisplayColumn.Builder<T> builder(Class<T> fileEntryType)