Class 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
    • Field Summary

      Fields 
      Modifier and Type Field Description
      org.eclipse.swt.widgets.Table table  
      protected int textWidgetCaretPosition  
      • 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)  
    • Field Detail

      • table

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

        protected int textWidgetCaretPosition
    • Constructor Detail

      • 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 Detail

      • 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()
      • hasIndexColumn

        public boolean hasIndexColumn()