The org.eclipse.ui.contexts
extension point is used to declare contexts and associated elements.
<!ELEMENT extension (context*)>
<!ATTLIST extension
id CDATA #IMPLIED
name CDATA #IMPLIED
point CDATA #REQUIRED>
<!ELEMENT context EMPTY>
<!ATTLIST context
description CDATA #IMPLIED
id CDATA #REQUIRED
name CDATA #REQUIRED
parentId IDREF #IMPLIED>
This element is used to define contexts. If more than one of these elements exist with the same id
attribute, only the last declared element (in order of reading the registry) is considered valid.
The plugin.xml
file in the org.eclipse.ui
plugin makes use of the org.eclipse.ui.contexts
extension point.
In general, it is preferrably to declare all contexts statically (in plugin.xml
). This is so that users can use them in key bindings. However, it is possible to declare contexts at run-time. To do this, retrieve the org.eclipse.ui.commands.IContextService
from a workbench component, call getContext(contextId)
and then call Context#define(...)
.
Contexts defined programmatically must be cleaned up by the plugin if it is unloaded.
Copyright (c) 2000, 2007 IBM Corporation and others.
This program and the accompanying materials are made
available under the terms of the Eclipse Public License 2.0 which accompanies
this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html/
SPDX-License-Identifier: EPL-2.0