IWorkbenchWindow workbenchWindow = ServerUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow();
IWorkbenchPage page = workbenchWindow.getActivePage();
try {
// open server editor
ServerEditor editor = (ServerEditor) page.openEditor(new ServerEditorInput(server.getId()),
IServerEditorInput.EDITOR_ID);
// set applications page to active
Method method = MultiPageEditorPart.class.getDeclaredMethod("setActivePage", int.class); //$NON-NLS-1$
method.setAccessible(true);
method.invoke(editor, 1);
CloudFoundryApplicationsEditorPage editorPage = (CloudFoundryApplicationsEditorPage) editor.getSelectedPage();
editorPage.selectAndReveal(modules[0]);
}
catch (CoreException e) {
StatusManager.getManager().handle(e.getStatus(), StatusManager.LOG);
}