public interface IContextProvider
IContextProvider.class
is
used as the adapter key. Adaptable objects must implement
org.eclipse.core.runtime.IAdaptable
interface.
Dynamic context providers should be used for providing focused dynamic help that changes depending on the various platform states. State change criteria is defined by bitwise-OR of the individual state change triggers. Each time a registered trigger occurs, the class that implements this interface will be called again to provide the help context for the given target.
Context provider should be used for all visual artifacts that provide context help that handle context help trigger by handling the SWT help event instead of tagging the artifact with a static context Id.
In addition to providing static help context, this interface can also be used to control the query string that is passed to the help search system on context switches. If not provided, the query string is computed based on the current context. Providing the string explicitly gives the context owners better control over the search outcome.
IContext
,
IAdaptable
Modifier and Type | Field and Description |
---|---|
static int |
NONE
State change trigger indicating a static context provider.
|
static int |
SELECTION
State change trigger indicating that the provider should be asked for
context help on each selection change.
|
Modifier and Type | Method and Description |
---|---|
IContext |
getContext(Object target)
Returns a help context for the given target.
|
int |
getContextChangeMask()
Returns the mask created by combining supported change triggers using the
bitwise OR operation.
|
String |
getSearchExpression(Object target)
Returns a search expression that should be used to find more information
about the current target.
|
static final int NONE
static final int SELECTION
int getContextChangeMask()
NONE
for a static provider.IContext getContext(Object target)
target
- the focus of the context helpnull
if
none is defined.String getSearchExpression(Object target)
target
- the focus of the context helpnull
if background search is not desired.
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.