org.qriterium.dogma.gui
Class DogmaURITable

java.lang.Object
  extended by de.kupzog.ktable.KTableDefaultModel
      extended by de.kupzog.ktable.KTableSortedModel
          extended by org.qriterium.dogma.gui.DogmaURITable
All Implemented Interfaces:
de.kupzog.ktable.KTableModel

public class DogmaURITable
extends de.kupzog.ktable.KTableSortedModel


Constructor Summary
DogmaURITable(DogmaResource resource, DogmaURIComponent uriComp)
          Creates a new URITable based on the given resource and it's uris.
DogmaURITable(DogmaURIComponent uriComp)
           
 
Method Summary
 void addRow(boolean toFirst)
          Adds a row to the table.
 void deleteRow(int row)
          Removes the given row from the table.
 org.eclipse.swt.graphics.Point doBelongsToCell(int col, int row)
           
 de.kupzog.ktable.KTableCellEditor doGetCellEditor(int col, int row)
           
 de.kupzog.ktable.KTableCellEditor doGetCellEditor(int col, int row, boolean r)
           
 de.kupzog.ktable.KTableCellRenderer doGetCellRenderer(int col, int row)
           
 int doGetColumnCount()
          Returns the amount of columns.
 java.lang.Object doGetContentAt(int col, int row)
          Returns the Object in the cell corresponding to the given values.
 int doGetRowCount()
          Returns the amount of rows in the URI-table, including also header-row.
 java.lang.String doGetTooltipAt(int col, int row)
           
 java.lang.String doGetType(int row)
          Gets the type-value for the given row.
 java.lang.String doGetUri(int row)
          Gets the uri-value for the given row.
 void doSetContentAt(int col, int row, java.lang.Object value)
          Sets the given value to the cell corresponding to the given column and row.
 org.eclipse.swt.graphics.Point getCell(int x, int y)
          Gets the cell as a point for the given x and y - coordinates.
 org.eclipse.swt.graphics.Rectangle getCellBounds(int x, int y)
          Returns the bounds of the given cell as a rectangle.
 java.lang.String getColumnName(int col)
          Gets the columnNames for the given column.
 int getFixedHeaderColumnCount()
           
 int getFixedHeaderRowCount()
           
 int getFixedSelectableColumnCount()
           
 int getFixedSelectableRowCount()
           
 int getInitialColumnWidth(int column)
           
 int getInitialFirstRowHeight()
           
 int getInitialRowHeight(int row)
           
 java.lang.String getItem(int row, int col)
          getItem gets the value on the cell that corresponds to given row and column
 int getLastVisibleColumn()
          Returns the columnNumber of the last visible column.
 DogmaResource getResource()
          Returns the current dogmaresource that is having it's uris shown
 int getRowHeightMinimum()
           
 org.eclipse.swt.graphics.Point getSize()
          Gets the size of the table.
 java.lang.String[][] getUriStringTable()
           
 int getWidth()
          Returns the width of the table
 void hideColumn(int col)
          Hides the column of the given column-value.
 boolean inTable(int x, int y)
          Checks if the point corresponding to the given x-coordinate and y-coordinate is inside the table.
 boolean inTable(org.eclipse.swt.graphics.Point p)
          Checks if the given point is inside our tablelimits.
 boolean isColumnResizable(int col)
           
 boolean isRowResizable(int row)
           
 void showColumn(int col)
          Shows the column of the given column-value
 
Methods inherited from class de.kupzog.ktable.KTableSortedModel
belongsToCell, getCellEditor, getCellRenderer, getContentAt, getSortColumn, getSortState, getTooltipAt, initialize, mapRowIndexToModel, mapRowIndexToTable, resetRowMapping, setContentAt, sort
 
Methods inherited from class de.kupzog.ktable.KTableDefaultModel
getColumnCount, getColumnWidth, getFirstRowHeight, getFixedColumnCount, getFixedRowCount, getRowCount, getRowHeight, isFixedCell, isHeaderCell, setColumnWidth, setFirstRowHeight, setRowHeight
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DogmaURITable

public DogmaURITable(DogmaResource resource,
                     DogmaURIComponent uriComp)
Creates a new URITable based on the given resource and it's uris.

Parameters:
resource -

DogmaURITable

public DogmaURITable(DogmaURIComponent uriComp)
Method Detail

getItem

public java.lang.String getItem(int row,
                                int col)
getItem gets the value on the cell that corresponds to given row and column

Parameters:
row - The row of the cell to return
col - The column of the cell to return
Returns:
Returns a String - value In case of an error returns null.

deleteRow

public void deleteRow(int row)
Removes the given row from the table.

Parameters:
row - the row that is to be removed.

doGetContentAt

public java.lang.Object doGetContentAt(int col,
                                       int row)
Returns the Object in the cell corresponding to the given values. If some sort of error occurs, zero is returned.

Specified by:
doGetContentAt in class de.kupzog.ktable.KTableDefaultModel

doGetType

public java.lang.String doGetType(int row)
Gets the type-value for the given row.

Parameters:
row - The row we want to check for the type.
Returns:
Returns a String-value if found, otherwise null.

doGetUri

public java.lang.String doGetUri(int row)
Gets the uri-value for the given row.

