|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ocl.examples.xtext.base.ui.commands.ValidateHandler
public final class ValidateHandler
This class adapts instances of IAction
to IHandler
.
Constructor Summary | |
---|---|
ValidateHandler()
Creates a new instance of this class given an instance of IAction . |
Method Summary | |
---|---|
void |
addHandlerListener(org.eclipse.core.commands.IHandlerListener handlerListener)
|
protected void |
addListenerObject(java.lang.Object listener)
Adds a listener to this manager that will be notified when this manager's state changes. |
protected void |
clearListeners()
Clears all of the listeners from the listener list. |
void |
dispose()
Removes the property change listener from the action. |
java.lang.Object |
execute(org.eclipse.core.commands.ExecutionEvent event)
|
protected void |
fireHandlerChanged(org.eclipse.core.commands.HandlerEvent handlerEvent)
Fires an event to all registered listeners describing changes to this instance. |
org.eclipse.jface.action.IAction |
getAction()
Returns the action associated with this handler |
protected java.lang.Object[] |
getListeners()
Returns the listeners attached to this event manager. |
protected boolean |
hasListeners()
Returns true iff there is one or more IHandlerListeners attached to this AbstractHandler. |
boolean |
isEnabled()
|
boolean |
isHandled()
|
protected boolean |
isListenerAttached()
Whether one or more listeners are attached to the manager. |
void |
removeHandlerListener(org.eclipse.core.commands.IHandlerListener handlerListener)
|
protected void |
removeListenerObject(java.lang.Object listener)
Removes a listener from this manager. |
protected void |
setBaseEnabled(boolean state)
Allow the default isEnabled() to answer our enabled state. |
void |
setEnabled(java.lang.Object evaluationContext)
Called by the framework to allow the handler to update its enabled state by extracting the same information available at execution time. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ValidateHandler()
IAction
.
action
- the action. Must not be null
.Method Detail |
---|
public final void addHandlerListener(org.eclipse.core.commands.IHandlerListener handlerListener)
addHandlerListener
in interface org.eclipse.core.commands.IHandler
protected final void addListenerObject(java.lang.Object listener)
listener
- The listener to be added; must not be null
.protected final void clearListeners()
public final void dispose()
dispose
in interface org.eclipse.core.commands.IHandler
IHandler.dispose()
public java.lang.Object execute(org.eclipse.core.commands.ExecutionEvent event) throws org.eclipse.core.commands.ExecutionException
execute
in interface org.eclipse.core.commands.IHandler
org.eclipse.core.commands.ExecutionException
protected void fireHandlerChanged(org.eclipse.core.commands.HandlerEvent handlerEvent)
Subclasses may extend the definition of this method (i.e., if a different
type of listener can be attached to a subclass). This is used primarily
for support of AbstractHandler
in
org.eclipse.ui.workbench
, and clients should be wary of
overriding this behaviour. If this method is overridden, then the first
line of the method should be "super.fireHandlerChanged(handlerEvent);
".
handlerEvent
- the event describing changes to this instance. Must not be
null
.public final org.eclipse.jface.action.IAction getAction()
protected final java.lang.Object[] getListeners()
null
public final boolean isEnabled()
isEnabled
in interface org.eclipse.core.commands.IHandler
public final boolean isHandled()
isHandled
in interface org.eclipse.core.commands.IHandler
protected boolean hasListeners()
Returns true iff there is one or more IHandlerListeners attached to this AbstractHandler.
Subclasses may extend the definition of this method (i.e., if a different
type of listener can be attached to a subclass). This is used primarily
for support of AbstractHandler
in
org.eclipse.ui.workbench
, and clients should be wary of
overriding this behaviour. If this method is overridden, then the return
value should include "super.hasListeners() ||
".
protected final boolean isListenerAttached()
true
if listeners are attached to the manager;
false
otherwise.public final void removeHandlerListener(org.eclipse.core.commands.IHandlerListener handlerListener)
removeHandlerListener
in interface org.eclipse.core.commands.IHandler
protected final void removeListenerObject(java.lang.Object listener)
listener
- The listener to be removed; must not be null
.protected void setBaseEnabled(boolean state)
isEnabled()
to answer our enabled state. It
will fire a HandlerEvent if necessary. If clients use this method they
should also consider overriding setEnabled(Object)
so they can
be notified about framework execution contexts.
state
- the enabled statepublic void setEnabled(java.lang.Object evaluationContext)
setEnabled
in interface org.eclipse.core.commands.IHandler2
evaluationContext
- the application context. May be null
setBaseEnabled(boolean)
public final java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |