Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 242246 - [Commands] HandlerUtil.getActivePart() returns null when a dialog is opened.
Summary: [Commands] HandlerUtil.getActivePart() returns null when a dialog is opened.
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 297383 321594 360928 (view as bug list)
Depends on:
Blocks: 241384
  Show dependency tree
 
Reported: 2008-07-28 11:02 EDT by Tod Creasey CLA
Modified: 2020-04-06 19:39 EDT (History)
13 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tod Creasey CLA 2008-07-28 11:02:40 EDT
3.4.0

See Bug 241384 for details. When you open a dialog in an AbstractHandler and then call HandlerUtil.getActivePart() you will get back null. If you do not have the dialog you will get it before.

This is marked as blocking Bug 241384 but as there is a workaround this is normal priority.
Comment 1 Paul Webster CLA 2008-07-28 11:06:39 EDT
I suspect that this is because the IEvaluationContext provided to anyone that asks will track the global application state until the next selection change.

The MessageDialog spins its own dispatch loop, and so information is cleared from the IEvaluationContext available through the ExecutionEvent.

It might be that the IEvaluationContext returned from getCurrentState() must be a snapshot.

PW
Comment 2 Remy Suen CLA 2008-07-28 11:07:55 EDT
Tod, so you are seeing this problem on WinXP too?
Comment 3 Tod Creasey CLA 2008-07-28 11:14:23 EDT
No it is Linux specific.
Comment 4 Remy Suen CLA 2008-12-11 07:09:54 EST
Egads, I just got hit by this on our RCP product (it sure hurts when you only start to notice this when doing tests on Linux when your daily work is on XP). Any 3.5 plans for this, Paul?
Comment 5 Chris Aniszczyk CLA 2009-04-29 12:02:32 EDT
It seems PDE is also hit by this via bug 274289.
Comment 6 Alanna Zito CLA 2009-09-03 11:15:42 EDT
I just ran into this as well - I have a handler that sometimes needs to open a dialog.  In cases where the dialog is opened, a later call to get the active part returns null; when the dialog doesn't need to open, then everything works fine.  I'm also only seeing it on Linux - no problems on Windows
Comment 7 Remy Suen CLA 2009-12-10 21:36:46 EST
*** Bug 297383 has been marked as a duplicate of this bug. ***
Comment 8 Paul Webster CLA 2010-08-11 12:58:09 EDT
*** Bug 321594 has been marked as a duplicate of this bug. ***
Comment 9 Paul Webster CLA 2011-10-26 13:24:29 EDT
*** Bug 360928 has been marked as a duplicate of this bug. ***
Comment 10 Udo Walker CLA 2013-06-28 02:52:20 EDT
Is this fixed in a newer version already?
Comment 11 Andre Bossert CLA 2016-11-02 16:00:04 EDT
I have the same issue here running Debian Linux (Stretch) and Eclipse Neon.1 in EasyShell plugin. It works at Windows. As this is not fixed, is there a workaround for this?
Comment 12 Andre Bossert CLA 2017-11-16 14:44:32 EST
I've faced the same problem with Version: Oxygen.1a Release (4.7.1a) and Debian Buster (10). Is there a workaround? Thanks.
Comment 13 Eclipse Genie CLA 2020-04-06 19:39:13 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.