org.tentackle.appworx
Class SecurityTableEntry

java.lang.Object
  extended by org.tentackle.ui.FormTableEntry
      extended by org.tentackle.appworx.SecurityTableEntry

public class SecurityTableEntry
extends FormTableEntry

The default formtable entry for a Security rule.

Author:
harald

Field Summary
protected static int ALLOW
           
protected static String[] columnNames
           
protected static int CONTEXT
           
static Class[] contextClazz
          For multi-tenancy the base context class and all its child context classes may be defined here.
protected static int GRANTEE
           
static Class<? extends AppDbObject> granteeClazz
          By default there is only one grantee-class for the grantee cell editor.
protected static int PRIVS
           
protected  Security security
           
protected static int TEXT
           
 
Constructor Summary
SecurityTableEntry(Security security)
          Creates a table entry.
 
Method Summary
 TableCellEditor getCellEditor(int col)
          Gets the cell editor for a given column.
 TableCellRenderer getCellRenderer(int col)
          Gets the cell renderer for a given column.
Depending on isCellRendererFixed() this method is invoked only once per column or for each cell.
 int getColumnCount()
          Determines the number of data-model columns.
 String getColumnName(int col)
          Describes the column name.
This may be a symbolic name if getDisplayedColumnName() is overridden.
 String getDisplayedColumnName(int col)
          Gets the displayed column name.
By default the column-name and the displayed column name are the same.
 Object getObject()
          Gets the object wrapped by this entry.
 Object getValueAt(int col)
          Gets the column-object for this entry in a given column.
 boolean isCellEditable(int mColumn)
          Determines whether the cell is editable or not.
 FormTableEntry newInstanceOf(Object object)
          Creates a new instance of an entry for a given data-object.
 AppDbObject selectGrantee()
          Selects the grantee.
 void setValueAt(int col, Object obj)
          Sets the data object for a column.
 
Methods inherited from class org.tentackle.ui.FormTableEntry
compareTo, fireCellsUpdated, fireRowUpdated, getCellRect, getColumnClass, getConvert, getFormat, getHorizontalAlignment, getModel, getReferencedColumn, getReferencedRow, getRow, getShowHorizontalLine, getShowVerticalLine, getVerticalAlignment, isAutoSelect, isBlankZero, isCellEditorFixed, isCellRectFixed, isCellRendererFixed, isCellVisible, isColumnNotSummable, isVisiblyEqual, setModel, setRow, updateArray, updateCursor, updateList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

granteeClazz

public static Class<? extends AppDbObject> granteeClazz
By default there is only one grantee-class for the grantee cell editor. Your application *MUST* set this or extend the Security...-classes to add groups, etc...


contextClazz

public static Class[] contextClazz
For multi-tenancy the base context class and all its child context classes may be defined here. If contextClazz is null (default), the context column will be non-editable. Otherwise a selection dialog for the first of the given class is shown in the context of the table entry's object. All classes in the array are selectable.


GRANTEE

protected static final int GRANTEE
See Also:
Constant Field Values

CONTEXT

protected static final int CONTEXT
See Also:
Constant Field Values

PRIVS

protected static final int PRIVS
See Also:
Constant Field Values

TEXT

protected static final int TEXT
See Also:
Constant Field Values

ALLOW

protected static final int ALLOW
See Also:
Constant Field Values

columnNames

protected static final String[] columnNames

security

protected Security security
Constructor Detail

SecurityTableEntry

public SecurityTableEntry(Security security)
Creates a table entry.

Parameters:
security - the security object
Method Detail

newInstanceOf

public FormTableEntry newInstanceOf(Object object)
Description copied from class: FormTableEntry
Creates a new instance of an entry for a given data-object.

Specified by:
newInstanceOf in class FormTableEntry
Parameters:
object - the data-object
Returns:
the FormTableEntry for this object

getObject

public Object getObject()
Description copied from class: FormTableEntry
Gets the object wrapped by this entry.

Specified by:
getObject in class FormTableEntry
Returns:
the data object

getColumnName

public String getColumnName(int col)
Description copied from class: FormTableEntry
Describes the column name.
This may be a symbolic name if getDisplayedColumnName() is overridden.

Specified by:
getColumnName in class FormTableEntry
Parameters:
col - the datamodel-column
Returns:
the name of the column

getDisplayedColumnName

public String getDisplayedColumnName(int col)
Description copied from class: FormTableEntry
Gets the displayed column name.
By default the column-name and the displayed column name are the same.

Overrides:
getDisplayedColumnName in class FormTableEntry
Parameters:
col - the datamodel column
Returns:
the display name of the column

isCellEditable

public boolean isCellEditable(int mColumn)
Determines whether the cell is editable or not. The default is not editable.

All cells are editable, except CONTEXT which is only editable if contextClazz is not null.

Overrides:
isCellEditable in class FormTableEntry
Parameters:
mColumn - the datamodel-column
Returns:
true if the cell is editable.

getColumnCount

public int getColumnCount()
Description copied from class: FormTableEntry
Determines the number of data-model columns. Notice that not all columns may actually be visible.

Specified by:
getColumnCount in class FormTableEntry
Returns:
the number of columns

getValueAt

public Object getValueAt(int col)
Description copied from class: FormTableEntry
Gets the column-object for this entry in a given column.

Specified by:
getValueAt in class FormTableEntry
Parameters:
col - the datamodel-column
Returns:
the column data object

setValueAt

public void setValueAt(int col,
                       Object obj)
Description copied from class: FormTableEntry
Sets the data object for a column. The default implementation does nothing.

Overrides:
setValueAt in class FormTableEntry
Parameters:
col - the datamodel-column
obj - the cell value

getCellRenderer

public TableCellRenderer getCellRenderer(int col)
Description copied from class: FormTableEntry
Gets the cell renderer for a given column.
Depending on isCellRendererFixed() this method is invoked only once per column or for each cell. The default implementation returns null, i.e. a default renderer depending on the class is used.

Overrides:
getCellRenderer in class FormTableEntry
Parameters:
col - the datamodel-column
Returns:
the renderer or null if default

getCellEditor

public TableCellEditor getCellEditor(int col)
Description copied from class: FormTableEntry
Gets the cell editor for a given column. Depending on isCellEditorFixed() this method is invoked only once per column or for each cell. Furthermore the cell must be editable. The default implementation returns null, i.e. a default editor depending on the class is used.

Overrides:
getCellEditor in class FormTableEntry
Parameters:
col - the datamodel-column
Returns:
the editor or null if default

selectGrantee

public AppDbObject selectGrantee()
Selects the grantee. The default implementation invokes the AppDbSearchDialog for the grantee class.

Returns:
the grantee, null if cancelled or no granteeclazz set


Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de