org.xmlhammer.gui
Class FieldManager

java.lang.Object
  extended by org.xmlhammer.gui.FieldManager
All Implemented Interfaces:
java.awt.event.FocusListener, java.awt.event.ItemListener, java.util.EventListener, javax.swing.event.DocumentListener

public class FieldManager
extends java.lang.Object
implements java.awt.event.FocusListener, java.awt.event.ItemListener, javax.swing.event.DocumentListener

Manages the fields for a project, handling undo and focus ...

Version:
$Revision: 1.12 $, $Date: 2006/10/25 10:07:42 $
Author:
Edwin Dankert

Field Summary
protected  javax.swing.event.EventListenerList listeners
           
 
Constructor Summary
FieldManager(ProjectView view)
           
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener l)
           
 void addField(javax.swing.JComponent field)
           
 void changedUpdate(javax.swing.event.DocumentEvent arg0)
           
 void focusGained(java.awt.event.FocusEvent event)
           
 void focusLost(java.awt.event.FocusEvent event)
           
 javax.swing.JComponent getLastFocusedField()
           
 void insertUpdate(javax.swing.event.DocumentEvent event)
           
 boolean isChanged()
           
 boolean isIgnoreChanges()
           
 void itemStateChanged(java.awt.event.ItemEvent e)
           
 void notifyChange()
          notifies user changes to the underlying project view.
 void removeChangeListener(javax.swing.event.ChangeListener l)
           
 void removeField(javax.swing.JComponent field)
           
 void removeUpdate(javax.swing.event.DocumentEvent event)
           
 void setChanged(boolean changed)
           
 void setFieldsChanged(boolean changed)
           
 void setIgnoreChanges(boolean ignore)
           
 void setPropertiesChanged(boolean changed)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

protected javax.swing.event.EventListenerList listeners
Constructor Detail

FieldManager

public FieldManager(ProjectView view)
Parameters:
view - the view this field manager should manage.
Method Detail

addField

public void addField(javax.swing.JComponent field)
Parameters:
field - the field to listen to changes on.

removeField

public void removeField(javax.swing.JComponent field)
Parameters:
field - the field to listen to changes for.

focusGained

public void focusGained(java.awt.event.FocusEvent event)
Specified by:
focusGained in interface java.awt.event.FocusListener
Parameters:
event - invoked when a field gained focus.

focusLost

public void focusLost(java.awt.event.FocusEvent event)
Specified by:
focusLost in interface java.awt.event.FocusListener
Parameters:
event - invoked when a field lost focus.

getLastFocusedField

public javax.swing.JComponent getLastFocusedField()
Returns:
the field which had focus last.

isChanged

public boolean isChanged()
Returns:
true when any of the fields have been changed by the user.

setChanged

public void setChanged(boolean changed)
Parameters:
changed - overrides the changed state from the outside (view saved/initialised).

setFieldsChanged

public void setFieldsChanged(boolean changed)
Parameters:
changed - overrides the changed state from the outside.

setPropertiesChanged

public void setPropertiesChanged(boolean changed)
Parameters:
changed - overrides the changed state from the outside.

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener
Parameters:
e - state has changed.

setIgnoreChanges

public void setIgnoreChanges(boolean ignore)
Parameters:
e - state has changed.

isIgnoreChanges

public boolean isIgnoreChanges()
Parameters:
e - state has changed.

notifyChange

public void notifyChange()
notifies user changes to the underlying project view.


insertUpdate

public void insertUpdate(javax.swing.event.DocumentEvent event)
Specified by:
insertUpdate in interface javax.swing.event.DocumentListener

removeUpdate

public void removeUpdate(javax.swing.event.DocumentEvent event)
Specified by:
removeUpdate in interface javax.swing.event.DocumentListener

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener l)

removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener l)

changedUpdate

public void changedUpdate(javax.swing.event.DocumentEvent arg0)
Specified by:
changedUpdate in interface javax.swing.event.DocumentListener


Copyright 2005-2005-2008 Edwin Dankert. All Rights Reserved.