org.eclipse.datatools.sqltools.data.internal.ui.editor
Class TableDataCell

java.lang.Object
  extended by org.eclipse.datatools.sqltools.data.internal.ui.editor.TableDataCell
All Implemented Interfaces:
org.eclipse.ui.IActionFilter

public class TableDataCell
extends java.lang.Object
implements org.eclipse.ui.IActionFilter

Represents a selected cell of the Table Data editor. This class is used to expose the table data editor selection, and to allow adding context actions using an object contribution. The TableDataCell contains the row object and the column index. If the cell corresponds to an actual table value, the row is an IRowTable data. If the cell cell is part of the 'insertion row' then the row is just a dummy Object. The actual cell value can be accessed using getValue(). The class also implements IActionFilter so it can be used for object contrinution enablement.

Author:
groux

Constructor Summary
TableDataCell(ITableDataEditor editor, java.lang.Object row, int col)
           
 
Method Summary
 int getCol()
           
 ITableDataEditor getEditor()
           
 java.lang.Object getRow()
           
 java.lang.Object getValue()
          Returns the actual value of the cell (may be null) or null if the cell is part of the insertion row.
 boolean testAttribute(java.lang.Object target, java.lang.String name, java.lang.String value)
          Tests whether the specific value matches the state of the cell.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableDataCell

public TableDataCell(ITableDataEditor editor,
                     java.lang.Object row,
                     int col)
Method Detail

getCol

public int getCol()

getRow

public java.lang.Object getRow()

getEditor

public ITableDataEditor getEditor()

getValue

public java.lang.Object getValue()
Returns the actual value of the cell (may be null) or null if the cell is part of the insertion row.

Returns:

testAttribute

public boolean testAttribute(java.lang.Object target,
                             java.lang.String name,
                             java.lang.String value)
Tests whether the specific value matches the state of the cell. The following properties are supported: - vendor: Product name of the underlying database - version: Version name of the underlying database - dataType: Data type name of the column (precision/scale/length are not part of the name) - nullable: true if the column is nullable, false otherwise - insertionCell: true if the cell is part of the insertion row

Specified by:
testAttribute in interface org.eclipse.ui.IActionFilter