net.sourceforge.nite.gui.util
Class ElementDisplay

java.lang.Object
  extended by net.sourceforge.nite.gui.util.ElementDisplay
All Implemented Interfaces:
NOMView

public class ElementDisplay
extends java.lang.Object
implements NOMView

a utility class for viewing and editing arbitrary elements in the NOM. Note that nothing is written to the NOM until applyChanges is called from the calling program


Constructor Summary
ElementDisplay(NOMElement element)
          Simple constructor that constructs a display that has the default edit-ability (editable) for the given element
ElementDisplay(NOMElement element, boolean editable)
          Simple constructor specifying element and editability of the window.
 
Method Summary
 void applyChanges()
          apply any changes to the NOM that have accumulated and save the changes to disk
 void changeElement(NOMElement element)
          change element we're displaying
 int checkExit()
          check for changes and if there are any pop up a question to user
 void clearChanges()
          clear changes
 javax.swing.JComponent getPanel()
          return the Panel containing the edit / display GUI
 void handleChange(NOMEdit edit)
          Implementation of NOMView interface - just ignore edits for now
 boolean isChanged()
          have we made changes to the element or any since this window has opened?
 void setEditable(boolean edit)
          set the editability of this window
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementDisplay

public ElementDisplay(NOMElement element)
Simple constructor that constructs a display that has the default edit-ability (editable) for the given element


ElementDisplay

public ElementDisplay(NOMElement element,
                      boolean editable)
Simple constructor specifying element and editability of the window.

Method Detail

getPanel

public javax.swing.JComponent getPanel()
return the Panel containing the edit / display GUI


setEditable

public void setEditable(boolean edit)
set the editability of this window


isChanged

public boolean isChanged()
have we made changes to the element or any since this window has opened?


applyChanges

public void applyChanges()
apply any changes to the NOM that have accumulated and save the changes to disk


clearChanges

public void clearChanges()
clear changes


changeElement

public void changeElement(NOMElement element)
change element we're displaying


checkExit

public int checkExit()
check for changes and if there are any pop up a question to user


handleChange

public void handleChange(NOMEdit edit)
Implementation of NOMView interface - just ignore edits for now

Specified by:
handleChange in interface NOMView