Class TableCombo


  • public class TableCombo
    extends java.lang.Object
    The TableCombo is used for a cell in a table in conjunction with a content provider.

    The table registers the comboboxes to use with an ID. Each instance is created from the table component prior to use in cells.

    This class is thread-safe.

    Author:
    Christopher Mindus
    • Field Summary

      Fields 
      Modifier and TypeFieldDescription
      intid
      The unique ID of this table combo instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      KString[]getKStringContents()
      Gets the contents as strings.
      java.lang.String[]getStringContents()
      Gets the contents as strings.
      UITablegetTable()
      Gets the table associated with this table combo.
      intgetType()
      Gets the contents type.
      booleanisEditable()
      Returns if this combo contents should be editable.
      voidsetKStringContents​(java.util.Collection<KString> list)
      Sets the KString contents of this combo.
      voidsetStringContents​(java.util.Collection<java.lang.String> list)
      Sets the string contents of this combo.
      java.lang.StringtoString()
      Converts to a debug string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • id

        public final int id
        The unique ID of this table combo instance.
    • Method Detail

      • getTable

        public UITable getTable()
        Gets the table associated with this table combo.
      • isEditable

        public boolean isEditable()
        Returns if this combo contents should be editable.
        Returns:
        true if it is editable by the user.
      • setStringContents

        public void setStringContents​(java.util.Collection<java.lang.String> list)
        Sets the string contents of this combo. It can only be set once.
        Parameters:
        list - The list of non-null strings.
        Throws:
        java.lang.NullPointerException - If the list is null or has null items.
        java.lang.IllegalStateException - If the contents already has been set.
      • setKStringContents

        public void setKStringContents​(java.util.Collection<KString> list)
        Sets the KString contents of this combo. It can only be set once.
        Parameters:
        list - The list of non-null KStrings.
        Throws:
        java.lang.NullPointerException - If the list is null or has null items.
        java.lang.IllegalStateException - If the contents already has been set.
      • getType

        public int getType()
        Gets the contents type.
        Returns:
        The contents type: -1 if not set, 0=String contents, 1=KString contents.
      • getStringContents

        public java.lang.String[] getStringContents()
        Gets the contents as strings.
        Returns:
        An array of strings, or null for not strings contents.
      • getKStringContents

        public KString[] getKStringContents()
        Gets the contents as strings.
        Returns:
        An array of strings, or null for not strings contents.
      • toString

        public java.lang.String toString()
        Converts to a debug string.
        Overrides:
        toString in class java.lang.Object