Class TableView

java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.pentaho.di.ui.core.widget.TableView
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

public class TableView extends org.eclipse.swt.widgets.Composite
Widget to display or modify data, displayed in a Table format.
Since:
27-05-2003
Author:
Matt
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    org.eclipse.swt.widgets.Table
     
    protected int
     

    Fields inherited from class org.eclipse.swt.widgets.Composite

    embeddedHandle

    Fields inherited from class org.eclipse.swt.widgets.Widget

    handle
  • Constructor Summary

    Constructors
    Constructor
    Description
    TableView(org.pentaho.di.core.variables.VariableSpace space, org.eclipse.swt.widgets.Composite parent, int style, ColumnInfo[] columnInfo, int nrRows, boolean readOnly, org.eclipse.swt.events.ModifyListener lsm, PropsUI pr)
     
    TableView(org.pentaho.di.core.variables.VariableSpace space, org.eclipse.swt.widgets.Composite parent, int style, ColumnInfo[] columnInfo, int nrRows, boolean readOnly, org.eclipse.swt.events.ModifyListener lsm, PropsUI pr, boolean addIndexColumn)
     
    TableView(org.pentaho.di.core.variables.VariableSpace space, org.eclipse.swt.widgets.Composite parent, int style, ColumnInfo[] columnInfo, int nrRows, boolean readOnly, org.eclipse.swt.events.ModifyListener lsm, PropsUI pr, boolean addIndexColumn, org.eclipse.swt.widgets.Listener lsnr)
     
    TableView(org.pentaho.di.core.variables.VariableSpace space, org.eclipse.swt.widgets.Composite parent, int style, ColumnInfo[] columnInfo, int nrRows, org.eclipse.swt.events.ModifyListener lsm, PropsUI pr)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(String... string)
     
    void
    addModifyListener(org.eclipse.swt.events.ModifyListener ls)
     
    void
     
    void
     
    void
    clearAll(boolean ask)
     
    void
     
    void
    edit(int rownr, int colnr)
     
    int
     
    org.eclipse.swt.widgets.TableItem
     
     
    Returns copy of columns array in order to prevent unintented modifications.
    org.eclipse.swt.events.ModifyListener
     
    org.eclipse.swt.custom.TableEditor
     
    org.eclipse.swt.widgets.ScrollBar
     
    getItem(int rownr)
     
    getItem(int rownr, int colnr)
     
    int
     
    getItems(int colnr)
    Get all the strings from a certain column as an array
    org.eclipse.swt.widgets.TableItem
    getNonEmpty(int index)
    Return the row/table-item on the specified index.
     
     
    org.pentaho.di.core.RowMetaAndData
    getRow(int nr)
     
    org.pentaho.di.core.row.RowMetaInterface
     
    int
     
    int[]
     
    int
     
    org.eclipse.swt.widgets.Table
     
    protected int
     
    protected String
    getTextWidgetValue(int colNr)
     
    org.eclipse.swt.widgets.ScrollBar
     
    boolean
     
    int
    indexOfString(String str, int column)
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    int
    Count non-empty rows in the table...
    void
    optWidth(boolean header)
     
    void
    optWidth(boolean header, int nrLines)
     
    void
    remove(int index)
     
    void
    remove(int[] index)
     
    void
     
    void
     
    void
    removeEmptyRows(int column)
     
    void
     
    void
    setColumnInfo(int idx, ColumnInfo col)
     
    void
    setColumnText(int idx, String text)
     
    void
    setColumnToolTip(int idx, String text)
     
    void
    setContentListener(org.eclipse.swt.events.ModifyListener lsContent)
     
    void
    setEditor(org.eclipse.swt.custom.TableEditor editor)
     
    void
     
    void
     
    void
     
    void
    setReadonly(boolean readonly)
     
    void
     
    void
    setSelection(int[] selectedItems)
     
    void
    setShowingBlueNullValues(boolean showingBlueNullValues)
     
    void
    setShowingConversionErrorsInline(boolean showingConversionErrorsInline)
     
    void
    setSortable(boolean sortable)
     
    void
    setSortingDescending(boolean sortingDescending)
     
    void
     
    void
    setText(String text, int colnr, int rownr)
     
    void
    sortTable(int colnr)
     
    void
    sortTable(int sortField, boolean sortingDescending)
     
    void
     

    Methods inherited from class org.eclipse.swt.widgets.Composite

    changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList

    Methods inherited from class org.eclipse.swt.widgets.Scrollable

    computeTrim, getClientArea, getScrollbarsMode

    Methods inherited from class org.eclipse.swt.widgets.Control

    addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update

    Methods inherited from class org.eclipse.swt.widgets.Widget

    addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString

    Methods inherited from class java.lang.Object

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

    • table

      public org.eclipse.swt.widgets.Table table
    • textWidgetCaretPosition

      protected int textWidgetCaretPosition
  • Constructor Details

    • TableView

      public TableView(org.pentaho.di.core.variables.VariableSpace space, org.eclipse.swt.widgets.Composite parent, int style, ColumnInfo[] columnInfo, int nrRows, org.eclipse.swt.events.ModifyListener lsm, PropsUI pr)
    • TableView

      public TableView(org.pentaho.di.core.variables.VariableSpace space, org.eclipse.swt.widgets.Composite parent, int style, ColumnInfo[] columnInfo, int nrRows, boolean readOnly, org.eclipse.swt.events.ModifyListener lsm, PropsUI pr)
    • TableView

      public TableView(org.pentaho.di.core.variables.VariableSpace space, org.eclipse.swt.widgets.Composite parent, int style, ColumnInfo[] columnInfo, int nrRows, boolean readOnly, org.eclipse.swt.events.ModifyListener lsm, PropsUI pr, boolean addIndexColumn)
    • TableView

      public TableView(org.pentaho.di.core.variables.VariableSpace space, org.eclipse.swt.widgets.Composite parent, int style, ColumnInfo[] columnInfo, int nrRows, boolean readOnly, org.eclipse.swt.events.ModifyListener lsm, PropsUI pr, boolean addIndexColumn, org.eclipse.swt.widgets.Listener lsnr)
  • Method Details

    • getTextWidgetValue

      protected String getTextWidgetValue(int colNr)
    • getTextWidgetCaretPosition

      protected int getTextWidgetCaretPosition(int colNr)
    • sortTable

      public void sortTable(int colnr)
    • setSelection

      public void setSelection(int[] selectedItems)
    • sortTable

      public void sortTable(int sortField, boolean sortingDescending)
    • addModifyListener

      public void addModifyListener(org.eclipse.swt.events.ModifyListener ls)
    • setColumnInfo

      public void setColumnInfo(int idx, ColumnInfo col)
    • setColumnText

      public void setColumnText(int idx, String text)
    • setColumnToolTip

      public void setColumnToolTip(int idx, String text)
    • clearAll

      public void clearAll()
    • clearAll

      public void clearAll(boolean ask)
    • edit

      public void edit(int rownr, int colnr)
    • setRowNums

      public void setRowNums()
    • optWidth

      public void optWidth(boolean header)
    • optWidth

      public void optWidth(boolean header, int nrLines)
    • removeEmptyRows

      public void removeEmptyRows()
    • removeEmptyRows

      public void removeEmptyRows(int column)
    • getNonEmptyIndexes

      public List<Integer> getNonEmptyIndexes()
    • nrNonEmpty

      public int nrNonEmpty()
      Count non-empty rows in the table... IMPORTANT: always call this method before calling getNonEmpty(int selnr): for performance reasons we cache the row indexes.
      Returns:
      the number of rows/table-items that are not empty
    • getNonEmpty

      public org.eclipse.swt.widgets.TableItem getNonEmpty(int index)
      Return the row/table-item on the specified index. IMPORTANT: the indexes of the non-empty rows are populated with a call to nrNonEmpty(). Make sure to call that first.
      Parameters:
      index - the index of the non-empty row/table-item
      Returns:
      the requested non-empty row/table-item
    • indexOfString

      public int indexOfString(String str, int column)
    • getHorizontalBar

      public org.eclipse.swt.widgets.ScrollBar getHorizontalBar()
      Overrides:
      getHorizontalBar in class org.eclipse.swt.widgets.Scrollable
    • getVerticalBar

      public org.eclipse.swt.widgets.ScrollBar getVerticalBar()
      Overrides:
      getVerticalBar in class org.eclipse.swt.widgets.Scrollable
    • getButtonString

      public String getButtonString()
    • setButtonString

      public void setButtonString(String str)
    • closeActiveButton

      public void closeActiveButton()
    • unEdit

      public void unEdit()
    • setFilter

      public void setFilter()
    • getRowWithoutValues

      public org.pentaho.di.core.row.RowMetaInterface getRowWithoutValues()
    • getRow

      public org.pentaho.di.core.RowMetaAndData getRow(int nr)
    • getSelectionIndices

      public int[] getSelectionIndices()
    • getSelectionIndex

      public int getSelectionIndex()
    • remove

      public void remove(int index)
    • remove

      public void remove(int[] index)
    • getItem

      public String getItem(int rownr, int colnr)
    • add

      public void add(String... string)
    • getItem

      public String[] getItem(int rownr)
    • getItems

      public String[] getItems(int colnr)
      Get all the strings from a certain column as an array
      Parameters:
      colnr - The column to return
      Returns:
      the column values as a string array.
    • removeAll

      public void removeAll()
    • getItemCount

      public int getItemCount()
    • setText

      public void setText(String text, int colnr, int rownr)
    • isReadonly

      public boolean isReadonly()
      Returns:
      Returns the readonly.
    • setReadonly

      public void setReadonly(boolean readonly)
      Parameters:
      readonly - The readonly to set.
    • isSortable

      public boolean isSortable()
      Returns:
      the sortable
    • setSortable

      public void setSortable(boolean sortable)
      Parameters:
      sortable - the sortable to set
    • setFocusOnFirstEditableField

      public void setFocusOnFirstEditableField()
    • getSortField

      public int getSortField()
      Returns:
      the getSortField
    • isSortingDescending

      public boolean isSortingDescending()
      Returns:
      the sortingDescending
    • setSortingDescending

      public void setSortingDescending(boolean sortingDescending)
      Parameters:
      sortingDescending - the sortingDescending to set
    • getTable

      public org.eclipse.swt.widgets.Table getTable()
    • getNumberColumn

      public ColumnInfo getNumberColumn()
      Returns:
      the numberColumn
    • setNumberColumn

      public void setNumberColumn(ColumnInfo numberColumn)
      Parameters:
      numberColumn - the numberColumn to set
    • getEditor

      public org.eclipse.swt.custom.TableEditor getEditor()
    • setEditor

      public void setEditor(org.eclipse.swt.custom.TableEditor editor)
    • applyOSXChanges

      public void applyOSXChanges()
    • isShowingBlueNullValues

      public boolean isShowingBlueNullValues()
      Returns:
      the showingBlueNullValues
    • setShowingBlueNullValues

      public void setShowingBlueNullValues(boolean showingBlueNullValues)
      Parameters:
      showingBlueNullValues - the showingBlueNullValues to set
    • getContentListener

      public org.eclipse.swt.events.ModifyListener getContentListener()
      Returns:
      the lsContent
    • setContentListener

      public void setContentListener(org.eclipse.swt.events.ModifyListener lsContent)
      Parameters:
      lsContent - the lsContent to set
    • isShowingConversionErrorsInline

      public boolean isShowingConversionErrorsInline()
      Returns:
      the showingConversionErrorsInline
    • setShowingConversionErrorsInline

      public void setShowingConversionErrorsInline(boolean showingConversionErrorsInline)
      Parameters:
      showingConversionErrorsInline - the showingConversionErrorsInline to set
    • getColumns

      public ColumnInfo[] getColumns()
      Returns copy of columns array in order to prevent unintented modifications.
      Returns:
      columns array
    • getActiveTableItem

      public org.eclipse.swt.widgets.TableItem getActiveTableItem()
    • getActiveTableColumn

      public int getActiveTableColumn()
    • setTableViewModifyListener

      public void setTableViewModifyListener(TableView.TableViewModifyListener tableViewModifyListener)
    • hasIndexColumn

      public boolean hasIndexColumn()