How to get the current work item programmatically?
3 answers
far as I know, there is no general purpose listener chain you can use.
the code to save a workitem is in the com.ibm.team.workitem.client jar,
com.ibm.team.workitem.client.internal.WorkitemClient.java
to view the source for any plugin jar, use the Plugins view of the Plugins Perspective,,
find the plugin of interest, and right mouse button, select Import as Source
then u have the full compilable plugin jar file source and build process.
the code to save a workitem is in the com.ibm.team.workitem.client jar,
com.ibm.team.workitem.client.internal.WorkitemClient.java
to view the source for any plugin jar, use the Plugins view of the Plugins Perspective,,
find the plugin of interest, and right mouse button, select Import as Source
then u have the full compilable plugin jar file source and build process.
Comments
Thanks, I tried this. However, the projects that are loaded are always empty (no code, just one jar), and com.ibm.team.workitem.client.internal is not even available.
you have to download the source zip and configure the plugin path to get the source to deploy for plugins..
thats in the Eclipse ui menu, Windows, Preferences, Plugins, target Platform
See the Extensions workshop for how to set up for development.
Hi S M,
It is indeed possible to get a listener for the work item activation. Please look at the method:
com.ibm.team.workitem.rcp.core.ClientModel.getWorkItemActivationManager()
That static method will return you an instance of an IWorkItemActivationManager which manages the active (current) work item status. If you just want to get the currently active workitem you can use the method com.ibm.team.workitem.rcp.core.activation.IWorkItemActivationManager.getActiveWorkItem(). Otherwise, you can register a listener by calling com.ibm.team.workitem.rcp.core.activation.IWorkItemActivationManager.addActivationParticipant(WorkItemActivationParticipant) and adding your own WorkItemActivationParticipant.
Please consult the Javadoc for further information