Parameters:
row - The row we want to check for the uri.
Returns:
Returns a String-value if found, otherwise null.

doGetCellRenderer

public de.kupzog.ktable.KTableCellRenderer doGetCellRenderer(int col,
                                                             int row)
Specified by:
doGetCellRenderer in class de.kupzog.ktable.KTableDefaultModel

doGetCellEditor

public de.kupzog.ktable.KTableCellEditor doGetCellEditor(int col,
                                                         int row,
                                                         boolean r)

doGetCellEditor

public de.kupzog.ktable.KTableCellEditor doGetCellEditor(int col,
                                                         int row)
Specified by:
doGetCellEditor in class de.kupzog.ktable.KTableDefaultModel

doSetContentAt

public void doSetContentAt(int col,
                           int row,
                           java.lang.Object value)
Sets the given value to the cell corresponding to the given column and row. If user wants to set value to the cell that has uri, the uri is parsed to other columns as well. After the content has been set, method updateUriTableModifications() from DogmaURIComponent is called.

Specified by:
doSetContentAt in class de.kupzog.ktable.KTableDefaultModel

doBelongsToCell

public org.eclipse.swt.graphics.Point doBelongsToCell(int col,
                                                      int row)
Overrides:
doBelongsToCell in class de.kupzog.ktable.KTableDefaultModel

getInitialColumnWidth

public int getInitialColumnWidth(int column)
Specified by:
getInitialColumnWidth in class de.kupzog.ktable.KTableDefaultModel

getInitialRowHeight

public int getInitialRowHeight(int row)
Specified by:
getInitialRowHeight in class de.kupzog.ktable.KTableDefaultModel

doGetColumnCount

public int doGetColumnCount()
Returns the amount of columns. If none, returns 0.

Specified by:
doGetColumnCount in class de.kupzog.ktable.KTableDefaultModel

getSize

public org.eclipse.swt.graphics.Point getSize()
Gets the size of the table.

Returns:
Point: x - width of the table y - height of the table

getCellBounds

public org.eclipse.swt.graphics.Rectangle getCellBounds(int x,
                                                        int y)
Returns the bounds of the given cell as a rectangle.

Parameters:
x - x - coordinate for the cell.
y - y - coordinate for the cell.
Returns:
a Rectangle, that has; width - the width of the cell height - the height of the cell x - the starting x-coordinate for the cell y - the starting y-coordinate for the cell

inTable

public boolean inTable(org.eclipse.swt.graphics.Point p)
Checks if the given point is inside our tablelimits. returns true if the point is in the table, otherwise false.


inTable

public boolean inTable(int x,
                       int y)
Checks if the point corresponding to the given x-coordinate and y-coordinate is inside the table.

Parameters:
x - the x-coordinate for the point
y - the y-coordinate for the point
Returns:
returns true if in the table, otherwise false

getCell

public org.eclipse.swt.graphics.Point getCell(int x,
                                              int y)
Gets the cell as a point for the given x and y - coordinates.

Parameters:
x - x - coordinate for the wanted cell.
y - y - coordinate for the wanted cell.
Returns:
Point: x - column of the cell y - row of the cell If the coordinates are not in the table null is returned.

getFixedHeaderRowCount

public int getFixedHeaderRowCount()

getFixedHeaderColumnCount

public int getFixedHeaderColumnCount()

getFixedSelectableRowCount

public int getFixedSelectableRowCount()

getFixedSelectableColumnCount

public int getFixedSelectableColumnCount()

isColumnResizable

public boolean isColumnResizable(int col)

getInitialFirstRowHeight

public int getInitialFirstRowHeight()
Overrides:
getInitialFirstRowHeight in class de.kupzog.ktable.KTableDefaultModel

isRowResizable

public boolean isRowResizable(int row)

getRowHeightMinimum

public int getRowHeightMinimum()

getWidth

public int getWidth()
Returns the width of the table


getResource

public DogmaResource getResource()
Returns the current dogmaresource that is having it's uris shown


getLastVisibleColumn

public int getLastVisibleColumn()
Returns the columnNumber of the last visible column. If none visible, -1 is returned


doGetTooltipAt

public java.lang.String doGetTooltipAt(int col,
                                       int row)
Overrides:
doGetTooltipAt in class de.kupzog.ktable.KTableDefaultModel

hideColumn

public void hideColumn(int col)
Hides the column of the given column-value. (Basically sets it's width 0)

Parameters:
col - The column we want to hide.

showColumn

public void showColumn(int col)
Shows the column of the given column-value

Parameters:
col -

getUriStringTable

public java.lang.String[][] getUriStringTable()

getColumnName

public java.lang.String getColumnName(int col)
Gets the columnNames for the given column.

Parameters:
col - The column for the name we want to get
Returns:
Returns a String - value for the column name. if none is found null is returned.

addRow

public void addRow(boolean toFirst)
Adds a row to the table. If toFirst is true, the row is added to the first place, otherwise it is added to the last place.


doGetRowCount

public int doGetRowCount()
Returns the amount of rows in the URI-table, including also header-row.

Specified by:
doGetRowCount in class de.kupzog.ktable.KTableDefaultModel