I am working on a test project and followed Vogella’s RCP tutorial. After that I made some changes on it, eg. created a JFace TreeView. Now I want that if the user double clicks on a TreeView element it opens up another Part. I have the command for it but, I do not know how to call it. If you look at the tutorial you may notice it only uses Parts, not Views and, I do not have an Application.java class that starts the workbench. Therefore the following methods do not work for me:
IHandlerService handlerService = (IHandlerService) viewer.getSite().getService(IHandlerService.class);IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IHandlerService handlerService = (IHandlerService)window.getService(IHandlerService.class);
handlerService.executeCommand(cmdID, null);
Both of them gives me NullPointerException.
How about this old standby: