org.eclipse.emf.edit.tree.util
Class TreeAdapterFactory

java.lang.Object
  extended by org.eclipse.emf.common.notify.impl.AdapterFactoryImpl
      extended by org.eclipse.emf.edit.tree.util.TreeAdapterFactory
All Implemented Interfaces:
AdapterFactory
Direct Known Subclasses:
TreeItemProviderAdapterFactory

public class TreeAdapterFactory
extends AdapterFactoryImpl

The Adapter Factory for the model. It provides an adapter createXXX method for each class of the model.

See Also:
TreePackage

Field Summary
protected static TreePackage modelPackage
          The cached model package
protected  TreeSwitch<Adapter> modelSwitch
          The switch that delegates to the createXXX methods
 
Constructor Summary
TreeAdapterFactory()
          Creates an instance of the adapter factory
 
Method Summary
 Adapter createAdapter(Notifier target)
          Creates an adapter for the target
 Adapter createEObjectAdapter()
          Creates a new adapter for the default case
 Adapter createTreeNodeAdapter()
          Creates a new adapter for an object of class 'Node'
 boolean isFactoryForType(java.lang.Object object)
          Returns whether this factory is applicable for the type of the object
 
Methods inherited from class org.eclipse.emf.common.notify.impl.AdapterFactoryImpl
adapt, adapt, adaptAllNew, adaptNew, associate, createAdapter, resolve
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

modelPackage

protected static TreePackage modelPackage
The cached model package.


modelSwitch

protected TreeSwitch<Adapter> modelSwitch
The switch that delegates to the createXXX methods.

Constructor Detail

TreeAdapterFactory

public TreeAdapterFactory()
Creates an instance of the adapter factory.

Method Detail

isFactoryForType

public boolean isFactoryForType(java.lang.Object object)
Returns whether this factory is applicable for the type of the object. This implementation returns true if the object is either the model's package or is an instance object of the model.

Specified by:
isFactoryForType in interface AdapterFactory
Overrides:
isFactoryForType in class AdapterFactoryImpl
Parameters:
object - the key indicating the type of adapter in question.
Returns:
whether this factory is applicable for the type of the object.
See Also:
Adapter.isAdapterForType(java.lang.Object)

createAdapter

public Adapter createAdapter(Notifier target)
Creates an adapter for the target.

Overrides:
createAdapter in class AdapterFactoryImpl
Parameters:
target - the object to adapt.
Returns:
the adapter for the target.
See Also:
AdapterFactoryImpl.createAdapter(Notifier)

createTreeNodeAdapter

public Adapter createTreeNodeAdapter()
Creates a new adapter for an object of class 'Node'. This default implementation returns null so that we can easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway.

Returns:
the new adapter.
See Also:
TreeNode

createEObjectAdapter

public Adapter createEObjectAdapter()
Creates a new adapter for the default case. This default implementation returns null.

Returns:
the new adapter.

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.