Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Substitute for action sets
Substitute for action sets [message #918646] Fri, 21 September 2012 07:48 Go to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
We have several RCP clients based on Eclipse 3 architecture sharing a
big number of common components. On the other hand the pressure
increases to switch to an e4 architecture, because the future of e3 is
uncertain. Needless to say that during that time you have to live with
the so-called mixed mode, so I'm trying to convert as much code that is
deprecated in e4 already now but needs to run on an e3 RCP application.

The only relevant deprecation I noticed are some actions provided by the
several action-related extension points and it is mostly little work to
replace these by corresponding commands.

Now we have some usage of the org.eclipse.ui.perspectiveExtensions
extension point that refers to *action sets* and I wonder whether there
exists a recommended strategy to replace these, because (naturally) the
extension point org.eclipse.ui.actionSets is deprecated, too. To my
knowledge there does not exist any such replacement form for commands.

Any hints are appreciated!

Thanks & Greetings from Bremen,

Daniel Krügler
Re: Substitute for action sets [message #918852 is a reply to message #918646] Fri, 21 September 2012 12:06 Go to previous messageGo to next message
Joseph Carroll is currently offline Joseph CarrollFriend
Messages: 174
Registered: May 2012
Location: Milwaukee, WI
Senior Member

Daniel-

Glad to hear you are looking to adopt e4! You are correct that after 3.8 there aren't any planned releases of the 3.x architecture. However, backwards compatibility is and will remain a requirement in 4.x. The core e4 tooling will not support 3.x but the compatibility layer will take care of that.

As for the perspectiveExtensions, I believe you are referring to the "actions" in the tool bar for the view. This is something you are able to accomplish with either commands or command contributions. Take a look at [1] for how to accomplish this.

As far as recommendations go, I would focus on moving any existing actionSets to commands and be realistic about when/where you use perspectiveExtensions. Unless you are contributing to a third party perspective, I would avoid use of perspective extensions.

Take care,

JD


[1] http://www.vogella.com/articles/EclipseCommands/article.html#menus_extensionpoint
Re: Substitute for action sets [message #918873 is a reply to message #918852] Fri, 21 September 2012 12:25 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
On 2012-09-21 14:06, Joseph Carroll wrote:
> As for the perspectiveExtensions, I believe you are referring to the
> "actions" in the tool bar for the view. This is something you are able
> to accomplish with either commands or command contributions. Take a
> look at [1] for how to accomplish this.
> As far as recommendations go, I would focus on moving any existing
> actionSets to commands and be realistic about when/where you use
> perspectiveExtensions. Unless you are contributing to a third party
> perspective, I would avoid use of perspective extensions.

You are misunderstanding me. I can replace actions by commands, that is
not the problem. The problem is the lack of an substitute for *action
sets*. In the perspective extension points we are referencing action
sets to reduce duplication of larger sets of actions that we want to
have in specific perspectives. But I cannot replace the action sets,
because there is no substitute for them in an action-free world. This
also means that I cannot replace the corresponding actions by commands
here. This looks like a catch-22 to me.

I had hoped that there would be something similar to action sets in the
command API, but I haven't found something like this so-far.

Thanks for your reply anyway,

- Daniel
Re: Substitute for action sets [message #918905 is a reply to message #918873] Fri, 21 September 2012 13:15 Go to previous messageGo to next message
Joseph Carroll is currently offline Joseph CarrollFriend
Messages: 174
Registered: May 2012
Location: Milwaukee, WI
Senior Member

In 3.x take a look at the extension point:
org.eclipse.ui.menus
When defining menuContributions they represent "ordered set[s] of contributions". While this would not necessarily address the issue of global reuse directly, there are ways you would be able to accomplish that.

In 4.x take a look at Toolbar/MenuContributions. They represent the type of reusable sets I believe you are looking for.
Re: Substitute for action sets [message #923147 is a reply to message #918873] Tue, 25 September 2012 16:40 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Since 3.3 for every actionSet there is a corresponding org.eclipse.ui.contexts context with a parent of org.eclipse.ui.actionSet.

It can be used in o.e.ui.menus/commands visibleWhen classes:

              <visibleWhen
                    checkEnabled="false">
                 <with
                       variable="activeContexts">
                    <iterate
                          operator="or">
                       <equals
                             value="org.eclipse.jdt.ui.text.java.actionSet.presentation">
                       </equals>
                    </iterate>
                 </with>
              </visibleWhen>



If you create even an empty actionSet and use the ID, your commands should be tied to that actionSet.

The downside is the commands aren't displayed in the CustomizePerspectiveDialog Command Groups tab.

It's functionality that's not yet implemented.

PW


Re: Substitute for action sets [message #923676 is a reply to message #923147] Wed, 26 September 2012 05:13 Go to previous message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
On 2012-09-25 18:40, Paul Webster wrote:
> Since 3.3 for every actionSet there is a corresponding
> org.eclipse.ui.contexts context with a parent of org.eclipse.ui.actionSet.
>
> It can be used in o.e.ui.menus/commands visibleWhen classes:
>
> <visibleWhen
> checkEnabled="false">
> <with
> variable="activeContexts">
> <iterate
> operator="or">
> <equals
>
> value="org.eclipse.jdt.ui.text.java.actionSet.presentation">
> </equals>
> </iterate>
> </with>
> </visibleWhen>
>
>
>
> If you create even an empty actionSet and use the ID, your commands
> should be tied to that actionSet.

Thanks Paul, that would be at least better as currently (even though the
extension point action set is deprecated, too. Therefore I wondered
whether there would exist a variant that would realize the same or
similar effects without any action set extension point). I will give
that a try.

> The downside is the commands aren't displayed in the
> CustomizePerspectiveDialog Command Groups tab.

Fortunately this downside is irrelevant for our software, because we
don't provide access to that functionality to the user of our RCP
application.

Thanks & Greetings from Bremen,

Daniel Krügler
Previous Topic:Issues running the Automated Tests package
Next Topic:Eclipse Juno run slowly!!!!!!!!!!
Goto Forum:
  


Current Time: Fri Apr 26 05:39:54 GMT 2024

Powered by FUDForum. Page generated in 0.03961 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top