| Summary: | Variables within application context of ExecutionEvent are erased after opening dialog | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Gunnar Schulze <gunnar.schulze> |
| Component: | UI | Assignee: | Platform-UI-Inbox <Platform-UI-Inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | prakash |
| Version: | 4.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
Sounds like Bug# 242246 *** This bug has been marked as a duplicate of bug 242246 *** |
Build Identifier: 20100617-1415 In the execute() method of a handler, you can normally retrieve the active editor via HandlerUtil.getActiveEditor(event). However, after displaying e.g. an error dialog, getActiveEditor() returns null. It seems that the activeActionSets variable within the application context gets changed. However, under MacOS X and in versions prior to 3.6 this works. Reproducible: Always Steps to Reproduce: Put the following code into the execute() method of a handler: public Object execute(ExecutionEvent event) throws ExecutionException { System.out.println("Active editor: " + HandlerUtil.getActiveEditor(event)); MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "foo", "bar"); System.out.println("Active editor: " + HandlerUtil.getActiveEditor(event)); return null; } The active editor can be retrieved before, but not after the execution event.