public static class OpenSupport.Env extends Object implements CloneableOpenSupport.Env, Serializable, PropertyChangeListener, VetoableChangeListener
PROP_MODIFIED, PROP_VALID
Constructor and Description |
---|
Env(DataObject obj)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener l)
Adds property listener.
|
void |
addVetoableChangeListener(VetoableChangeListener l)
Adds veto listener.
|
CloneableOpenSupport |
findCloneableOpenSupport()
Method that allows environment to find its
cloneable open support.
|
protected void |
firePropertyChange(String name,
Object oldValue,
Object newValue)
Fires property change.
|
protected void |
fireVetoableChange(String name,
Object oldValue,
Object newValue)
Fires vetoable change.
|
protected DataObject |
getDataObject()
Getter for data object.
|
boolean |
isModified()
Test whether the object is modified or not.
|
boolean |
isValid()
Test whether the support is in valid state or not.
|
void |
markModified()
Support for marking the environement modified.
|
void |
propertyChange(PropertyChangeEvent ev)
Accepts property changes from DataObject and fires them to
own listeners.
|
void |
removePropertyChangeListener(PropertyChangeListener l)
Removes property listener.
|
void |
removeVetoableChangeListener(VetoableChangeListener l)
Removes veto listener.
|
String |
toString() |
void |
unmarkModified()
Reverse method that can be called to make the environment
unmodified.
|
void |
vetoableChange(PropertyChangeEvent ev)
Accepts vetoable changes and fires them to own listeners.
|
public Env(DataObject obj)
obj
- data object to be attached toprotected final DataObject getDataObject()
public void addPropertyChangeListener(PropertyChangeListener l)
addPropertyChangeListener
in interface CloneableOpenSupport.Env
public void removePropertyChangeListener(PropertyChangeListener l)
removePropertyChangeListener
in interface CloneableOpenSupport.Env
public void addVetoableChangeListener(VetoableChangeListener l)
addVetoableChangeListener
in interface CloneableOpenSupport.Env
public void removeVetoableChangeListener(VetoableChangeListener l)
removeVetoableChangeListener
in interface CloneableOpenSupport.Env
public boolean isValid()
isValid
in interface CloneableOpenSupport.Env
public boolean isModified()
isModified
in interface CloneableOpenSupport.Env
public void markModified() throws IOException
markModified
in interface CloneableOpenSupport.Env
IOException
- if the environment cannot be marked modified
(for example when the file is readonly), when such exception
is the support should discard all previous changespublic void unmarkModified()
unmarkModified
in interface CloneableOpenSupport.Env
public CloneableOpenSupport findCloneableOpenSupport()
findCloneableOpenSupport
in interface CloneableOpenSupport.Env
public void propertyChange(PropertyChangeEvent ev)
propertyChange
in interface PropertyChangeListener
public void vetoableChange(PropertyChangeEvent ev) throws PropertyVetoException
vetoableChange
in interface VetoableChangeListener
PropertyVetoException
protected void firePropertyChange(String name, Object oldValue, Object newValue)
name
- the name of property that changedoldValue
- old valuenewValue
- new valueprotected void fireVetoableChange(String name, Object oldValue, Object newValue) throws PropertyVetoException
name
- the name of property that changedoldValue
- old valuenewValue
- new valuePropertyVetoException