Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Double-click action for custom domains

I have implemented a custom domain using the great article Contributing to the Team Artifacts view. Now I would like to add a double click action on the elements contributed to this new domain. Ideally, this action would also be bolded in the context menu but that is not required.

The code below is how I might try to implement this, but it is not using public APIs. How can I go about registering a DoubleClickListener to the custom domain?


@Override
public void configure(IWorkbenchPart part, Category category,
IConnectedProjectAreaRegistry registry) {

super.configure(part, category, registry);
//This is how I would add a double-click listener... but this class is restricted access
if(part instanceof TeamArtifactsNavigator) {
((TeamArtifactsNavigator) part).getTreeViewer().addDoubleClickListener(...);
}
}

0 votes



One answer

Permanent link
The following code can be used in your Domain, if you define an open action for your type of item. No need to add a double-click listener.


@Override
public boolean open(IWorkbenchPartSite site, IStructuredSelection selection) {
if(selection != null && selection.getFirstElement() instanceof MyItemToOpen) {
openAction.selectionChanged(selection);
openAction.run();

return true;
}

return super.open(site, selection);
}

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,954

Question asked: Nov 19 '09, 10:30 a.m.

Question was seen: 4,416 times

Last updated: Nov 19 '09, 10:30 a.m.

Confirmation Cancel Confirm