/** Accepts property changes from DataObject and fires them to * own listeners. */ public void propertyChange(PropertyChangeEvent ev) { if (DataObject.PROP_MODIFIED.equals (ev.getPropertyName())) { if (getDataObject ().isModified ()) { getDataObject ().addVetoableChangeListener(this); } else { getDataObject ().removeVetoableChangeListener(this); } } firePropertyChange ( ev.getPropertyName (), ev.getOldValue (), ev.getNewValue () ); }
/** Test whether the object is modified or not. * @return true if the object is modified */ public boolean isModified() { return getDataObject ().isModified (); }
/** Test whether the support is in valid state or not. * It could be invalid after deserialization when the object it * referenced to does not exist anymore. * * @return true or false depending on its state */ public boolean isValid () { return getDataObject ().isValid (); }
/** Support for marking the environement modified. * @exception 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 changes */ public void markModified() throws java.io.IOException { getDataObject ().setModified (true); }
/** Reverse method that can be called to make the environment * unmodified. */ public void unmarkModified() { getDataObject ().setModified (false); }
/** Method that allows environment to find its * cloneable open support. * @return the support or null if the environemnt is not in valid * state and the CloneableOpenSupport cannot be found for associated * data object */ public CloneableOpenSupport findCloneableOpenSupport() { return (CloneableOpenSupport)getDataObject ().getCookie (CloneableOpenSupport.class); }