org.pentaho.di.ui.core.widget
Class TableView

java.lang.Object
  extended by Composite
      extended by org.pentaho.di.ui.core.widget.TableView

public class TableView
extends Composite

Widget to display or modify data, displayed in a Table format.

Since:
27-05-2003
Author:
Matt

Field Summary
 Table table
           
 
Constructor Summary
TableView(VariableSpace space, Composite parent, int style, ColumnInfo[] columnInfo, int nrRows, boolean readOnly, ModifyListener lsm, PropsUI pr)
           
TableView(VariableSpace space, Composite parent, int style, ColumnInfo[] columnInfo, int nrRows, ModifyListener lsm, PropsUI pr)
           
 
Method Summary
 void add(String... string)
           
 void addModifyListener(ModifyListener ls)
           
 void applyOSXChanges()
           
 void clearAll()
           
 void clearAll(boolean ask)
           
 void closeActiveButton()
           
 void edit(int rownr, int colnr)
           
 String getButtonString()
           
 TableEditor getEditor()
           
 ScrollBar getHorizontalBar()
           
 String[] getItem(int rownr)
           
 String getItem(int rownr, int colnr)
           
 int getItemCount()
           
 String[] getItems(int colnr)
          Get all the strings from a certain column as an array
 TableItem getNonEmpty(int index)
          Return the row/table-item on the specified index.
 ColumnInfo getNumberColumn()
           
 RowMetaAndData getRow(int nr)
           
 RowMetaInterface getRowWithoutValues()
           
 int getSelectionIndex()
           
 int[] getSelectionIndices()
           
 int getSortField()
           
 Table getTable()
           
 ScrollBar getVerticalBar()
           
 int indexOfString(String str, int column)
           
 boolean isReadonly()
           
 boolean isSortable()
           
 boolean isSortingDescending()
           
 int nrNonEmpty()
          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 removeAll()
           
 void removeEmptyRows()
           
 void removeEmptyRows(int column)
           
 void setButtonString(String str)
           
 void setColumnInfo(int idx, ColumnInfo col)
           
 void setColumnText(int idx, String text)
           
 void setColumnToolTip(int idx, String text)
           
 void setEditor(TableEditor editor)
           
 void setFilter()
           
 void setFocusOnFirstEditableField()
           
 void setNumberColumn(ColumnInfo numberColumn)
           
 void setReadonly(boolean readonly)
           
 void setRowNums()
           
 void setSelection(int[] selectedItems)
           
 void setSortable(boolean sortable)
           
 void setSortingDescending(boolean sortingDescending)
           
 void setText(String text, int colnr, int rownr)
           
 void sortTable(int colnr)
           
 void sortTable(int sortField, boolean sortingDescending)
           
 void unEdit()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

public Table table
Constructor Detail

TableView

public TableView(VariableSpace space,
                 Composite parent,
                 int style,
                 ColumnInfo[] columnInfo,
                 int nrRows,
                 ModifyListener lsm,
                 PropsUI pr)

TableView

public TableView(VariableSpace space,
                 Composite parent,
                 int style,
                 ColumnInfo[] columnInfo,
                 int nrRows,
                 boolean readOnly,
                 ModifyListener lsm,
                 PropsUI pr)
Method Detail

sortTable

public void sortTable(int colnr)

setSelection

public void setSelection(int[] selectedItems)

sortTable

public void sortTable(int sortField,
                      boolean sortingDescending)

addModifyListener

public void addModifyListener(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)

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 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 ScrollBar getHorizontalBar()

getVerticalBar

public ScrollBar getVerticalBar()

getButtonString

public String getButtonString()

setButtonString

public void setButtonString(String str)

closeActiveButton

public void closeActiveButton()

unEdit

public void unEdit()

setFilter

public void setFilter()

getRowWithoutValues

public RowMetaInterface getRowWithoutValues()

getRow

public 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 Table getTable()

getNumberColumn

public ColumnInfo getNumberColumn()
Returns:
the numberColumn

setNumberColumn

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

getEditor

public TableEditor getEditor()

setEditor

public void setEditor(TableEditor editor)

applyOSXChanges

public void applyOSXChanges()