Class ResultSetColumnProp

All Implemented Interfaces:
EventListener, IGProp<GProp<?>[]>, IPropCnr, IVSColumnBestValueListener, IVSColumnListener, IVSComponentListener, IVSComponentState, IVSTableColumnReferenceOwner, Cloneable
Direct Known Subclasses:
EditorResultSetColumnProp

The result set Column property that connects the column name in a result set with a VSColumnHeader.
Author:
Christopher Mindus
  • Field Details

  • Constructor Details

    • ResultSetColumnProp

      public ResultSetColumnProp()
      Creates a ResultSetColumnProp property container with the specified name with a null value.
    • ResultSetColumnProp

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

    • clone

      public ResultSetColumnProp clone()
      Clones this VSVariable instance.
      Overrides:
      clone in class AbstractVSVariable<VSColumnHeader,VSTableColumnReference>
    • getResultSetProps

      public ResultSetProps getResultSetProps()
      Gets the Result Set properties.
      Returns:
      The result set properties, or null if this property is orphaned.
    • getVSPropertyClass

      public Class<VSColumnHeader> getVSPropertyClass()
      Gets the class wanted for the VS component being referenced.
      Specified by:
      getVSPropertyClass in class AbstractVSVariable<VSColumnHeader,VSTableColumnReference>
      Returns:
      VSColumnHeader.class.
    • getVSReferenceClass

      public Class<VSTableColumnReference> getVSReferenceClass()
      Gets the class wanted for VS references.
      Specified by:
      getVSReferenceClass in class AbstractVSVariable<VSColumnHeader,VSTableColumnReference>
      Returns:
      VSTableColumnReference.class.
    • 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.
    • getVSColumn

      public VSColumnHeader getVSColumn()
      Gets the VSColumnHeader.
      Returns:
      The VSColumnHeader associated, or null for none (or unresolved).
    • setColumnIndex

      protected void setColumnIndex(int index)
      Sets the column index.

      This method is used internally by the Designer during creation of the SQL statement and should not be called elsewhere.

      Parameters:
      index - The column index.
    • getColumnIndex

      public int getColumnIndex()
      Gets the column index in the Result Set.
      Returns:
      The column index, or -1 if SQL statement is not yet parsed in the Designer, or if the column has been left "hanging around" and not yet deleted (this is a problem with warning severity level). This value should NEVER be -1 in the Server, unless it's running in Development Mode!
    • setColumnName

      protected void setColumnName(String name)
      Sets the column name, this method is used by the Designer.
      Parameters:
      name - The name of the column.
    • getColumnName

      public String getColumnName()
      Gets the column label as the SQL statement defines it.
      Returns:
      The name of the column.
    • setColumnLabel

      protected void setColumnLabel(String label)
      Sets the column name, this method is used by the Designer.
      Parameters:
      label - The name of the column to set, or null to clear it.
    • getColumnLabel

      public String getColumnLabel()
      Gets the column label as the SQL statement defines it.

      This is the label for the column specified with the SQL AS clause.

      Returns:
      The label of the column, or null for none.
    • setSQLDataType

      protected void setSQLDataType(int type)
      Sets the SQL data type.

      This method is used internally by the Designer during creation of the SQL statement and should not be called elsewhere.

      Parameters:
      type - The SQL data type for the column as defined by Types.
    • getSQLDataType

      public int getSQLDataType()
      Gets the SQL data type.
      Returns:
      The SQL data type for the column as defined by Types, or 0 if SQL statement is not yet parsed in the Designer, or if the column has been left "hanging around" and not yet deleted (this is a problem with warning severity level). This value should NEVER be 0 in the Server, unless it's running in Development Mode!
    • getSQLDataTypeString

      public String getSQLDataTypeString()
      Gets the SQL data type string.
      Returns:
      The SQL data type for the column as defined by Types, or "unknown" if not found or undefined
    • isNullable

      public boolean isNullable()
      Checks if NULL is allowed for values in this column.
      Returns:
      The Null-Allowed flag (i.e. NOT NOT NULL), default true.
    • setNullable

      protected void setNullable(boolean isAllowed)
      Sets if NULL is allowed for values in this column.
      Parameters:
      isAllowed - The Null-Allowed flag (i.e. NOT NOT NULL).
    • getDescription

      public String getDescription()
      Gets the column description.
      Returns:
      A description, or null for none.
    • 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:
      null if none is available.
    • 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 column, IVSComponentState.State state, boolean on)
      Called when the table changes state.
      Specified by:
      onStateChanged in interface IVSColumnListener
      Parameters:
      column - The VS table column.
      state - The state change.
      on - New state.
    • onParentStateChanged

      public void onParentStateChanged(IVSComponent parent, IVSComponentState.State state, boolean on)
      Called when the column changes state.
      Specified by:
      onParentStateChanged in interface IVSComponentListener
      Parameters:
      parent - The parent who's state was changed.
      state - The state change, possible values PARENT_ENABLED, PARENT_READONLY, PARENT_VISIBLE.
      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.