com.ca.directory.jxplorer.viewer.tableviewer
Class AttributeValueCellEditor

java.lang.Object
  |
  +--com.ca.directory.jxplorer.viewer.tableviewer.AbstractCellEditor
        |
        +--com.ca.directory.jxplorer.viewer.tableviewer.AttributeValueCellEditor
All Implemented Interfaces:
javax.swing.CellEditor, javax.swing.table.TableCellEditor

public class AttributeValueCellEditor
extends AbstractCellEditor

The cell editor that brings up the dialog. We inherit from AbstractCellEditor, even though it means we have to create a dummy check box. Attribute Value Editor uses schema info to validate the user's input before submission...


Field Summary
 DN currentDN
           
 DataSource datasource
           
protected  java.lang.ClassLoader myLoader
           
 
Fields inherited from class com.ca.directory.jxplorer.viewer.tableviewer.AbstractCellEditor
changeEvent, clickCountToStart, listenerList, value
 
Constructor Summary
AttributeValueCellEditor(java.awt.Frame parent)
          A basic constructor, which does little except add a mouse listener to the default text field, setting the click count for 'cancel editing' to two.
 
Method Summary
 void cleanupEditor()
          Sets the the abstract editor (display editor for binary data - e.g. the audio player, or photo viewer), to null.
 java.lang.String getAttributeSyntax(AttributeValue att)
          Returns the syntax of the attribute value that is supplied
 java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)
          Returns an awt.Component that acts as a cell editor.
 boolean isCellEditable(java.util.EventObject e)
          Checks if the user has clicked sufficient times to make the cell editable.
 boolean isCertificate(AttributeValue att)
          Checks if the attribute value is a certificate.
 boolean isGeneralizedTime(AttributeValue att)
          Checks if the attribute value is a generalizedTime..
 boolean isPostalAddress(AttributeValue att)
          Checks if the attribute value is a postalAddress.
 void registerClassLoader(java.lang.ClassLoader loader)
          Optionally register a new class loader for atribute value viewers to use.
 void setDataSource(DataSource ds)
          Returns the datasource.
 void setDN(DN dn)
          Sets the dn of the entry being modified.
 void startBinaryEditor(AttributeValue att)
          Kicks of a separate binary editor by looking for a Java class with name of the attribute, plus the word 'Editor', and starting that up if it can be found.
 boolean stopCellEditing()
          Does a quick check to make the binary handling sane (if necessary) before calling the super class stopCellEditing.
 
Methods inherited from class com.ca.directory.jxplorer.viewer.tableviewer.AbstractCellEditor
addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getCellEditorValue, getClickCountToStart, removeCellEditorListener, setCellEditorValue, setClickCountToStart, shouldSelectCell
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myLoader

protected java.lang.ClassLoader myLoader

datasource

public DataSource datasource

currentDN

public DN currentDN
Constructor Detail

AttributeValueCellEditor

public AttributeValueCellEditor(java.awt.Frame parent)
A basic constructor, which does little except add a mouse listener to the default text field, setting the click count for 'cancel editing' to two.

Method Detail

getTableCellEditorComponent

public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table,
                                                      java.lang.Object value,
                                                      boolean isSelected,
                                                      int row,
                                                      int column)
Returns an awt.Component that acts as a cell editor.


isCertificate

public boolean isCertificate(AttributeValue att)
Checks if the attribute value is a certificate.

Parameters:
att - the attribute value for example 'Fred' from 'cn=Fred'.
Returns:
true if the value is a certificate (i.e. its syntax matches '1.3.6.1.4.1.1466.115.121.1.8'. Returns false otherwise.

isPostalAddress

public boolean isPostalAddress(AttributeValue att)
Checks if the attribute value is a postalAddress.

Parameters:
att - the attribute value for example 'Fred' from 'cn=Fred'.
Returns:
true if the value is a postalAddress (i.e. its syntax matches '1.3.6.1.4.1.1466.115.121.1.41'. Returns false otherwise.

isGeneralizedTime

public boolean isGeneralizedTime(AttributeValue att)
Checks if the attribute value is a generalizedTime..

Parameters:
att - the attribute value for example 'Fred' from 'cn=Fred'.
Returns:
true if the value is a generalizedTime (i.e. its syntax matches '1.3.6.1.4.1.1466.115.121.1.24'. Returns false otherwise.

getAttributeSyntax

public java.lang.String getAttributeSyntax(AttributeValue att)
Returns the syntax of the attribute value that is supplied

Parameters:
att - the attribute value for example 'Fred' from 'cn=Fred'.
Returns:
the syntax of the attribute for example for postalAddress the return string would be: 'SYNTAX: 1.3.6.1.4.1.1466.115.121.1.41'.

stopCellEditing

public boolean stopCellEditing()
Does a quick check to make the binary handling sane (if necessary) before calling the super class stopCellEditing.

Specified by:
stopCellEditing in interface javax.swing.CellEditor
Overrides:
stopCellEditing in class AbstractCellEditor

isCellEditable

public boolean isCellEditable(java.util.EventObject e)
Checks if the user has clicked sufficient times to make the cell editable.

Specified by:
isCellEditable in interface javax.swing.CellEditor
Overrides:
isCellEditable in class AbstractCellEditor

startBinaryEditor

public void startBinaryEditor(AttributeValue att)
Kicks of a separate binary editor by looking for a Java class with name of the attribute, plus the word 'Editor', and starting that up if it can be found. (Otherwise it uses the default editor).


registerClassLoader

public void registerClassLoader(java.lang.ClassLoader loader)
Optionally register a new class loader for atribute value viewers to use.


setDataSource

public void setDataSource(DataSource ds)
Returns the datasource.

Parameters:
ds - the datasource.

setDN

public void setDN(DN dn)
Sets the dn of the entry being modified.

Parameters:
dn - the DN of the entry being modified.

cleanupEditor

public void cleanupEditor()
Sets the the abstract editor (display editor for binary data - e.g. the audio player, or photo viewer), to null.