Package org.pentaho.di.ui.core.widget
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
-
Field Summary
Modifier and TypeFieldDescriptionorg.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
ConstructorDescriptionTableView
(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 TypeMethodDescriptionvoid
void
addModifyListener
(org.eclipse.swt.events.ModifyListener ls) void
void
clearAll()
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
String[]
getItem
(int rownr) getItem
(int rownr, int colnr) int
String[]
getItems
(int colnr) Get all the strings from a certain column as an arrayorg.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
getTable()
protected int
getTextWidgetCaretPosition
(int colNr) 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
setButtonString
(String str) 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
setNumberColumn
(ColumnInfo numberColumn) 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
setTableViewModifyListener
(TableView.TableViewModifyListener tableViewModifyListener) void
void
sortTable
(int colnr) void
sortTable
(int sortField, boolean sortingDescending) void
unEdit()
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
-
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
-
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
-
setColumnText
-
setColumnToolTip
-
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
-
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
-
getHorizontalBar
public org.eclipse.swt.widgets.ScrollBar getHorizontalBar()- Overrides:
getHorizontalBar
in classorg.eclipse.swt.widgets.Scrollable
-
getVerticalBar
public org.eclipse.swt.widgets.ScrollBar getVerticalBar()- Overrides:
getVerticalBar
in classorg.eclipse.swt.widgets.Scrollable
-
getButtonString
-
setButtonString
-
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
-
add
-
getItem
-
getItems
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
-
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
- Returns:
- the numberColumn
-
setNumberColumn
- 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
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
-
hasIndexColumn
public boolean hasIndexColumn()
-