Skip to main content



      Home
Home » Newcomers » Newcomers » Accessing an object application-wide
Accessing an object application-wide [message #838057] Fri, 06 April 2012 10:00 Go to next message
Eclipse UserFriend
I have a service class that I need it be accessible from several views and editors. It must be created in application startup onece.

Thanks.
Re: Accessing an object application-wide [message #838098 is a reply to message #838057] Fri, 06 April 2012 11:05 Go to previous messageGo to next message
Eclipse UserFriend
On 04/06/2012 09:00 AM, Hamed Mohammadi wrote:
> I have a service class that I need it be accessible from several views
> and editors. It must be created in application startup onece.
>
> Thanks.
You can use an Activator for creating a singleton. An Activator is an
optional part of a plugin that allows you to hook into the plugins life
cycle. You can use it to setup static variables that other components
need to access.

The super class of your Activator depends on the type of plugin you
have(UI, non-UI). Look at the documentation for
org.eclipse.core.runtime.Plugin and its subclasses to pick the
appropriate base class for your plugin.
Re: Accessing an object application-wide [message #838119 is a reply to message #838098] Fri, 06 April 2012 11:46 Go to previous message
Eclipse UserFriend
David Wegener wrote on Fri, 06 April 2012 19:35
On 04/06/2012 09:00 AM, Hamed Mohammadi wrote:
> I have a service class that I need it be accessible from several views
> and editors. It must be created in application startup onece.
>
> Thanks.
You can use an Activator for creating a singleton. An Activator is an
optional part of a plugin that allows you to hook into the plugins life
cycle. You can use it to setup static variables that other components
need to access.

The super class of your Activator depends on the type of plugin you
have(UI, non-UI). Look at the documentation for
org.eclipse.core.runtime.Plugin and its subclasses to pick the
appropriate base class for your plugin.


Thanks for reply. It seems that the wizard created for me a default Activator class and using that my problem is solved.

Thanks again.
Previous Topic:How to Launch / Run / Open HTML Files in Internal Browser
Next Topic:jetty adapter
Goto Forum:
  


Current Time: Wed Jul 23 17:09:05 EDT 2025

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

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

Back to the top