Eclipse Platform
Release 3.1

org.eclipse.ui.handlers
Interface IHandlerActivation


public interface IHandlerActivation

A token representing the activation of a handler. This token can later be used to cancel that activation. Without this token, then handler will only become inactive if the component in which the handler was activated is destroyed.

This interface is not intended to be implemented or extended by clients.

Since:
3.1
See Also:
ISources, ISourceProvider

Method Summary
 void clearActive()
          Clears the cached computation of the isActive method, if any.
 String getCommandId()
          Returns the identifier of the command whose handler is being activated.
 IHandler getHandler()
          Returns the handler that should be activated.
 IHandlerService getHandlerService()
          Returns the handler service from which this activation was requested.
 int getSourcePriority()
          Returns the priority that has been given to this handler activation.
 boolean isActive(IEvaluationContext context)
          Returns whether this handler activation is currently active -- given the current state of the workbench.
 

Method Detail

clearActive

public void clearActive()
Clears the cached computation of the isActive method, if any. This method is only intended for internal use. It provides a mechanism by which ISourceProvider events can invalidate state on a IHandlerActivation instance.


getCommandId

public String getCommandId()
Returns the identifier of the command whose handler is being activated.

Returns:
The command identifier; never null.

getHandler

public IHandler getHandler()
Returns the handler that should be activated.

Returns:
The handler; may be null.

getHandlerService

public IHandlerService getHandlerService()
Returns the handler service from which this activation was requested. This is used to ensure that an activation can only be retracted from the same service which issued it.

Returns:
The handler service; never null.

getSourcePriority

public int getSourcePriority()
Returns the priority that has been given to this handler activation.

Returns:
The priority.
See Also:
ISources

isActive

public boolean isActive(IEvaluationContext context)
Returns whether this handler activation is currently active -- given the current state of the workbench. This method should cache its computation. The cache will be cleared by a call to clearActive.

Parameters:
context - The context in which this state should be evaluated; must not be null.
Returns:
true if the activation is currently active; false otherwise.

Eclipse Platform
Release 3.1

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.