butler.client.record
Class DRecordEditor

java.lang.Object
  extended by butler.client.record.DRecordEditor

public class DRecordEditor
extends java.lang.Object

Record editor that is used for editing one record.

Author:
Fredrik Bertilsson

Nested Class Summary
static class DRecordEditor.FKColumn
           
static class DRecordEditor.ForeignKeyEditor
           
static class DRecordEditor.ManyToManyEditor
           
static class DRecordEditor.RelatedValue
           
 
Constructor Summary
DRecordEditor()
           
DRecordEditor(Table tab)
          Constructs a record editor for editing a record from the given table.
 
Method Summary
 void addColumn(Column col)
          Adds a column to edit.
 void addColumn(Column col, DValueEditor editor)
           
 void addColumn(Column col, java.lang.String caption)
          Adds a column to edit, with a custom caption.
 void addForeignKey(ForeignKey fk)
          Adds a foreign key to edit.
 void addForeignKey(ForeignKey fk, Column col)
          Adds a foreign key to edit, using a combo box.
 void addForeignKeyEditor(DRecordEditor.ForeignKeyEditor fkEditor)
           
 void addManyToManyEditor(DRecordEditor.ManyToManyEditor editor)
           
 void addRelatedColumn(ForeignKey fk, Column col)
           
 void addRelatedValue(ForeignKey fk, RecordFormatter format, butler.util.LocalizedText caption)
           
 DRecordLookup createRecordLookup()
          Creates a lookup function for the column in the primary key.
 DButtonRow getButtonRow()
           
 java.lang.String getCaption()
           
 java.lang.String getCaption(Column col)
           
 int getCols()
           
 java.util.List getEditors()
           
 Query getQuery()
           
 DRecordSelector getRecordSelector()
           
 Table getTable()
           
 DValueEditor getValueEditor(Column col)
           
 boolean isEditable(Column col)
           
 boolean isShowLabels()
           
static DRecordEditor parse(org.dom4j.Element element)
           
 void setButtonRow(DButtonRow d)
           
 void setCaption(java.lang.String caption)
           
 void setCols(int value)
           
 void setEditable(Column col, boolean flag)
           
 void setQuery(Query query)
           
 void setRecordSelector(DRecordSelector selector)
           
 void setShowLabels(boolean showLabels)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DRecordEditor

public DRecordEditor(Table tab)
Constructs a record editor for editing a record from the given table.


DRecordEditor

public DRecordEditor()
Method Detail

getTable

public Table getTable()

addColumn

public void addColumn(Column col)
               throws java.lang.Exception
Adds a column to edit. Normally, the column value will be edited in a text field.

Throws:
java.lang.Exception

addColumn

public void addColumn(Column col,
                      java.lang.String caption)
               throws java.lang.Exception
Adds a column to edit, with a custom caption.

Throws:
java.lang.Exception

addColumn

public void addColumn(Column col,
                      DValueEditor editor)
               throws java.lang.Exception
Throws:
java.lang.Exception

addForeignKey

public void addForeignKey(ForeignKey fk)
                   throws java.lang.Exception
Adds a foreign key to edit. If there are one column in the foreign key, it will edited in a text field. Otherwise a table will be used. There will also be a lookup-button that launches a selection panel.

Throws:
java.lang.Exception

addForeignKeyEditor

public void addForeignKeyEditor(DRecordEditor.ForeignKeyEditor fkEditor)
                         throws java.lang.Exception
Throws:
java.lang.Exception

addManyToManyEditor

public void addManyToManyEditor(DRecordEditor.ManyToManyEditor editor)

addForeignKey

public void addForeignKey(ForeignKey fk,
                          Column col)
                   throws java.lang.Exception
Adds a foreign key to edit, using a combo box. All records from the related table will be selectable in the combo. For every record, the value for the given column will be displayed.

Throws:
java.lang.Exception

addRelatedColumn

public void addRelatedColumn(ForeignKey fk,
                             Column col)
                      throws java.lang.Exception
Throws:
java.lang.Exception

addRelatedValue

public void addRelatedValue(ForeignKey fk,
                            RecordFormatter format,
                            butler.util.LocalizedText caption)
                     throws java.lang.Exception
Throws:
java.lang.Exception

setEditable

public void setEditable(Column col,
                        boolean flag)

isEditable

public boolean isEditable(Column col)

getEditors

public java.util.List getEditors()
                          throws java.lang.Exception
Throws:
java.lang.Exception

getValueEditor

public DValueEditor getValueEditor(Column col)
                            throws java.lang.Exception
Throws:
java.lang.Exception

setButtonRow

public void setButtonRow(DButtonRow d)

getButtonRow

public DButtonRow getButtonRow()

getRecordSelector

public DRecordSelector getRecordSelector()

setRecordSelector

public void setRecordSelector(DRecordSelector selector)

createRecordLookup

public DRecordLookup createRecordLookup()
                                 throws java.lang.Exception
Creates a lookup function for the column in the primary key. The key value for the record can be entered in the text field to search for the record to edit. There will also be a lookup- button that launches a selection panel to select the record to edit.

Throws:
java.lang.Exception

getCols

public int getCols()

setCols

public void setCols(int value)

getCaption

public java.lang.String getCaption()
                            throws java.lang.Exception
Throws:
java.lang.Exception

setCaption

public void setCaption(java.lang.String caption)

getCaption

public java.lang.String getCaption(Column col)
                            throws java.lang.Exception
Throws:
java.lang.Exception

parse

public static DRecordEditor parse(org.dom4j.Element element)
                           throws java.lang.Exception
Throws:
java.lang.Exception

getQuery

public Query getQuery()

setQuery

public void setQuery(Query query)

isShowLabels

public boolean isShowLabels()

setShowLabels

public void setShowLabels(boolean showLabels)