Class UITableColumn

All Implemented Interfaces:
EventListener, IMessageBox, IComponent, ICustomDataProvider, IGProp<GProp<?>[]>, IPropCnr, IUIComp, IUIHTMLTextComponent, IUITextComponent, IVSColumnBestValueListener, IVSColumnListener, IVSComponentListener, IVSComponentState, IVSFieldListener, IVSTableColumnReferenceOwner, Cloneable
Direct Known Subclasses:
EUITableColumn

public class UITableColumn extends UIComp implements IUIHTMLTextComponent, IVSTableColumnReferenceOwner, IVSColumnListener
The table column UI container.
Author:
Christopher Mindus
  • Field Details

    • ROW_CELL_HORIZONTAL_ALIGN

      public static final String ROW_CELL_HORIZONTAL_ALIGN
      The property name: row cell horizontal alignment.
      See Also:
    • ROW_CELL_VERTICAL_ALIGN

      public static final String ROW_CELL_VERTICAL_ALIGN
      The property name: row cell horizontal alignment.
      See Also:
    • FILTER_COLUMN

      public static final String FILTER_COLUMN
      The property name: column filtering.
      See Also:
  • Constructor Details

    • UITableColumn

      public UITableColumn()
      Creates the container without name with a null value.
    • UITableColumn

      public UITableColumn(Atom propertyAtom)
      Creates the container with the specified name with a null value.
      Parameters:
      propertyAtom - the property atom.
    • UITableColumn

      public UITableColumn(Atom propertyAtom, GProp<?>[] properties) throws PropException
      Creates the container with the specified name and properties.
      Parameters:
      propertyAtom - the property atom.
      properties - the property array value for the container.
      Throws:
      PropException - when properties are not correctly defined.
  • Method Details

    • getDeviceType

      public final int getDeviceType()
      Gets the device type: -1=mobile, 0=both, 1=desktop.
      Specified by:
      getDeviceType in interface IUIComp
      Returns:
      Zero: 0=both.
    • clone

      public UITableColumn clone()
      Creates a clone out of this property. The cloning is overridden by the subclasses in order to handle cloning of its class variables appropriately.
      Overrides:
      clone in class UIComp
    • onEventSelf

      public void onEventSelf(GEvent event)
      Event checking to clear cache.
      Specified by:
      onEventSelf in interface IGProp<GProp<?>[]>
      Overrides:
      onEventSelf in class UIComp
      Parameters:
      event - The property event.
    • isFilterColumn

      public boolean isFilterColumn()
      Get the filtering column flag.
      Returns:
      true (default) if this column is used for filtering, false to ignore the column.
    • setFilterColumn

      public boolean setFilterColumn(boolean on)
      Sets the filtering column flag.
      Parameters:
      on - true if this column is used for filtering, false to ignore the column.
      Returns:
      true for changed, false for no change.
    • getTable

      public UITable getTable()
      Gets the table instance.
      Returns:
      The table, or null if table column is orphaned.
    • isUnhidable

      public boolean isUnhidable()
      Returns if the column is unhidable, used when the table option for column hiding is enabled.
      Returns:
      true, the column cannot be hidden, false for column hidable.
    • setUnhidable

      public boolean setUnhidable(boolean isUnhidable)
      Sets the column unhidable state, used when the table option for column hiding is enabled.
      Parameters:
      isUnhidable - The new unhidable state: true, the column cannot be hidden, false for column hidable.
      Returns:
      true for value changed, false for no change.
    • isHidden

      public boolean isHidden()
      Returns if the column is initially hidden, used when the table option for column hiding is enabled and the unhidable option for the column is false.
      Returns:
      true, the column is initially hidden, false for column visible.
    • setHidden

      public boolean setHidden(boolean isHidden)
      Sets the column initially hidden state, used when the table option for column hiding is enabled and the unhidable option for the column is false.
      Parameters:
      isHidden - the new column hidden state: true, the column is initially hidden, false for column visible.
      Returns:
      true for value changed, false for no change.
    • getRowCellHorizontalAlignment

      public int getRowCellHorizontalAlignment()
      Gets the row cell horizontal alignment.
      Returns:
      0=default, 4=left, 44=leading, 5=center, 6=right, 66=trailing.
    • getRowCellVerticalAlignment

      public int getRowCellVerticalAlignment()
      Gets the row cell vertical alignment.
      Returns:
      0=default (middle), 8=top, 5=middle or 2=bottom.
    • getBestVSColumnHeaderValueType

      public Value.Type getBestVSColumnHeaderValueType(VSRelativeReference<?> reference)
      Requests the value type that would best suit the listener.
      Specified by:
      getBestVSColumnHeaderValueType in interface IVSColumnBestValueListener
      Parameters:
      reference - The VSRelativeReference instance holding the reference.
      Returns:
      Value.Type.String is the best standard representation (not HTML with KString).
    • getVSColumn

      public VSColumnHeader getVSColumn()
      Gets the VS column for this table column.
      Returns:
      The VS column, or null for none.
    • getVSTable

      public VSTable getVSTable()
      Gets the VS table.
      Returns:
      The VS table, or null if not connected.
    • getVSTable

      public VSTable getVSTable(VSTableColumnReference ref)
      Gets the VSTable for a VSTableColumnReference instance.
      Specified by:
      getVSTable in interface IVSTableColumnReferenceOwner
      Parameters:
      ref - The reference instance, null when property-editing the reference in the Designer.
      Returns:
      The table for the reference, or null if not found.
    • getVSTableReferenceOwnerData

      public VSReferenceOwnerData<VSTable,VSTableReference> getVSTableReferenceOwnerData()
      Gets the table reference owner data for the table column reference.
      Specified by:
      getVSTableReferenceOwnerData in interface IVSTableColumnReferenceOwner
      Returns:
      The VSReferenceOwnerData instance, always non-null.
    • onResolved

      public void onResolved(VSRelativeReference<?> reference, VSColumnHeader column)
      Called when the property reference has been resolved. UI components use this method to set its state according to the field.
      Specified by:
      onResolved in interface IVSColumnListener
      Parameters:
      reference - The VSRelativeReference instance holding the reference.
      column - The target reference.
    • onBroken

      public void onBroken(VSRelativeReference<?> reference, VSColumnHeader column)
      Called when the property reference has been broken, i.e. unresolved.
      Specified by:
      onBroken in interface IVSColumnListener
      Parameters:
      reference - The VSRelativeReference instance holding the reference.
      column - The target reference.
    • onStateChanged

      public void onStateChanged(VSColumnHeader table, IVSComponentState.State state, boolean on)
      Called when the table changes state.
      Specified by:
      onStateChanged in interface IVSColumnListener
      Parameters:
      table - The VS table.
      state - The state change.
      on - New state.
    • onSingleSelectionChanged

      public void onSingleSelectionChanged(VSColumnHeader column, int rowIndex)
      Called when the row selection in table single-selection mode is changed to forward to column listeners.
      Specified by:
      onSingleSelectionChanged in interface IVSColumnListener
      Parameters:
      column - The column.
      rowIndex - The row index selected, -1 for none.
    • onSelectionChanged

      public void onSelectionChanged(VSColumnHeader column, VSRow row, int rowIndex, boolean isSelected)
      Called when the row selection is changed to forward to column listeners.
      Specified by:
      onSelectionChanged in interface IVSColumnListener
      Parameters:
      column - The column.
      row - The row that was changed.
      rowIndex - The row index.
      isSelected - The selected state.
    • onRowAdded

      public void onRowAdded(VSColumnHeader column, VSRow row, int rowIndex)
      Called when a row has been added to the table.
      Specified by:
      onRowAdded in interface IVSColumnListener
      Parameters:
      column - The column.
      row - The row that was added.
      rowIndex - The row index where it was inserted.
    • onRowRemoved

      public void onRowRemoved(VSColumnHeader column, VSRow row, int rowIndex)
      Called when a row has been removed from the table.
      Specified by:
      onRowRemoved in interface IVSColumnListener
      Parameters:
      column - The column.
      row - The row that was removed.
      rowIndex - The row index before removal.
    • onStateChanged

      public void onStateChanged(VSColumnHeader column, VSField cell, IVSComponentState.State state, boolean on)
      Called when a cell in the column changes state.
      Specified by:
      onStateChanged in interface IVSColumnListener
      Parameters:
      column - The VS column.
      cell - The VS field.
      state - The state change.
      on - New state.
    • onCellValueChanged

      public void onCellValueChanged(VSColumnHeader column, VSField cell, Value value, GProp<?> trigger, IPostEventProcessing postProcessing)
      Called when the cell value is set in the column.
      Specified by:
      onCellValueChanged in interface IVSColumnListener
      Parameters:
      column - The VS column.
      cell - The VS field.
      value - The value, never null, but value.isNull() could be true.
      trigger - The trigger property that may be null.
      postProcessing - Post-processing instance.
    • getApproximateSize

      public Size getApproximateSize()
      Returns the size of the component in pixels. The size is a calculation and does not exactly reflect the real size that may be different due to additional styles not taken into account by this method. The size is calculated from the font of the component and default or defined values (such as character length or number of lines for text area).
      Specified by:
      getApproximateSize in class UIComp
      Returns:
      The size of the component.