Contributing to the Team Artifacts view
Summary
This article explains how to contribute to the Team Artifacts view.
Introduction
The Team Artifacts view is an Eclipse view within Jazz that presents a hierarchy of heterogeneous elements that are provided from contributed domains. Domains can also be presented within the Team Artifacts part of a Team Area editor.
What is a Domain?
A domain is an extension mechanism for different components to contribute context specific elements of a given type to a domain navigator such as the Team Artifacts view or the Team Area editor.
How To Create a Domain
You will need to add the following required plug-in as a prerequisite:
com.ibm.team.process.rcp.ui
Domain implementations must extend the abstract class
com.ibm.team.process.rcp.ui.teamnavigator.Domain
After you have coded your domain, you can contribute it by extending the
com.ibm.team.process.rcp.ui.teamArtifactsNavigatorDomain
schema
com.ibm.team.process.rcp.ui
The
id
- com.ibm.unlicensed.* – Domain will work without being included in the license
- * – Domain will work without being included in the license
- com.ibm.* – Domain needs to be licensed
For example, the declaration of the Plans domain from the
com.ibm.team.apt.ide.ui
... <extension point="com.ibm.team.process.rcp.ui.teamArtifactsNavigatorDomain"> <teamArtifactsNovigatorDomain class="com.ibm.team.apt.internal.ide.ui.navigator.PlanningDomain" icon="$nl$/icons/obj16/planning_domain.gif" id="com.ibm.team.process.deliver.requireWorkItem" name="%PlanningDomainName"/> </extension> ...
Within the Team Artifacts view, all calls that concern domain elements are delegated to the corresponding domain. Therefore, domain represents a factory for the standard JFace notions of content provider, label provider, sorter, and comparer. In addition, there are opportunities to convert model elements for presentation within the UI, contribute to the view context menu, and participate in drag and drop.
Implementing Different Types of Domains
There are two kinds of domains within Jazz: standard domains, which pertain to a specific process area, and top-level domains, which don’t have a process area scope. The type of the domain is determined by the implementation details of specific methods.
Within the Team Artifacts view, standard domains are shown under each project area. They need to return true for
Domain#supportsCategory(Category category)
com.ibm.team.process.rcp.ui.teamnavigator.ProjectAreaCategory
Builds
Streams
Plans
For domains to be included within the
com.ibm.team.process.internal.ide.ui.editors.TeamArtifactsPart
Domain#supportsCategory(Category category)
com.ibm.team.process.rcp.ui.teamnavigator.IProcessAreaCategory
IProcessAreaCategory#isTeamAreaCategory()
Builds
Work Item Categories
Top-level domains appear outside the context of any Project Area in the Team Artifacts view. Such domains typically present information that is global to the user’s Eclipse workspace, such as the
Repository Connections
My Repository Workspaces
Domain#supportsCategory(Category)
Content Provider
The domain implementation contributes its elements by providing an
org.eclipse.jface.viewers.ITreePathContentProvider
Label Provider
A label provider is needed to render the domain elements. The label provider must implement
org.eclipse.jface.viewers.ITreePathLabelProvider
org.eclipse.jface.viewers.IColorProvider
org.eclipse.jface.viewers.IFontProvider
Sorter
A domain can provide an
org.eclipse.jface.viewers.ViewerSorter
org.eclipse.jface.viewers.TreePathViewerSorter
Comparer
A domain can provide an
org.eclipse.jface.viewers.IElementComparer
Model Element Conversion
A domain can choose not to expose its model objects but use representation objects within the UI. The
convertToModel(Object uiElement)
convertToSelection(Object modelElement)
convertToModel(Object uiElement)
Selections in the domain navigator are always of type
com.ibm.team.process.internal.rcp.ui.DomainSelection
getWorkbenchPart().getSite().getSelectionProvider().getSelection();
DomainSelection.getOriginal()
Contribute to Context Menu
If a selection consists only of elements of one domain (
Domain.contains(Object)
#contributeContextMenuActions(IMenuManager, IStructuredSelection)
com.ibm.team.jface.viewerutilities.ContextMenuHelper#NEW_MENU_ID
com.ibm.team.jface.viewerutilities.ContextMenuHelper#NEW_MENU_GROUP
Participate in Drag and Drop
To enable drag and drop for its elements a domain has to overwrite all these methods:
-
#validateDrop(Object, ISelection, int)
-
#getSupportedOperationsForSelection(ISelection)
-
#performDrop(Object, ISelection, int)
© Copyright 2008 IBM
Discussion