org.eclipse.stp.core.saf.handler
Class AbstractInterfaceHandler
java.lang.Object
org.eclipse.stp.core.saf.handler.AbstractHandler
org.eclipse.stp.core.saf.handler.AbstractInterfaceHandler
- All Implemented Interfaces:
- IHandler, IInterfaceHandler
- public abstract class AbstractInterfaceHandler
- extends AbstractHandler
- implements IInterfaceHandler
This class is to be extended by all interface handler contributions.
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractInterfaceHandler
public AbstractInterfaceHandler()
canCreateInterfaceFor
public boolean canCreateInterfaceFor(java.lang.Object interfaceObj)
- Description copied from interface:
IInterfaceHandler
- Queries if an interface of the kind supported by this handler can be
created for the specified interface object. If this method returns
true
, the handler's
createInterfaceFor()
method may be
called to create an interface for the file.
This method should be quick to execute as it may be called to populate a
context menu or a user dialog. When interfaceObj is a container, a
quick check should be performed to verify that an SCA interface can be
created from one of the objects contained by interfaceObj. For example,
if interfaceObj is a file, perhaps the file extension can be checked
rather than opening the file to inspect its contents. If this method
returns true
for an invalid container, the
IInterfaceHandler.createInterfaceFor(Object, IUIContext)
can throw an
InvalidOperationException
to let the caller know that an
interface could not be created from it.
- Specified by:
canCreateInterfaceFor
in interface IInterfaceHandler
- Parameters:
interfaceObj
- an object representing the interface
- Returns:
true
if the handler can create an
interface from the specified object;
false
otherwise
canCreateInterfaceObject
public boolean canCreateInterfaceObject()
- Description copied from interface:
IInterfaceHandler
- Queries if this handler can create an interface object for the supported
type. If this method returns
true
, the handler's
#createInterfaceObject(IProject, IUIContext)
method may be called
to create an interface object.
- Specified by:
canCreateInterfaceObject
in interface IInterfaceHandler
- Returns:
true
if the handler can create an
interface object; false
otherwise
getInterfaceLabelProvider
public final IInterfaceHandler.IInterfaceLabelProvider getInterfaceLabelProvider()
- Description copied from interface:
IInterfaceHandler
- This method returns the handler's instance of
IInterfaceHandler.IInterfaceLabelProvider
. The provider is reponsible for
generating label information for objects returned by
IInterfaceHandler.getInterfaceObjects(IResource)
.
- Specified by:
getInterfaceLabelProvider
in interface IInterfaceHandler
- Returns:
- the
IInterfaceHandler.IInterfaceLabelProvider
instance