org.merlotxml.merlot
Class ChildTableEditor

java.lang.Object
  extended byorg.merlotxml.merlot.ChildTableEditor
All Implemented Interfaces:
MerlotConstants, MerlotDOMEditor

public abstract class ChildTableEditor
extends java.lang.Object
implements MerlotDOMEditor, MerlotConstants

This abstract class implements a node editor that has a table for a set of it's child elements


Nested Class Summary
 class ChildTableEditor.ChildTableEditPanel
           
protected  class ChildTableEditor.ChildTableModel
           
protected  class ChildTableEditor.GenericChildTableEditPanel
           
 
Field Summary
 
Fields inherited from interface org.merlotxml.merlot.MerlotConstants
ACTION_MENU_ACCELERATOR, ACTION_MENU_ICON, ACTION_NAME, ACTION_SHORT_DESCRIPTION, ACTION_SMALL_ICON, AFTER, BEFORE, ERR, INTO, UI, XML
 
Constructor Summary
ChildTableEditor()
           
 
Method Summary
 void addEditChildType(java.lang.String parenttype, java.lang.String childtype)
           
 javax.swing.JPanel getEditPanel(MerlotDOMNode node)
          returns a panel for editing this type of component.
 void grabFocus(javax.swing.JPanel p)
          Tells the edit panel it's gaining focus, so it can put the cursor in the first field.
 void savePanel(javax.swing.JPanel p)
          called by the editor when the user has chosen to save their changes in a panel.
 void setColumns(java.lang.String[] titles, java.lang.String[] attrnames)
          sets the child columns for the table of child nodes.
 void setColumnTypes(java.lang.Class[] coltypes)
           
 void setColumnWidths(int[] colwidths)
           
 void setMinChildren(int m)
           
 void setPreferredTableHeight(int height)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.merlotxml.merlot.MerlotDOMEditor
getMenuItems, suppressAddType, suppressAddType, suppressNode
 

Constructor Detail

ChildTableEditor

public ChildTableEditor()
Method Detail

addEditChildType

public void addEditChildType(java.lang.String parenttype,
                             java.lang.String childtype)

setColumns

public void setColumns(java.lang.String[] titles,
                       java.lang.String[] attrnames)
sets the child columns for the table of child nodes.

Params must be the same length. One is the displayed title. the other is the attribute name on the nodes.


setColumnWidths

public void setColumnWidths(int[] colwidths)

setColumnTypes

public void setColumnTypes(java.lang.Class[] coltypes)

setPreferredTableHeight

public void setPreferredTableHeight(int height)

setMinChildren

public void setMinChildren(int m)

getEditPanel

public javax.swing.JPanel getEditPanel(MerlotDOMNode node)
Description copied from interface: MerlotDOMEditor
returns a panel for editing this type of component.

Specified by:
getEditPanel in interface MerlotDOMEditor

grabFocus

public void grabFocus(javax.swing.JPanel p)
Description copied from interface: MerlotDOMEditor
Tells the edit panel it's gaining focus, so it can put the cursor in the first field. XXX this should probably be handled by event listening instead

Specified by:
grabFocus in interface MerlotDOMEditor

savePanel

public void savePanel(javax.swing.JPanel p)
               throws java.beans.PropertyVetoException
Description copied from interface: MerlotDOMEditor
called by the editor when the user has chosen to save their changes in a panel.

Specified by:
savePanel in interface MerlotDOMEditor
Parameters:
p - the panel that was retreived with getEditPanel(node);
Throws:
java.beans.PropertyVetoException