Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Where to find the IServiceConstants?
Where to find the IServiceConstants? [message #1004630] Wed, 23 January 2013 15:14 Go to next message
Eclipse UserFriend
Hello,
in almost each tutorial the annotation
@Named(IServiceConstants.ACTIVE_SELECTION) Some thing is described. But
where can I find the IServiceConstants? Which plugin contains this
interface and what feature to install?

best regards,
Gilbert
Re: Where to find the IServiceConstants? [message #1004639 is a reply to message #1004630] Wed, 23 January 2013 15:24 Go to previous messageGo to next message
Joseph Carroll is currently offline Joseph CarrollFriend
Messages: 174
Registered: May 2012
Location: Milwaukee, WI
Senior Member

Try using the Open Type dialog (CTRL + SHFT + T)
Re: Where to find the IServiceConstants? [message #1004640 is a reply to message #1004630] Wed, 23 January 2013 15:25 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 482
Registered: December 2010
Location: Germany
Senior Member
Hi Gilbert,

IServiceConstants is in the org.eclipse.e4.ui.services plugin.
But I don't know which feature to use for a pure e4 application ... but would also be interessted in the answer Smile.

Hope that helps.
Christoph
Re: Where to find the IServiceConstants? [message #1004647 is a reply to message #1004640] Wed, 23 January 2013 15:32 Go to previous messageGo to next message
Joseph Carroll is currently offline Joseph CarrollFriend
Messages: 174
Registered: May 2012
Location: Milwaukee, WI
Senior Member

Right now there is only one feature for everything e4 and that is org.eclipse.e4.rcp, including all org.eclipse.e4.core.* plugins.

JD
Re: Where to find the IServiceConstants? [message #1004683 is a reply to message #1004639] Wed, 23 January 2013 16:56 Go to previous messageGo to next message
Eclipse UserFriend
Joseph Carroll wrote:
> Try using the Open Type dialog (CTRL + SHFT + T)
I tried this with an empty result set :(
Re: Where to find the IServiceConstants? [message #1004939 is a reply to message #1004683] Thu, 24 January 2013 07:15 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
On 2013-01-23 17:56, Gilbert Mirenque wrote:
> Joseph Carroll wrote:
>> Try using the Open Type dialog (CTRL + SHFT + T)
> I tried this with an empty result set :(

Please check the following: Open the "Preferences" dialog and select the
node "Plug-in Development": Ensure that the option "Include all plug-ins
from target in Java search" is checked. If it wasn't this might be the
reason that Ctrl+Shift+T wasn't working.

HTH & Greetings from Bremen,

- Daniel
Re: Where to find the IServiceConstants? [message #1004981 is a reply to message #1004640] Thu, 24 January 2013 09:03 Go to previous messageGo to next message
Eclipse UserFriend
Ok, I added the dependency to org.eclipse.e4.ui.services and now I can
access the IServiceConstants. More interesting, after adding the
dependency the IServiceConstants are listed when pressing CTRL + SHFT +
T. Thanks to all.

best regards,
Gilbert

Christoph Keimel wrote:
> Hi Gilbert,
>
> IServiceConstants is in the org.eclipse.e4.ui.services plugin. But I
> don't know which feature to use for a pure e4 application ... but would
> also be interessted in the answer :).
>
> Hope that helps.
> Christoph
Re: Where to find the IServiceConstants? [message #1004988 is a reply to message #1004981] Thu, 24 January 2013 09:11 Go to previous messageGo to next message
Eclipse UserFriend
One last question: how do I inject the active selection when
right-clicking in the Ecore diagram editor (or in an GMF editor in
general)? I tried this what always results in an null object:

@Execute
public void execute(@Optional @Named(IServiceConstants.ACTIVE_SELECTION)
IGraphicalEditPart editPart){
// do something)
}
Re: Where to find the IServiceConstants? [message #1004999 is a reply to message #1004988] Thu, 24 January 2013 09:39 Go to previous message
Eclipse UserFriend
Ok I got it:

@Execute
public void execute(@Optional @Named(IServiceConstants.ACTIVE_SELECTION)
StructuredSelection structuredSelection){
// do something)
if(!structuredSelection.isEmpty()){
Object selectedElement = structuredSelection.getFirstElement();
if(selectedElement instanceof IGraphicalEditPart){
// do something
}
}
}
Previous Topic:Model Menu replaced by 3.x contributed menu
Next Topic:How to contribute a new menu item in an existing menu via a fragment?
Goto Forum:
  


Current Time: Tue Mar 19 08:46:10 GMT 2024

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

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

Back to the top