It's all about the answers!

Ask a question

Adding context menu to Stream and Snapshot


Moti Wertheimer (18913628) | asked May 21 '14, 10:31 a.m.
JAZZ DEVELOPER
 Hi,

I would like to add a context menu to stream and snapshot.
I know how to create such for workitem using:
 <extension point="org.eclipse.ui.popupMenus">
    <objectContribution objectClass="com.ibm.team.workitem.common.model.IWorkItemHandle"

What is the objectClass of Stream and Snapshot?

Thanks,
Moti

Accepted answer


permanent link
Arne Bister (2.6k12832) | answered May 21 '14, 11:05 a.m.
JAZZ DEVELOPER
Moti,

please find a detailed description in Ralphs blog or simply look at my code in our joint project. I just added it to the component today ;-)

If this is helpful, please mark the answer as accepted.

Best,
Arne
Moti Wertheimer selected this answer as the correct answer

Comments
Arne Bister commented May 21 '14, 11:11 a.m.
JAZZ DEVELOPER

cp. email to you

2 other answers



permanent link
Ralph Schoon (63.2k33646) | answered May 21 '14, 10:47 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Moti,

please have a look at https://rsjazz.wordpress.com/2014/02/21/adding-context-menus-for-jazz-objects-to-the-rtc-eclipse-client/ which explains some of the objects and how to find out others, you don't know yet.

Comments
Ralph Schoon commented May 21 '14, 10:48 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

For snapshots it is com.ibm.team.filesystem.ui.wrapper.SnapshotWrapper there are several other wrappers


permanent link
Moti Wertheimer (18913628) | answered May 22 '14, 5:18 a.m.
JAZZ DEVELOPER
Thanks all for the help.
I found that a Snapshot is com.ibm.team.filesystem.ui.wrapper.TeamPlaceWrapper
In order to find it out I used this code. when right clicking an element I see the class name in the context menu...

in plugin.xml
 <objectContribution objectClass="com.ibm.team.filesystem.ui.wrapper.AbstractWrapper"
    id="com.ibm.team.workitem.mystuff.popup.createImpoerantStream">
     <action class="com.ibm.team.errata.ui.MyPopupAction"
...

in MyPopupAction.java: 
public class MyPopupActionimplements IObjectActionDelegate {
...
@Override
public void selectionChanged(IAction action, ISelection selection) {
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
com.ibm.team.filesystem.ui.wrapper.AbstractWrapper wrapper = (AbstractWrapper) structuredSelection.getFirstElement();
action.setText(wrapper.getClass().getName());
}

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.