Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.openide.loaders 5.9.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.openide.loaders
Class OpenSupport.Env

    java.lang.Object
      org.openide.loaders.OpenSupport.Env

All Implemented Interfaces:
  PropertyChangeListener, VetoableChangeListener, Serializable, EventListener, CloneableOpenSupport.Env

Direct Known Subclasses:
  DataEditorSupport.Env

Enclosing class:
  OpenSupport

    public static class OpenSupport.Env

extends Object
implements CloneableOpenSupport.Env, Serializable, PropertyChangeListener, VetoableChangeListener

Environment that connects the support together with DataObject.

See Also:
  Serialized Form

Field Summary

Fields inherited from interface org.openide.windows.CloneableOpenSupport.Env
`PROP_MODIFIED, PROP_VALID`

Constructor Summary
`OpenSupport.Env(DataObject obj)` Constructor.

Method Summary
`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.
`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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### OpenSupport.Env

    public OpenSupport.Env(DataObject obj)

  Constructor. Attaches itself as listener to the data object so, all property changes of the data object are also rethrown to own listeners.

  Parameters:
    `obj` - data object to be attached to

Method Detail

### getDataObject

    protected final DataObject getDataObject()

  Getter for data object.

### addPropertyChangeListener

    public void addPropertyChangeListener(PropertyChangeListener l)

  Adds property listener.

  Specified by:
    `addPropertyChangeListener` in interface `CloneableOpenSupport.Env`

### removePropertyChangeListener

    public void removePropertyChangeListener(PropertyChangeListener l)

  Removes property listener.

  Specified by:
    `removePropertyChangeListener` in interface `CloneableOpenSupport.Env`

### addVetoableChangeListener

    public void addVetoableChangeListener(VetoableChangeListener l)

  Adds veto listener.

  Specified by:
    `addVetoableChangeListener` in interface `CloneableOpenSupport.Env`

### removeVetoableChangeListener

    public void removeVetoableChangeListener(VetoableChangeListener l)

  Removes veto listener.

  Specified by:
    `removeVetoableChangeListener` in interface `CloneableOpenSupport.Env`

### isValid

    public boolean isValid()

  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.

  Specified by:
    `isValid` in interface `CloneableOpenSupport.Env`
  Returns:
    true or false depending on its state

### isModified

    public boolean isModified()

  Test whether the object is modified or not.

  Specified by:
    `isModified` in interface `CloneableOpenSupport.Env`
  Returns:
    true if the object is modified

### markModified

    public void markModified()
                      throws IOException

  Support for marking the environement modified.

  Specified by:
    `markModified` in interface `CloneableOpenSupport.Env`
  Throws:
    `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

### unmarkModified

    public void unmarkModified()

  Reverse method that can be called to make the environment unmodified.

  Specified by:
    `unmarkModified` in interface `CloneableOpenSupport.Env`

### findCloneableOpenSupport

    public CloneableOpenSupport findCloneableOpenSupport()

  Method that allows environment to find its cloneable open support.

  Specified by:
    `findCloneableOpenSupport` in interface `CloneableOpenSupport.Env`
  Returns:
    the support or null if the environemnt is not in valid state and the CloneableOpenSupport cannot be found for associated data object

### propertyChange

    public void propertyChange(PropertyChangeEvent ev)

  Accepts property changes from DataObject and fires them to own listeners.

  Specified by:
    `propertyChange` in interface `PropertyChangeListener`

### vetoableChange

    public void vetoableChange(PropertyChangeEvent ev)
                        throws PropertyVetoException

  Accepts vetoable changes and fires them to own listeners.

  Specified by:
    `vetoableChange` in interface `VetoableChangeListener`
  Throws:
    `PropertyVetoException`

### firePropertyChange

    protected void firePropertyChange(String name,
                                      Object oldValue,
                                      Object newValue)

  Fires property change.

  Parameters:
    `name` - the name of property that changed
    `oldValue` - old value
    `newValue` - new value

### fireVetoableChange

    protected void fireVetoableChange(String name,
                                      Object oldValue,
                                      Object newValue)
                               throws PropertyVetoException

  Fires vetoable change.

  Parameters:
    `name` - the name of property that changed
    `oldValue` - old value
    `newValue` - new value
  Throws:
    `PropertyVetoException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.openide.loaders 5.9.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Built on December 7 2006. | Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.