org.eclipse.stp.core.saf.handler
Class AbstractEntryPointHandler

java.lang.Object
  extended byorg.eclipse.stp.core.saf.handler.AbstractHandler
      extended byorg.eclipse.stp.core.saf.handler.AbstractEntryPointHandler
All Implemented Interfaces:
IEntryPointHandler, IHandler

public abstract class AbstractEntryPointHandler
extends AbstractHandler
implements IEntryPointHandler

This class is to be extended by all EntryPoint handler contributions.


Constructor Summary
AbstractEntryPointHandler()
           
 
Method Summary
 boolean canCreateEntryPointBinding()
          Queries if the entry point handler provides support for creating an entry point binding using the method createEntryPointBindingFor().
 boolean canCreateEntryPointFor(java.lang.Object service)
          Queries if an entry point of the kind supported by this handler can be created for the specified model object.
 boolean canCreateManyEntryPointBindings()
          Queries if the entry point handler provides support for creating more than one binding instance for an entry point.
 boolean isInterfaceKindSupported(IInterfaceHandler interfaceHandler)
          Queries if an entry point of the kind supported by this handler supports interfaces of the kind specified by the given interface handler in its interface set.
 org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation removeKind(org.eclipse.stp.core.sca.EntryPoint theEntryPoint)
          Removes a given binding kind from the entry point.
 
Methods inherited from class org.eclipse.stp.core.saf.handler.AbstractHandler
getDescription, getDescriptiveKindName, getKind, getLargeIcon, getName, getSmallIcon, initialize
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.stp.core.saf.handler.IEntryPointHandler
createEntryPointBindingFor, createEntryPointFor
 
Methods inherited from interface org.eclipse.stp.core.saf.handler.IHandler
getDescription, getDescriptiveKindName, getKind, getLargeIcon, getName, getSmallIcon
 

Constructor Detail

AbstractEntryPointHandler

public AbstractEntryPointHandler()
Method Detail

canCreateEntryPointFor

public boolean canCreateEntryPointFor(java.lang.Object service)
Description copied from interface: IEntryPointHandler
Queries if an entry point of the kind supported by this handler can be created for the specified model object. If this method returns true, the handler's IEntryPointHandler.createEntryPointFor(Object, IContainer, IUIContext) method may be called to create an entry point for the component or external service.

This method should be quick to execute, because it may be called to populate a context menu or a user dialog.

Specified by:
canCreateEntryPointFor in interface IEntryPointHandler
Parameters:
service - an object representing the service to be exposed
Returns:
true if the handler can create an EntryPoint object from the specified model object; false otherwise

canCreateEntryPointBinding

public boolean canCreateEntryPointBinding()
Description copied from interface: IEntryPointHandler
Queries if the entry point handler provides support for creating an entry point binding using the method createEntryPointBindingFor().

Specified by:
canCreateEntryPointBinding in interface IEntryPointHandler
Returns:
true if support is provided for creating a binding; false otherwise

canCreateManyEntryPointBindings

public boolean canCreateManyEntryPointBindings()
Description copied from interface: IEntryPointHandler
Queries if the entry point handler provides support for creating more than one binding instance for an entry point.

Specified by:
canCreateManyEntryPointBindings in interface IEntryPointHandler
Returns:
true if support is provided for creating more than one binding of the supported kind; false otherwise

isInterfaceKindSupported

public boolean isInterfaceKindSupported(IInterfaceHandler interfaceHandler)
                                 throws SAFException
Description copied from interface: IEntryPointHandler
Queries if an entry point of the kind supported by this handler supports interfaces of the kind specified by the given interface handler in its interface set.

Specified by:
isInterfaceKindSupported in interface IEntryPointHandler
Parameters:
interfaceHandler - the interface handler that will be used to manipulate the interface. The implementation of this method can obtain the interface kind by invoking IHandler.getKind() when performing the evaluation.
Returns:
true if the entry point supports interfaces of the specified interface kind; false otherwise
Throws:
SAFException - An unexpected exception occurred in the handler.

removeKind

public final org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation removeKind(org.eclipse.stp.core.sca.EntryPoint theEntryPoint)
                                                                                 throws SAFException,
                                                                                        InvalidOperationException
Description copied from interface: IEntryPointHandler
Removes a given binding kind from the entry point. Generally, existing interfaces will be preserved. No clean-up is done on existing binding-related files. If the entry point does not contain the given binding type, this method performs no work.

Specified by:
removeKind in interface IEntryPointHandler
Parameters:
theEntryPoint - the entry point being modified
Returns:
an IDataModelOperation instance that, once executed by the caller, resets the entry point kind
Throws:
InvalidOperationException - The entry point kind cannot be removed.
SAFException - No handler for the specified kind is found, or the handler throws an exception.