|
|
Re: Accessing an object application-wide [message #838119 is a reply to message #838098] |
Fri, 06 April 2012 15:46 |
|
David Wegener wrote on Fri, 06 April 2012 19:35On 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.
|
|
|
Powered by
FUDForum. Page generated in 0.03724 seconds