Skip to content

Instantly share code, notes, and snippets.

@abelhegedus
Created June 1, 2012 08:25
Show Gist options
  • Save abelhegedus/2850302 to your computer and use it in GitHub Desktop.
Save abelhegedus/2850302 to your computer and use it in GitHub Desktop.
Infinite exception with re-executed command
IEditorPart editorPart = pm.getParent().getParent().getEditorPart();
if(editorPart.getSite().getPage().getActiveEditor() != editorPart) {
//bring editor part to top
editorPart.getSite().getPage().bringToTop(editorPart); // this should make it active as well, otherwise infinite execption
IHandlerService handlerService = (IHandlerService) editorPart.getSite().getService(IHandlerService.class);
try {
handlerService.executeCommand(CommandConstants.SHOW_LOCATION_COMMAND_ID, null);
return;
} catch (Exception e) {
IncQueryEngine.getDefaultLogger().logError("Exception when activating show location!", e);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment