Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » EMF stand-alone SWT problems(Problems with creating a stand-alone EMF/SWT application)  () 1 Vote
EMF stand-alone SWT problems [message #1705367] Fri, 14 August 2015 08:05 Go to next message
Stefan Bader is currently offline Stefan BaderFriend
Messages: 5
Registered: August 2015
Junior Member
Hi,
I´m trying to create a stand-alone EMF application, that also uses the SWT library.
My problem is that SWT needs the EMF-Activator class to render my GUI.

I thought of copying the Activator class in my package and cusomize them so that there are no final bindings anymore.

My question: Is there a better way to implement such a stand-alone application?

Best regards

Stefan

(EMF 1.6, Eclipse MARS, SWT 4.4.2)
Re: EMF stand-alone SWT problems [message #1705404 is a reply to message #1705367] Fri, 14 August 2015 17:16 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31639
Registered: July 2009
Senior Member
Stefan,

Comments below.

On 14/08/2015 1:42 PM, Stefan Bader wrote:
> Hi,
> I´m trying to create a stand-alone EMF application, that also uses the
> SWT library.
> My problem is that SWT needs the EMF-Activator class to render my GUI.
SWT does not need EMF. So I have no idea what specifically you mean by
this.
>
> I thought of copying the Activator class in my package and cusomize
> them so that there are no final bindings anymore.
Bindings? Final?
>
> My question: Is there a better way to implement such a stand-alone
> application?
It's totally unclear what you think is a problem.
>
> Best regards
>
> Stefan
>
> (EMF 1.6, Eclipse MARS, SWT 4.4.2)


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF stand-alone SWT problems [message #1705492 is a reply to message #1705404] Mon, 17 August 2015 07:25 Go to previous messageGo to next message
Stefan Bader is currently offline Stefan BaderFriend
Messages: 5
Registered: August 2015
Junior Member
I mean customize it in so far that all classes (for example the EMFFormsRendererService) can be created within the class Activator.
I can´t use the default implementation because everything makes usage of the plugin class and the bundle class, which is not possible in a stand alone application
Re: EMF stand-alone SWT problems [message #1705501 is a reply to message #1705492] Mon, 17 August 2015 08:30 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31639
Registered: July 2009
Senior Member
Stefan,

So your question is specifically about EMF Forms. Best you use [EMF
Forms] as the prefix to your subject and mention specific details, as
you've done in this second post, to make the context clear.


On 17/08/2015 9:25 AM, Stefan Bader wrote:
> I mean customize it in so far that all classes (for example the
> EMFFormsRendererService) can be created within the class Activator.
> I can´t use the default implementation because everything makes usage
> of the plugin class and the bundle class, which is not possible in a
> stand alone application


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF stand-alone SWT problems [message #1705645 is a reply to message #1705492] Tue, 18 August 2015 06:31 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi Stefan,

what do you mean by a stand-alone application?
Have you had a look at the "make it happen" code examples, we provide?
They all run as a standa-lone application.

Best regards

Jonas

Am 17.08.2015 um 09:25 schrieb Stefan Bader:
> I mean customize it in so far that all classes (for example the
> EMFFormsRendererService) can be created within the class Activator.
> I can´t use the default implementation because everything makes usage of
> the plugin class and the bundle class, which is not possible in a stand
> alone application


--
--

Jonas Helming

Get professional Eclipse developer support:

http://eclipsesource.com/en/services/developer-support/
Re: EMF stand-alone SWT problems [message #1706014 is a reply to message #1705645] Fri, 21 August 2015 06:39 Go to previous messageGo to next message
Stefan Bader is currently offline Stefan BaderFriend
Messages: 5
Registered: August 2015
Junior Member
Sorry that i used the wrong forum :/

I want to create a gui that i can open without opening the eclipse.
I want the main window to be a SWT shell, which is defided into 2 segments. The first segment is a SWT tree structure. I want the second part to render a given EMF Model.

The problem is that almost all methods depend on the plugin object or the bundle object, which i can´t use.
I´m now trying to render my model by manually creating all needed classes and copying some methods, but this isn´t working out either.

Sorry I´m a newby at EMF implementation

EDIT: and yes i looked at it, but i can´t get it to work the way i want it. In fact the EMF model i want to render was such a make-it-happen-applicaition

[Updated on: Fri, 21 August 2015 06:43]

Report message to a moderator

Re: EMF stand-alone SWT problems [message #1706021 is a reply to message #1706014] Fri, 21 August 2015 07:42 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,

we are happy to help you, but you need to provide more details:

Why can you not use the "bundle object"?
What exactly is that?
Which methods depend on it?

Best regards

Jonas


Am 21.08.2015 um 08:39 schrieb Stefan Bader:
> Sorry that i used the wrong forum :/
> I want to create a gui that i can open without opening the eclipse.
> I want the main window to be a SWT shell, which is defided into 2
> segments. The first segment is a SWT tree structure. I want the second
> part to render a given EMF Model.
>
> The problem is that almost all methods depend on the plugin object or
> the bundle object, which i can´t use.
> I´m now trying to render my model by manually creating all needed
> classes and copying some methods, but this isn´t working out either.
>
> Sorry I´m a newby at EMF implementation


--
--

Jonas Helming

Get professional Eclipse developer support:

http://eclipsesource.com/en/services/developer-support/
Re: EMF stand-alone SWT problems [message #1706032 is a reply to message #1706014] Fri, 21 August 2015 08:50 Go to previous messageGo to next message
Stefan Bader is currently offline Stefan BaderFriend
Messages: 5
Registered: August 2015
Junior Member
Hi Jonas,

I can´t use anything that uses the Plugin. class (org.eclipse.core.runtime.plugin) or the bundle class (org.osgi.framework.bundle).
These classes get called mostly by the Activator.class (org.eclipse.emf.ecp.view.internal.swt.Activator.class).

For example:

public ReportService getReportService() {
final BundleContext bundleContext = getBundle().getBundleContext();
final ServiceReference<ReportService> serviceReference =
bundleContext.getServiceReference(ReportService.class);
return bundleContext.getService(serviceReference);
}

I only get NullPointerExceptions when i use them, because i want it to be a pure SWT application without any links to eclipse.

I implemented it like i said. But it failes to initialize the correct renderer.

Thank you for your help

Stefan

[Updated on: Fri, 21 August 2015 08:51]

Report message to a moderator

Re: EMF stand-alone SWT problems [message #1706143 is a reply to message #1706032] Mon, 24 August 2015 07:20 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,

the mentioned bundle class is provided by OSGi, which has no reference
to Eclipse. Eclipse is based on OSGI, though. Do you want to build an
application without OSGi? Is there a specific reason for this requirement?

Best regards

Jonas

Am 21.08.2015 um 10:50 schrieb Stefan Bader:
> Hi Jonas,
>
> I can´t use anything that uses the Plugin. class
> (org.eclipse.core.runtime.plugin) or the bundle class
> (org.osgi.framework.bundle).
> These classes get called mostly by the Activator.class
> (org.eclipse.emf.ecp.view.internal.swt.Activator.class).
>
> For eg.
>
> public ReportService getReportService() {
> final BundleContext bundleContext = getBundle().getBundleContext();
> final ServiceReference<ReportService> serviceReference =
> bundleContext.getServiceReference(ReportService.class);
> return bundleContext.getService(serviceReference);
> }
>
> I only get NullPointerExceptions when i use them, because i want it to
> be a pure SWT application without any links to eclipse.
>
> I implemented it like i said. But it failes to initialize the correct
> renderer.
>
> Thank you fort your help
>
> Stefan
>


--
--

Jonas Helming

Get professional Eclipse developer support:

http://eclipsesource.com/en/services/developer-support/
Re: EMF stand-alone SWT problems [message #1706606 is a reply to message #1706143] Fri, 28 August 2015 06:47 Go to previous messageGo to next message
Stefan Bader is currently offline Stefan BaderFriend
Messages: 5
Registered: August 2015
Junior Member
HI Jonas,

That´s a really good question. I haven´t thought about using OSGI.

My enitial though was to create a RCP application because of it´s faster start up.
I have to look into using OSGI stand alone,. Never have done this....

Thank you for your help, but maybe i´ll have to come back here if i can´t figure it out.

Regards

Stefan
Re: EMF stand-alone SWT problems [message #1706664 is a reply to message #1706606] Fri, 28 August 2015 13:58 Go to previous message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
RCP applications are typically based on OSGi anyways...

Am 28.08.2015 um 08:47 schrieb Stefan Bader:
> HI Jonas,
>
> That´s a really good question. I haven´t thought about using OSGI.
>
> My enitial though was to create a RCP application because of it´s faster
> start up.
> I have to look into using OSGI stand alone,. Never have done this....
>
> Thank you for your help, but maybe i´ll have to come back here if i
> can´t figure it out.
>
> Regards
>
> Stefan


--
--

Jonas Helming

Get professional Eclipse developer support:

http://eclipsesource.com/en/services/developer-support/
Previous Topic:[Texo] Annotations Model directly in ECore
Next Topic:[Teneo] MappingException on embedded object after save/refresh/save cycle on parent object
Goto Forum:
  


Current Time: Fri Dec 04 00:13:53 GMT 2020

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

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

Back to the top