Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321594 - Variables within application context of ExecutionEvent are erased after opening dialog
Summary: Variables within application context of ExecutionEvent are erased after openi...
Status: CLOSED DUPLICATE of bug 242246
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-03 09:48 EDT by Gunnar Schulze CLA
Modified: 2010-08-11 12:58 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gunnar Schulze CLA 2010-08-03 09:48:53 EDT
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.
Comment 1 Prakash Rangaraj CLA 2010-08-03 10:40:51 EDT
Sounds like Bug# 242246
Comment 2 Paul Webster CLA 2010-08-11 12:58:09 EDT

*** This bug has been marked as a duplicate of bug 242246 ***