DESCRIPTION

Bug 447737 - Move command is disabled for projects in Project Explorer

Create and use a DelegatingSelectionListenerAction to choose between
the MoveProjectAction and MoveResourceAction.

Change-Id: Ic32f8128531e6223339b49c7a0697308068f2c02


COMMENTS

author: Teagan Marsh
date: 2015-07-09 02:55:52.000000000

Uploaded patch set 3.

-------------------------------------
author: Teagan Marsh
date: 2015-07-09 02:58:41.000000000

Patch Set 3: -Code-Review

Here's the approach I thought we should take: don't require any change of Move{Resource,Project}Action and instead bring in the selecting logic into the RefactorActionGroup.  I had to introduce this perhaps-poorly-named DelegatingSelectionListnerAction to encode the selecting logic as the RefactorActionGroup binds the MoveResourceAction to as a global handler.

I haven't fully tested this yet.

-------------------------------------
author: Melody Cooke
date: 2015-07-10 16:28:25.000000000

Patch Set 3:

While I understand the desire to make a more generic solution, I worry if in this particular case it will be that more problems are created rather than solved: DelegatingSelectionListenerAction might be too brittle, if not downright incorrect.
For example, is it allowed that the action id can change? (since getId() is delegated). Even if it is, is that good style?

Also, is the property-changed delegation code necessary? Ultimately, ot seems to me that we would only want to delegate the *execution* of the action (and the enablement). Other properties and aspects, like ID, icon, description, etc., could be fixed. To the user, the action is just one, so it doesn't seem necessary that the UI aspect would need to be delegated.

-------------------------------------
author: Teagan Marsh
date: 2015-07-13 16:35:03.000000000

Patch Set 3:

I share your concern about this completely generic approach, Bruno: I don't like hacks, but a full IAction demux is too tricky.  I'll simplify it to handle the minimum required for situations like this.

-------------------------------------
author: Melody Cooke
date: 2016-09-01 17:54:17.000000000

Patch Set 3:

Bump, any update on this? 

To be clear, personally I would have gone with a simpler solution than patch set 3, but it still looks okay to me. The delegation mechanism looks a bit tricky to me, (maybe there's a risk of that introducing other problems in the future?), but you know the Platform UI code better than me, and it does solve the bug at hand, so I'm quite happy for patch set 3 to be accepted.

-------------------------------------
