org.eclipse.jpt.utility.model.event
Class TreeChangeEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.eclipse.jpt.utility.model.event.ChangeEvent
          extended by org.eclipse.jpt.utility.model.event.TreeChangeEvent
All Implemented Interfaces:
java.io.Serializable

public class TreeChangeEvent
extends ChangeEvent

A "tree change" event gets delivered whenever a model changes a "bound" or "constrained" tree. A TreeChangeEvent is sent as an argument to the TreeChangeListener. Normally a TreeChangeEvent is accompanied by the tree name and a path to the part of the tree that was changed. Provisional API: This class is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

See Also:
Serialized Form

Constructor Summary
TreeChangeEvent(Model source, java.lang.String treeName)
          Construct a new tree change event.
TreeChangeEvent(Model source, java.lang.String treeName, java.lang.Object[] path)
          Construct a new tree change event.
 
Method Summary
 TreeChangeEvent cloneWithSource(Model newSource)
          Return a copy of the event with the specified source replacing the current source.
 TreeChangeEvent cloneWithSource(Model newSource, java.lang.String newTreeName)
          Return a copy of the event with the specified source replacing the current source and the tree name.
 java.lang.String getAspectName()
          Return the name of the aspect of the source that changed.
 java.lang.Object[] getPath()
          Return the path to the part of the tree that was changed.
 java.lang.String getTreeName()
          Return the programmatic name of the tree that was changed.
 
Methods inherited from class org.eclipse.jpt.utility.model.event.ChangeEvent
getSource, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TreeChangeEvent

public TreeChangeEvent(Model source,
                       java.lang.String treeName,
                       java.lang.Object[] path)
Construct a new tree change event.

Parameters:
source - The object on which the event initially occurred.
treeName - The programmatic name of the tree that was changed.
path - The path to the part of the tree that was changed.

TreeChangeEvent

public TreeChangeEvent(Model source,
                       java.lang.String treeName)
Construct a new tree change event.

Parameters:
source - The object on which the event initially occurred.
treeName - The programmatic name of the tree that was changed.
Method Detail

getTreeName

public java.lang.String getTreeName()
Return the programmatic name of the tree that was changed.


getAspectName

public java.lang.String getAspectName()
Description copied from class: ChangeEvent
Return the name of the aspect of the source that changed. May be null if inappropriate.

Specified by:
getAspectName in class ChangeEvent

getPath

public java.lang.Object[] getPath()
Return the path to the part of the tree that was changed. May be empty, if not known.


cloneWithSource

public TreeChangeEvent cloneWithSource(Model newSource)
Description copied from class: ChangeEvent
Return a copy of the event with the specified source replacing the current source.

Specified by:
cloneWithSource in class ChangeEvent

cloneWithSource

public TreeChangeEvent cloneWithSource(Model newSource,
                                       java.lang.String newTreeName)
Return a copy of the event with the specified source replacing the current source and the tree name.