Class UITable

All Implemented Interfaces:
EventListener, IFocusComp, IMessageBox, IComponent, ICustomDataProvider, IGProp<GProp<?>[]>, IPropCnr, IUIComp, IUIContainer, IUIContextMenuOwner, IUIFocusComp, IUICellSelectionComp, IUIIndexedSelectionComp, IUISelectionComp, IUISingleIndexedSelectionComp, IVSComponentListener, IVSComponentState, IVSFieldListener, IVSGenericComponentListener, IVSTableColumnReferenceOwner, IVSTableListener, Cloneable
Direct Known Subclasses:
EUITable

The table UI container.

The general recommendation is to program against the VirtualSpace, but if you wish, you can add a specific selection listener to process selection changes on the UITable instance. An event will be fired for a table that is selection capable either on row or cell level, of the selection types SINGLE, EXTENDED, MULTIPLE or TOGGLE. No event will be triggered for selection type NONE, and all methods used to retrieve or set the selection will return no selection or no change respectively.

Author:
Christopher Mindus
  • Field Details

    • SELECTION_TYPE_NONE

      public static final int SELECTION_TYPE_NONE
      Selection type: NONE.
      See Also:
    • SELECTION_TYPE_SINGLE

      public static final int SELECTION_TYPE_SINGLE
      Selection type: SINGLE.
      See Also:
    • SELECTION_TYPE_EXTENDED

      public static final int SELECTION_TYPE_EXTENDED
      Selection type (multiple selection enabled): MULTIPLE.
      See Also:
    • SELECTION_TYPE_MULTIPLE

      public static final int SELECTION_TYPE_MULTIPLE
      Selection type (multiple selection enabled): MULTIPLE.
      See Also:
    • SELECTION_TYPE_TOGGLE

      public static final int SELECTION_TYPE_TOGGLE
      Selection type (multiple selection enabled): TOGGLE.
      See Also:
    • SELECTION_TYPE

      public static final String SELECTION_TYPE
      The selection type property name.
      See Also:
    • CELL_SELECTION_PN

      public static final String CELL_SELECTION_PN
      Cell selection property name.
      See Also:
    • FILTER_VSFIELD

      public static final String FILTER_VSFIELD
      Property name for the Filter VSField.
      See Also:
    • FILTER_DELAY

      public static final String FILTER_DELAY
      Property name for the Filter delay.
      See Also:
    • FILTER_CASE

      public static final String FILTER_CASE
      Filter case sensitive boolean property name.
      See Also:
    • FILTER_OPERATION

      public static final String FILTER_OPERATION
      Filter operation integer property name.
      See Also:
    • FILTER_CLASS

      public static final String FILTER_CLASS
      LATER: Filter class ClassReference property name.
      See Also:
  • Constructor Details

    • UITable

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

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

      public UITable(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

    • createHeaderStyles

      protected Styles createHeaderStyles()
      Creates the Header Styles container (can be overridden by Designer to create EditorStyles).
    • createBodyStyles

      protected Styles createBodyStyles()
      Creates the Body Styles container (can be overridden by Designer to create EditorStyles).
    • createFooterStyles

      protected Styles createFooterStyles()
      Creates the Footer Styles container (can be overridden by Designer to create EditorStyles).
    • addPredefinedProps

      protected void addPredefinedProps() throws PropException
      Adds the predefined properties for this container. This method is called once just after construction of the property container and sometimes population of it.

      The method should add properties to create or get reference to using the maybeAddProp method. When the PropCnr instance is cloned, the method getPredefinedProps() is called in order for the subclass to be able to retrieve the new instances to these properties, if stored in instance variables.

      Overrides:
      addPredefinedProps in class UIContainer
      Throws:
      PropException - for property exceptions.
    • getPredefinedProps

      public void getPredefinedProps()
      Gets potential references to predefined properties for this container. This method is called once just after cloning of the property container.

      The method should get reference to using the getProp(...) methods. This allows the subclass to be able to retrieve the new instances to the properties created during addPredefinedProps() if stored in instance variables.

      Overrides:
      getPredefinedProps in class UIContainer
    • getRowsCnr

      public TableRows getRowsCnr()
      Gets the rows container.
    • getDeviceType

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

      public boolean isMobileContextMenuSupported()
      Returns if the component can show the context menu in mobile mode.
      Specified by:
      isMobileContextMenuSupported in interface IUIContextMenuOwner
      Overrides:
      isMobileContextMenuSupported in class UIContainer
      Returns:
      Table component supports context menus for mobile.
    • clone

      public UITable 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.

      Cloning is used for "virtualization" of a property tree in the server. Client property classes will therefore throw CloneNotSupportedException.

      Once a tree has been cloned, the change-flag is reset, and the create-flag is set. All listeners are also removed! The new cloned property is an orphan, i.e. has no parent set. All children properties are also (deep) cloned.

      Note that the cloning process is done WITHOUT thread synchronization for performance reasons, thus no modifications should be done to the tree!

      Overrides:
      clone in class UIContainer
    • onVirtualizationCompleted

      protected void onVirtualizationCompleted(IAppSessionGyro appGyro, IClientSessionGyro clientGyro, VirtualSpace virtualSpace, boolean isPostResolve)
      Called when virtualization completed.

      Overriding classes must call super.onVirtualizationCompleted(IAppSessionGyro appGyro,IClientSessionGyro clientGyro,VirtualSpace virtualSpace,boolean isPostResolve) if they override this method.

      This method is called to the entire tree of the newly virtualized property container.

      Overrides:
      onVirtualizationCompleted in class PropCnr
      Parameters:
      appGyro - The application gyro instance performing the virtualization.
      clientGyro - The client gyro session, can be null if not initialized from the client gyro.
      virtualSpace - The virtualized VirtualSpace.
      isPostResolve - Flag indicating this call is done after references are attempted to be resolved.
    • onPropParentChanged

      protected void onPropParentChanged(PropCnr oldParent, PropCnr newParent)
      Called when the parent is changed for this class. The default implementation does nothing and must be overridden by subclasses.
      Overrides:
      onPropParentChanged in class GProp<GProp<?>[]>
      Parameters:
      oldParent - The old parent (or null if none).
      newParent - The new parent (or null if none).
    • onPropDispose

      protected void onPropDispose()
      Called when disposed of.
      Overrides:
      onPropDispose in class UIComp
    • mustHaveWidth

      public boolean mustHaveWidth()
      Does this component require a width?
      Overrides:
      mustHaveWidth in class UIContainer
      Returns:
      true if the width must be defined and non-zero, false otherwise.
    • mustHaveHeight

      public boolean mustHaveHeight()
      Does this component require a height?
      Overrides:
      mustHaveHeight in class UIContainer
      Returns:
      true if the height must be defined and non-zero, false otherwise.
    • mustHaveExplicitWidth

      public boolean mustHaveExplicitWidth()
      Does this component require an explicitly defined width?
      Overrides:
      mustHaveExplicitWidth in class UIComp
      Returns:
      true if the width must be defined and non-zero, false otherwise.
    • mustHaveExplicitHeight

      public boolean mustHaveExplicitHeight()
      Does this component require an explicitly defined height?
      Overrides:
      mustHaveExplicitHeight in class UIComp
      Returns:
      true if the height must be defined and non-zero, false otherwise.
    • canAlignX

      public boolean canAlignX()
      Returns if the component can be aligned left, right, center, or horizontal fill.
      Overrides:
      canAlignX in class UIComp
      Returns:
      false, table takes up entire width.
    • canAlignY

      public boolean canAlignY()
      Returns if the component can be aligned top, bottom, middle or vertical fill.
      Overrides:
      canAlignY in class UIComp
      Returns:
      false, table takes up entire height.
    • hasImplicitAlignFillX

      public boolean hasImplicitAlignFillX()
      Returns if the container has implicit component horizontal fill.

      The default behavior is to forward the reply to LayoutMgr.hasImplicitAlignFillX().

      Overrides:
      hasImplicitAlignFillX in class UIContainer
      Returns:
      true means component will always fill the space in X, false otherwise.
    • hasImplicitAlignFillY

      public boolean hasImplicitAlignFillY()
      Returns if the container has implicit component vertical fill.

      The default behavior is to forward the reply to LayoutMgr.hasImplicitAlignFillY().

      Overrides:
      hasImplicitAlignFillY in class UIContainer
      Returns:
      true means component will always fill the space in Y, false otherwise.
    • 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).
      Overrides:
      getApproximateSize in class UIContainer
      Returns:
      The size of the component: 400x300.
    • isHeaderDisplayed

      public boolean isHeaderDisplayed()
      Returns if the header is displayed or not.
      Returns:
      true if header is displayed (default), or false for hidden header.
    • isColumnHiderEnabled

      public boolean isColumnHiderEnabled()
      Returns if the columns hider is enabled, i.e. if the user can choose to hide or show columns.
      Returns:
      true if enabled, false for disabled (default).
    • getColumns

      public UITableColumn[] getColumns()
      Gets the columns in the table.
      Returns:
      The array of table columns.
    • getColumn

      public UITableColumn getColumn(int index)
      Gets the columns in the table.
      Parameters:
      index - The column index.
      Returns:
      The table column.
      Throws:
      IndexOutOfBoundsException - If the index is out of bounds.
    • getColumnCount

      public int getColumnCount()
      Gets the column count.
      Returns:
      The column count.
    • registerStyle

      public int registerStyle(String stylesRef)
      Registers the style reference for use with header or row cells.
      Parameters:
      stylesRef - The styles reference string, or null for no style.
      Returns:
      The ID of the style, or zero for no style or reference not found.
    • registerStyle

      public int registerStyle(String stylesRef, boolean logEvent)
      Registers the style reference for use with header or row cells.
      Parameters:
      stylesRef - The styles reference string, or null for no style.
      logEvent - Flag to log an event if the style is not found (recommended).
      Returns:
      The ID of the style, or zero for no style or reference not found.
    • getOddRowStyle

      public int getOddRowStyle()
      Gets the odd row style.
      Returns:
      The style for odd rows, zero for none.
    • getEvenRowStyle

      public int getEvenRowStyle()
      Gets the even row style.
      Returns:
      The style for even rows, zero for none.
    • getDisplayedRowCount

      public int getDisplayedRowCount()
      Gets the displayed row count after filtering.
      Returns:
      The total number of rows in the table.
    • 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.
    • getSelectionType

      public int getSelectionType()
      Gets the selection type.
      Specified by:
      getSelectionType in interface IUISelectionComp
      Returns:
      The selection type:
      SELECTION_TYPE_NONE,
      SELECTION_TYPE_SINGLE,
      SELECTION_TYPE_EXTENDED (default),
      SELECTION_TYPE_MULTIPLE or
      SELECTION_TYPE_TOGGLE.
    • isRowSelectionAllowed

      public boolean isRowSelectionAllowed()
      Returns if row selection is allowed or not, i.e. if the selection type is single or of multiple type and cell selection is disabled.
      Returns:
      true if selection is not cell-based and type is not NONE.
    • isCellSelectionEnabled

      public boolean isCellSelectionEnabled()
      Returns if cell selection is enabled or not.
      Returns:
      true if cells are selected, false otherwise.
    • addListener

      public boolean addListener(IUITableSelectionChangeListener listener)
      Adds a new selection listener for row or cell selection. Calling this method multiple times with the same listener will have no effect (but to return false).
      Parameters:
      listener - The listener to add.
      Returns:
      true if the listener was added, false otherwise.
      Throws:
      NullPointerException - If the listener is null.
    • removeListener

      public boolean removeListener(IUITableSelectionChangeListener listener)
      Removes a selection listener for row or cell selection.
      Parameters:
      listener - The listener to remove.
      Returns:
      true if listener is successfully removed, false otherwise.
    • getFirstSelectedRowIndex

      public int getFirstSelectedRowIndex()
      Gets the first selected row index for a selection table type, typically single-selection.

      Note: the row index returned applies to visible lines in the table, i.e. when hidden or filtered out rows have been removed.

      Returns:
      The selected row index, or -1 for none or for non-single-selection lists or if cell selection is enabled.
    • getFirstSelectedRow

      public TableRow getFirstSelectedRow()
      Gets the first selected row index for a selection table type, typically single-selection.

      Note: the row index returned applies to visible lines in the table, i.e. when hidden or filtered out rows have been removed.

      Returns:
      The selected row, or null for none or for non-single-selection lists or if cell selection is enabled.
    • getSelectedRowIndicies

      public int[] getSelectedRowIndicies()
      Gets the selected row indicies for a selection table type.

      Note: each row index returned applies to visible lines in the table, i.e. when hidden or filtered out rows have been removed.

      Returns:
      An array with the selected row indicies, never null.
    • getSelectedRows

      public TableRow[] getSelectedRows()
      Gets the selected rows for a selection table type.

      Note: each row returned applies to visible lines in the table, i.e. when hidden or filtered out rows have been removed.

      Returns:
      An array with the selected rows, never null.
    • setSelectedRow

      public boolean setSelectedRow(int index)
      Sets the selected row index for a selection table type. If the list can handle selection of multiple lines, all lines apart of the specified index will be unselected.

      Note: the row index returned applies to visible lines in the table, i.e. when hidden or filtered out rows have been removed.

      Parameters:
      index - The row index for the selection (0 to totalRowCount-1 or -1 for none).
      Returns:
      true for changed, false for no change in selection (or index is invalid or selection type is SELECTION_TYPE_NONE or cell selection is enabled).
    • setSelectedRows

      public boolean setSelectedRows(int[] indicies)
      Sets the selected row index for a selection table type. If the list can handle selection of multiple lines, all lines apart of the specified index will be unselected.

      Note: the row index returned applies to visible lines in the table, i.e. when hidden or filtered out rows have been removed.

      Parameters:
      indicies - The row indicies for the selection.
      Returns:
      true for changed, false for no change in selection (or index is invalid or selection type is SELECTION_TYPE_NONE or cell selection is enabled).
      Throws:
      IllegalArgumentException - If the indicies array is larger than one and the selection type is SELECTION_TYPE_SINGLE.
    • setSelectedRows

      public boolean setSelectedRows(TableRow[] rows)
      Sets the selected rows for a selection table type. If the list can handle selection of multiple lines, all lines apart of the specified index will be unselected.

      Note: the row index returned applies to visible lines in the table, i.e. when hidden or filtered out rows have been removed.

      Parameters:
      rows - The rows to select.
      Returns:
      true for changed, false for no change in selection (or index is invalid or selection type is SELECTION_TYPE_NONE or cell selection is enabled).
      Throws:
      IllegalArgumentException - If the rows array is larger than one and the selection type is SELECTION_TYPE_SINGLE.
    • getSelectedCells

      public TCell[] getSelectedCells()
      Gets the selected cells in the table.

      Note: each row returned applies to visible lines in the table, i.e. when hidden or filtered out rows have been removed.

      Returns:
      An array of selected cells, never null, but empty array if table is not cell selection enabled.
    • setSelectedCells

      public boolean setSelectedCells(TCell[] cells)
      Sets the selected cells in the table.

      Cells that are no longer part of the table are ignored.

      Parameters:
      cells - The array of cells to select.
      Returns:
      true for changed selection, false for no change. false is also returned if the table is not enabled for cell selection or has the selection type set to SELECTION_TYPE_NONE.
    • setSelectedCells

      public boolean setSelectedCells(int[] rows, int[] cols)
      Sets the selected cells in the table.

      The rows and cols arrays forms pairs of cell coordinates in the table for the selected cells.

      If a column or row index is not part of the table, it is ignored.

      Parameters:
      rows - The row indicies.
      cols - The column indicies.
      Returns:
      true for changed selection, false for no change. false is also returned if the table is not enabled for cell selection or has the selection type set to SELECTION_TYPE_NONE.
      Throws:
      IllegalArgumentException - If the rows and cols arrays are not of the same length.
    • getSelectionListenerHandler

      public GenericListener<IUISelectionListener> getSelectionListenerHandler(boolean doCreate)
      Returns the generic selection listener.
      Specified by:
      getSelectionListenerHandler in interface IUISelectionComp
      Parameters:
      doCreate - Create the listener handler if it doesn't exist, false not to.
      Returns:
      The selection listener handler, or null if not created.
    • getSelectionPropAtom

      public Atom getSelectionPropAtom()
      Returns the selection property atom for verification of selection changes.

      This method is used by the framework in UIComp to fire selection events when the property value changes.

      Specified by:
      getSelectionPropAtom in interface IUISelectionComp
      Returns:
      The atom of the selection property, or null if a selection property is not used.
    • getOnUISelectionMethod

      public Method getOnUISelectionMethod()
      Returns the method to use for onUISelection notifications that is attached to this selection component. The method name is not important, but must have the annotation and signature:

      @OnUISelection(name = "some/property")
      public void onUISelection(UISelectionEvent event)

      Specified by:
      getOnUISelectionMethod in interface IUISelectionComp
      Returns:
      The method, or null if none is registered.
    • isSelected

      public boolean isSelected()
      Returns the selection of state of the component.

      This method does not apply for cell selection tables.

      For a multiple-selection capable component, this indicates any selection, i.e. true is returned as soon as at least one element is selected, false for none.

      Specified by:
      isSelected in interface IUISelectionComp
      Returns:
      true if the table has at least one row selected, false otherwise.
    • getSelection

      public IUISelection getSelection()
      Gets the current selection of the component.
      Specified by:
      getSelection in interface IUISelectionComp
      Returns:
      The current selection as:
    • clearSelection

      public String clearSelection()
      Clear the selection.

      This method does not apply for cell selection tables.

      Specified by:
      clearSelection in interface IUIIndexedSelectionComp
      Returns:
      null for success, otherwise the error message with the reason why it failed.
    • getFirstSelectedIndex

      public int getFirstSelectedIndex()
      Gets the first selected index.

      This method does not apply for cell selection tables.

      Specified by:
      getFirstSelectedIndex in interface IUIIndexedSelectionComp
      Specified by:
      getFirstSelectedIndex in interface IUISingleIndexedSelectionComp
      Returns:
      The first index in the current selection, or -1 for none.
    • getSelectedIndicies

      public int[] getSelectedIndicies()
      Gets the selected indicies.

      This method does not apply for cell selection tables.

      Specified by:
      getSelectedIndicies in interface IUIIndexedSelectionComp
      Specified by:
      getSelectedIndicies in interface IUISingleIndexedSelectionComp
      Returns:
      A new array of the selected indices (that may be modified to your liking), or a static zero in length array for no selection.
    • setSelection

      public String setSelection(int index)
      Sets the selection as a single selected item at specified index.

      This method does not apply for cell selection tables.

      Specified by:
      setSelection in interface IUIIndexedSelectionComp
      Parameters:
      index - The single item to select at index, -1 to clear the selection.
      Returns:
      null for success, otherwise an error message why the selection failed.
    • setSelection

      public String setSelection(int[] indicies)
      Sets the selection to the specified indicies.

      This method does not apply for cell selection tables.

      Specified by:
      setSelection in interface IUIIndexedSelectionComp
      Specified by:
      setSelection in interface IUISingleIndexedSelectionComp
      Parameters:
      indicies - The indicies.
      Returns:
      null for success, otherwise the error message with the reason why it failed.
    • setSelection

      public String setSelection(IUISelection selection)
      Sets the selection.

      This method does not apply for cell selection tables.

      Specified by:
      setSelection in interface IUISelectionComp
      Parameters:
      selection - The selection.
      Returns:
      null if selection is set successfully, otherwise the reason why the selection failed to be set, e.g. "Unsupported selection base" if the selection is indexed for a checkbox that only supports tri-state based selections.
    • getSelectedIndex

      public int getSelectedIndex()
      Gets the first selected row index.

      This method does not apply for cell selection tables.

      Specified by:
      getSelectedIndex in interface IUISingleIndexedSelectionComp
      Returns:
      The first index in the current selection, or -1 for none.
    • createCellCombo

      public TableCombo createCellCombo()
      Creates a new combobox table contents to be used in a cell.
    • getVSColumns

      public VSColumnHeader[] getVSColumns()
      Gets the VS columns for the table.
      Returns:
      The array of VS columns for the table. Note that an item in the array may be null if no VS column connection is present!
    • getVSTableReference

      public VSTableReference getVSTableReference()
      Gets the VirtualSpace table reference for the table.
      Returns:
      The VSTableReference, null for none.
    • 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.
    • 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.
    • getVSTable

      public VSTable getVSTable()
      Gets the VS table reference of the table.
      Returns:
      The VS table connected to this table, null for none.
    • onResolved

      public void onResolved(VSRelativeReference<?> reference, VSTable table)
      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 IVSTableListener
      Parameters:
      reference - The VSRelativeReference instance holding the reference.
      table - The target reference.
    • onBroken

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

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

      public void onSingleSelectionChanged(VSTable table, int index)
      Called when the single selection changes.
      Specified by:
      onSingleSelectionChanged in interface IVSTableListener
      Parameters:
      table - The table.
      index - The row index, -1 if table is unselected.
    • getMappedVSComponent

      public VSComponent getMappedVSComponent()
      Gets the main component that is used to map the UI component to the VirtualSpace.
      Overrides:
      getMappedVSComponent in class UIComp
      Returns:
      The VS component, or null for none. Default is to return the VSField of UIComp. Override e.g. for actions.
    • onRowAdded

      public void onRowAdded(VSRow row, int index)
      Called when a row is added.
      Specified by:
      onRowAdded in interface IVSTableListener
      Parameters:
      row - The row.
      index - The index.
    • onRowRemoved

      public void onRowRemoved(VSRow row, int index)
      Called when a row is removed.
      Specified by:
      onRowRemoved in interface IVSTableListener
      Parameters:
      row - The row.
      index - The index.
    • onRowStateChanged

      public void onRowStateChanged(VSRow row, IVSComponentState.State state, boolean on)
      Called when a row selection state changed.
      Specified by:
      onRowStateChanged in interface IVSTableListener
      Parameters:
      row - The row.
      state - The state change.
      on - New state.
    • onCellStateChanged

      public void onCellStateChanged(VSField cell, IVSComponentState.State state, boolean on)
      Called when the cell changes state.
      Specified by:
      onCellStateChanged in interface IVSTableListener
      Parameters:
      cell - The VS cell.
      state - The state change.
      on - New state.
    • onCellValueChanged

      public void onCellValueChanged(VSField cell, Value value, GProp<?> trigger, IPostEventProcessing postProcessing)
      Called when the cell value is set.
      Specified by:
      onCellValueChanged in interface IVSTableListener
      Parameters:
      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.
    • setFilter

      public boolean setFilter(ITableFilter<?,?> filter)
      Sets the filter instance.
      Parameters:
      filter - The instance. If null a default filter instance will be used.
      Returns:
      true for changed, false for no change.
    • getFilter

      public ITableFilter<?,?> getFilter()
      Gets the filter instance. If no specific filtering is defined, an instance of the DefaultTableFilter is returned.
      Returns:
      The filtering instance, never null.
    • getFilterText

      public String getFilterText()
      Gets the current filter text.
      Returns:
      The filter text, or null for no filtering.
    • setFilterText

      public boolean setFilterText(String text)
      Sets the filter text and refreshes the table if required.
      Parameters:
      text - The new text for filtering, null or empty string for no filtering.
      Returns:
      true for changed, false for no change.
    • isFilterCaseSensitive

      public boolean isFilterCaseSensitive()
      Gets the filter flag for case sensitive.
      Returns:
      true for case sensitive matching, false for case insensitive (default).
    • setFilterCaseSensitive

      public boolean setFilterCaseSensitive(boolean on)
      Sets the filter flag for case sensitive and refreshes the table if required.
      Parameters:
      on - true for case sensitive filtering, false for case insensitive.
      Returns:
      true for changed, false for no change.
    • getFilterOperation

      public ITableFilter.Op getFilterOperation()
      Gets the operation for filtering.
      Returns:
      The filtering operation.
    • setFilterOperation

      public boolean setFilterOperation(ITableFilter.Op op)
      Sets the operation for filtering and refreshes the table if required.
      Parameters:
      op - The new operation.
      Returns:
      true if changed, false otherwise.
      Throws:
      NullPointerException - if op is null.
    • getBestVSFieldValueType

      public Value.Type getBestVSFieldValueType(VSRelativeReference<?> reference)
      Requests the value type that would best suit the listener.
      Specified by:
      getBestVSFieldValueType in interface IVSFieldListener
      Overrides:
      getBestVSFieldValueType in class UIComp
      Parameters:
      reference - The VSRelativeReference instance holding the reference.
      Returns:
      null if none is available.
    • onResolved

      public void onResolved(VSRelativeReference<?> reference, VSField field)
      Called when the property reference has been resolved. UI components use this method to set its state according to the field, this is handled in by the UIComp class.

      Components must override to provide the implementation for e.g. value contents, styles, etc.

      Specified by:
      onResolved in interface IVSFieldListener
      Overrides:
      onResolved in class UIComp
      Parameters:
      reference - The VSRelativeReference instance holding the reference.
      field - The target reference.
    • onBroken

      public void onBroken(VSRelativeReference<?> reference, VSField field)
      Called when the property reference has been broken, i.e. unresolved.
      Specified by:
      onBroken in interface IVSFieldListener
      Overrides:
      onBroken in class UIComp
      Parameters:
      reference - The VSRelativeReference instance holding the reference.
      field - The target reference.
    • onValueChanged

      public void onValueChanged(VSField field, Value value, GProp<?> trigger, IPostEventProcessing postProcessing)
      Called when the field value is set.

      Components must override to provide the implementation when they are not implementing IPlainTextComponent, in this case the default implementation transports the field string value to this text components plain text.

      Specified by:
      onValueChanged in interface IVSFieldListener
      Overrides:
      onValueChanged in class UIComp
      Parameters:
      field - 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.
    • setContentProvider

      public boolean setContentProvider(ITableContentProvider<?,?,?,?> provider)
      Sets a custom content provider and initializes it if required.
      Parameters:
      provider - The content provider, or null for a new instance of a DefaultTableContentProvider.
      Returns:
      true for changed, false for no change.
    • getContentProvider

      public ITableContentProvider<?,?,?,?> getContentProvider()
      Gets the custom table content provider and initializes it if required.
      Returns:
      The custom table content provider, never null.
    • refreshTable

      public void refreshTable(int dirty, String reason)
      Requests a refresh of the entire table.

      This method is called e.g. when a new column is added to rebuild the table contents. Be careful when calling this method as it may cause a lot of processing at a later stage, triggering new contents to be sent to the client side. The table is not refreshed upon returning from the call, it is done at a later stage.

      Parameters:
      dirty - The dirty flags.
      reason - The reason string for debug purposes.
    • updateTable

      protected void updateTable()
      Called to update the table if required with new data. The method does nothing if e.g. a call to refreshTable(int,String) hasn't been called.
    • onPrepare

      protected void onPrepare(ClassReference cr, List<Throwable> errors)
      Called to resolve methods for the component from main "onPrepare" once the ClassReference has been found.

      Components should override this method to load it's required methods.

      Overrides:
      onPrepare in class UIComp
      Parameters:
      cr - The class reference with a valid reference.
      errors - The list of errors that is returned to the caller in case resolving fails.