org.merlotxml.merlot
Interface MerlotDOMEditor

All Known Implementing Classes:
ChildTableEditor, GenericDOMEditor, NullEditor, SchemaDOMEditor

public interface MerlotDOMEditor

This is an interface which every Node editor panel must implement. Node editors provide a way to change information contained in a DOM node within an xml file. This includes special menu items to add to the right-click popup menu and an editing panel to change attributes and sub-nodes. DOMEditors can also specify what types of nodes should not show up in the tree view (this functionality may move into the plugin classes instead of here... it doesn't really belong here.)

Author:
Kelly A. Campbell
See Also:
GenericDOMEditor, GenericDOMEditPanel

Method Summary
 javax.swing.JPanel getEditPanel(MerlotDOMNode node)
          returns a panel for editing this type of component.
 javax.swing.JMenuItem[] getMenuItems(MerlotDOMNode node)
          Returns a set of menu items for any special actions for this particular editor that it wants in the popup menu.
 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.
 boolean suppressAddType(DTDElement el)
          Deprecated.  
 boolean suppressAddType(GrammarComplexType el)
           
 boolean suppressNode(MerlotDOMNode node)
          Returns true if the component editor wants a particular node hidden from the user.
 

Method Detail

getMenuItems

public javax.swing.JMenuItem[] getMenuItems(MerlotDOMNode node)
Returns a set of menu items for any special actions for this particular editor that it wants in the popup menu. Standard stuff like cut, copy, paste is taken care of by other objects. If nothing needs added, can return null.

Parameters:
node - the node for which to get the menu items

getEditPanel

public javax.swing.JPanel getEditPanel(MerlotDOMNode node)
returns a panel for editing this type of component.


savePanel

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

Parameters:
p - the panel that was retreived with getEditPanel(node);
Throws:
java.beans.PropertyVetoException

grabFocus

public void grabFocus(javax.swing.JPanel p)
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


suppressNode

public boolean suppressNode(MerlotDOMNode node)
Returns true if the component editor wants a particular node hidden from the user. If the editor wants to filter what the user sees in their display, it should look at the given node, otherwise it should return false. This is usefull particularly if the editor handles its children. It can hide the children nodes from the user's view.


suppressAddType

public boolean suppressAddType(DTDElement el)
Deprecated.  

allows the plugin to hide certain items on the add-> menu. For example, the plugin for the accessibility permissions might not want the user to be able to directly add an "access" element, so it can request that that be suppressed.


suppressAddType

public boolean suppressAddType(GrammarComplexType el)