|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface must be implemented by all interface handlers.
Nested Class Summary | |
static interface |
IInterfaceHandler.IInterfaceLabelProvider
The IInterfaceLabelProvider maps an interface object to an
optional image and optional text string used to display the element in
the viewer's control. |
Method Summary | |
boolean |
canCreateInterfaceFor(java.lang.Object interfaceObj)
Queries if an interface of the kind supported by this handler can be created for the specified interface object. |
boolean |
canCreateInterfaceObject()
Queries if this handler can create an interface object for the supported type. |
org.eclipse.stp.core.sca.Interface |
createInterfaceFor(java.lang.Object interfaceObj,
IUIContext callback)
Creates an SCA interface from the given interface object. |
java.lang.Object |
createInterfaceObject(org.eclipse.core.resources.IProject defaultLocation,
java.lang.String interfaceName,
IUIContext callback)
Creates a new interface object to be used by an SCA interface. |
IInterfaceHandler.IInterfaceLabelProvider |
getInterfaceLabelProvider()
This method returns the handler's instance of IInterfaceHandler.IInterfaceLabelProvider . |
java.lang.Object[] |
getInterfaceObjects(org.eclipse.core.resources.IResource searchScope)
Returns an array of Object representing all interfaces found
within the given search scope. |
void |
open(org.eclipse.stp.core.sca.Interface interfaceObj)
This method opens a registered editor for the given interface type. |
Methods inherited from interface org.eclipse.stp.core.saf.handler.IHandler |
getDescription, getDescriptiveKindName, getKind, getLargeIcon, getName, getSmallIcon |
Method Detail |
public boolean canCreateInterfaceFor(java.lang.Object interfaceObj)
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
createInterfaceFor(Object, IUIContext)
can throw an
InvalidOperationException
to let the caller know that an
interface could not be created from it.
interfaceObj
- an object representing the interface
true
if the handler can create an
interface from the specified object;
false
otherwisepublic boolean canCreateInterfaceObject()
true
, the handler's
#createInterfaceObject(IProject, IUIContext)
method may be called
to create an interface object.
true
if the handler can create an
interface object; false
otherwisepublic org.eclipse.stp.core.sca.Interface createInterfaceFor(java.lang.Object interfaceObj, IUIContext callback) throws SAFException, InvalidOperationException
The interface object can be an object supported by the
canCreateInterfaceFor(Object)
or returned by the
getInterfaceObjects(IResource)
method.
interfaceObj
- the object representing the interfacecallback
- callback object that the handler can use to obtain additional
information needed to create the interface object. For
example, what object can be used when creating the SCA interface if
interfaceObj is a container, such as a file.
SAFException
- An unexpected exception occurred.
InvalidOperationException
- An interface cannot be created from the given interface
object.public java.lang.Object createInterfaceObject(org.eclipse.core.resources.IProject defaultLocation, java.lang.String interfaceName, IUIContext callback) throws SAFException, InvalidOperationException, java.lang.InterruptedException
defaultLocation
- the default project to use when creating the interfacecallback
- callback object that the handler can use to obtain additional
information needed to create the interface object
SAFException
- An unexpected exception occurred.
InvalidOperationException
- The interface object cannot be created.
java.lang.InterruptedException
- The caller did not provide a callback object needed by the
handler, or the callback request was canceled or aborted.public java.lang.Object[] getInterfaceObjects(org.eclipse.core.resources.IResource searchScope) throws SAFException
Object
representing all interfaces found
within the given search scope. The handler determines how it will use the
search scope. Depending on the interface type being sought, the handler
may look at a single project or folder or look in the workspace or in a
project's classpath.
The objects returned by this method must be supported as the argument to
the canCreateInterfaceFor(Object)
method.
searchScope
- the IResource
used to determine the search scope used
by this handler
Object
SAFException
- The search cannot be completed.public void open(org.eclipse.stp.core.sca.Interface interfaceObj) throws SAFException, InvalidOperationException
interfaceObj
- the interface to open
SAFException
- An unexpected exception occurred.
InvalidOperationException
- The interface cannot be opened.public IInterfaceHandler.IInterfaceLabelProvider getInterfaceLabelProvider()
IInterfaceHandler.IInterfaceLabelProvider
. The provider is reponsible for
generating label information for objects returned by
getInterfaceObjects(IResource)
.
IInterfaceHandler.IInterfaceLabelProvider
instance
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |