Search code examples
viewcommandhandlerjfacetreeviewer

Obtaining starting View from Handler of the command


I have a certain View.

In this view there is a TreeViewer.

When I right-click one element of the tree, I open the contextual menu that trigger the command "rename".

In the HANDLER of this command, how can I obtain the ID of the view of the selected element?

Is it possible to get it?

Thanks very much to everyone will answer!


Solution

  • See HandlerUtil. In this example, since you right-click on an element in a view, it should become active and you can use

    HandlerUtil.getActivePartId(e);