Eclipse 3.0 M5 - How to use 'org.eclipse.ui.startup' extension? [message #175338] |
Sat, 03 January 2004 19:23  |
Eclipse User |
|
|
|
Originally posted by: sandipchitale.comcast.net
The normal way to use the org.eclipse.ui.startup extension is to
implement the IStartup interface. Can the plugin class itself implement the IStartup interface? When I do that I get
InstantitationException as my plugin does not have a default constructor i.e. constructor with no arguments.
org.eclipse.core.runtime.CoreException[2]: java.lang.InstantiationException: FileOpenServer.FileOpenServerPlugin
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.eclipse.core.internal.plugins.PluginDescriptor.createExe cutableExtension(PluginDescriptor.java:138)
at org.eclipse.core.internal.plugins.PluginDescriptor.createExe cutableExtension(PluginDescriptor.java:179)
at org.eclipse.core.internal.plugins.ConfigurationElement.creat eExecutableExtension(ConfigurationElement.java:103)
at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugi n.java:159)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:51)
at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(Work benchPlugin.java:156)
at org.eclipse.ui.internal.Workbench$10.run(Workbench.java:1312 )
at org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java:1127)
at org.eclipse.core.runtime.Platform.run(Platform.java:464)
at org.eclipse.ui.internal.Workbench$9.run(Workbench.java:1321)
at java.lang.Thread.run(Unknown Source)
|
|
|
|
|
|
|
|
|
Re: Eclipse 3.0 M5 - How to use 'org.eclipse.ui.startup' extension? [message #180694 is a reply to message #175851] |
Thu, 15 January 2004 17:34  |
Eclipse User |
|
|
|
Originally posted by: John_Arthorne.oti.com_
If you want to use the Plugin class as the startup class, then simply
omit the "class" attribute on the startup extension. If this attribute
is omitted, the plugin class will be used instead. This is from the
documentation for the startup extension point in the platform plug-in
developer's guide:
"If the startup element has a class attribute, the method earlyStartup()
will be called on this class. Otherwise, this method will be called from
the plugin class. "
--
Sandip Chitale wrote:
> Rich,
>
> Thanks for the info. I suspected as much. I think this info should be
> documented in the org.eclipse.ui.startup
> extension page.
>
> Basically I am trying to create a simple File Open Server plugin. The idea
> is that the plugin will
> listen on a user configured port number. It will read requests to open files
> (may be external files)
> as a absolute file name per line from the incoming connection stream and
> open those files in Eclipse.
> This could be used to integrate with desktop or for two way integration with
> emacs. I want to
> have the plugin server started (controlled by a user preference) when
> Eclipse is launched. I am aware
> that implementing org.eclipse.ui.startup extension is not a guarentee that
> the plugin will start because the
> user may choose to not start it using Workbench > Startup preference. To
> cover that there will be a explicit
> command to start and stop the server also.
>
> (PS: I am using the code from Open External File action implementation to
> open workspace or external files.)
>
>
> regards,
> sandip
>
>
> "Rich Kulp" <richkulp@NO.SPAM.us.ibm.com> wrote in message
> news:btcc0c$dsk$1@eclipse.org...
>
>>It creates an instance of the class mentioned in the startup extension
>>point. This is separate from the plugin instance. It doesn't notice that
>>the IStartup class is the same as the plugin class.
>>
>>Don't use the plugin class as your IStartup class. If you did that you
>>would have two instances of the plugin class. You should have just a
>>separate IStartup implementation class.
>>
>>NOTE: Do you REALLY need to do something on startup? This is should be
>>discouraged because it adds to the startup time, even if your plugin is
>>not needed during that session.
>>
>>
>>--
>>Thanks, Rich Kulp
>>
>>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.28349 seconds