Class TableRow


  • class TableRow
    extends java.lang.Object
    (non-API) Class TableRow. Encapsulates operations on a SWT row control. Discovers the SWT controls inside the row control representing columns and exposes those for operations by the CompositeTable. Listens to SWT events on the column controls and forwards them back to the table control for processing.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.eclipse.swt.widgets.Control[] columns  
      private org.eclipse.swt.events.FocusListener focusListener
      Forward focuse events to the parent control
      private org.eclipse.swt.events.KeyListener keyListener
      Forward key presses to the parent control
      protected InternalCompositeTable parent  
      private org.eclipse.swt.widgets.Control row  
      private org.eclipse.swt.events.TraverseListener traverseListener
      Forward traverse events to the parent control
    • Constructor Summary

      Constructors 
      Constructor Description
      TableRow​(InternalCompositeTable parent, org.eclipse.swt.widgets.Control row)
      Constructor TableRow.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void addListeners​(org.eclipse.swt.widgets.Control control)
      Add listeners to each control.
      void dispose()
      Remove all listeners from each control.
      org.eclipse.swt.widgets.Control getColumnControl​(int i)
      Return the SWT control corresponding to a particular column within this row.
      int getColumnNumber​(org.eclipse.swt.widgets.Control control)
      Return the column number of a specified SWT control or -1 if not found.
      int getNumColumns()
      Return the number of columns in this row.
      org.eclipse.swt.widgets.Control getRowControl()
      Return the SWT control implementing the row's GUI.
      boolean getVisible()
      Returns if this row is visible.
      private void recursiveAddListeners​(org.eclipse.swt.widgets.Control c)
      Recursively calls addListeners(c) for c and all its descendants.
      private void recursiveRemoveListeners​(org.eclipse.swt.widgets.Control c)
      Recursively calls removeListeners(c) for c and all its descendants.
      private void removeListeners​(org.eclipse.swt.widgets.Control control)
      Remove listeners from each control.
      void setVisible​(boolean visible)
      Sets the visibility of this row.
      • Methods inherited from class java.lang.Object

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

      • row

        private org.eclipse.swt.widgets.Control row
      • columns

        private org.eclipse.swt.widgets.Control[] columns
      • keyListener

        private org.eclipse.swt.events.KeyListener keyListener
        Forward key presses to the parent control
      • focusListener

        private org.eclipse.swt.events.FocusListener focusListener
        Forward focuse events to the parent control
      • traverseListener

        private org.eclipse.swt.events.TraverseListener traverseListener
        Forward traverse events to the parent control
    • Constructor Detail

      • TableRow

        public TableRow​(InternalCompositeTable parent,
                        org.eclipse.swt.widgets.Control row)
        Constructor TableRow. Construct a TableRow object.
        Parameters:
        parent - The table containing this row.
        row - The SWT control implementing this row.
    • Method Detail

      • dispose

        public void dispose()
        Remove all listeners from each control.
      • recursiveAddListeners

        private void recursiveAddListeners​(org.eclipse.swt.widgets.Control c)
        Recursively calls addListeners(c) for c and all its descendants.
        Parameters:
        c -
      • recursiveRemoveListeners

        private void recursiveRemoveListeners​(org.eclipse.swt.widgets.Control c)
        Recursively calls removeListeners(c) for c and all its descendants.
        Parameters:
        c -
      • addListeners

        private void addListeners​(org.eclipse.swt.widgets.Control control)
        Add listeners to each control.
        Parameters:
        control - The control to listen to.
      • removeListeners

        private void removeListeners​(org.eclipse.swt.widgets.Control control)
        Remove listeners from each control.
        Parameters:
        control - The control to no longer listen to.
      • getRowControl

        public org.eclipse.swt.widgets.Control getRowControl()
        Return the SWT control implementing the row's GUI.
        Returns:
        The row's SWT control
      • getColumnControl

        public org.eclipse.swt.widgets.Control getColumnControl​(int i)
        Return the SWT control corresponding to a particular column within this row.
        Parameters:
        i - the 0-based offset of the column to return.
        Returns:
        The corresponding control or null if there is no control at the specified position.
      • getColumnNumber

        public int getColumnNumber​(org.eclipse.swt.widgets.Control control)
        Return the column number of a specified SWT control or -1 if not found.
        Parameters:
        control - The control to find.
        Returns:
        control's column number or -1 if that column control is not in this row.
      • getNumColumns

        public int getNumColumns()
        Return the number of columns in this row.
        Returns:
        The number of columns in this row.
      • setVisible

        public void setVisible​(boolean visible)
        Sets the visibility of this row.
        Parameters:
        visible - true if the row should be visible; false otherwise.
      • getVisible

        public boolean getVisible()
        Returns if this row is visible.
        Returns:
        true if the row is visible; false otherwise.