public interface TriggerInvokable extends Invokable
Invokable.invoke(oracle.ide.Context)
can safely be called in a particular context.
Consider the case where an Invokable is registered as
a gallery item. If the extension that registered the item is not
initialized, the enabled state of the Invokable is
determined by evaluating the declarative rule associated with
the item. If the rule is true, the item is enabled, and if the user
selects it, Invokable.invoke(oracle.ide.Context)
is called on the object. If the object
is a TriggerInvokable, canInvoke(oracle.ide.Context)
is called just
before Invokable.invoke(oracle.ide.Context)
to determine whether the item is really
invokable, and if not invokable, getInvalidStateMessage(oracle.ide.Context)
is called to give feedback to the user about why the gallery
item cannot be created.
Once the extension that owns the gallery item is initialized, the
enabled state of the item is determined by first evaluating the rule
and then calling canInvoke(oracle.ide.Context)
.
Modifier and Type | Method and Description |
---|---|
boolean |
canInvoke(Context context)
Called to determine whether this Invokable should
be enabled or disabled.
|
java.lang.Object |
getInvalidStateMessage(Context context)
Returns a message that indicates why the Invokable
cannot be invoked in the active context.
|
boolean canInvoke(Context context)
context
- the Context
in which Invokable.invoke(oracle.ide.Context)
may be called on this objectjava.lang.Object getInvalidStateMessage(Context context)
MessageDialog
.