Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Eclipse 3.0 M5 - How to use 'org.eclipse.ui.startup' extension?
Eclipse 3.0 M5 - How to use 'org.eclipse.ui.startup' extension? [message #175338] Sat, 03 January 2004 19:23 Go to next message
Eclipse UserFriend
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 #175364 is a reply to message #175338] Sat, 03 January 2004 23:31 Go to previous messageGo to next message
Eclipse UserFriend
Sandip Chitale wrote:
> 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)
>
>
>
You can do something like this:

public class SimplePlugin
extends AbstractUIPlugin
implements IStartup {

public SimplePlugin(IPluginDescriptor descriptor) {
super(descriptor);
}

public void earlyStartup() {
}
}
Re: Eclipse 3.0 M5 - How to use 'org.eclipse.ui.startup' extension? [message #175380 is a reply to message #175364] Sun, 04 January 2004 02:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sandipchitale.comcast.net

"Aleksandr Shneyderman" <alex@law.columbia.edu> wrote in message news:bt84s0$epo$1@eclipse.org...
> Sandip Chitale wrote:
> > 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)
> >
> >
> >
> You can do something like this:
>
> public class SimplePlugin
> extends AbstractUIPlugin
> implements IStartup {
>
> public SimplePlugin(IPluginDescriptor descriptor) {
> super(descriptor);
> }
>
> public void earlyStartup() {
> }
> }
>

Yes. I have a similar plugin implementation.

That is precisely the problem. Apparently a constructor with no arguments is being invoked instead of the one with one argument of
type IPluginDescriptor. And that constructor does not exist.

Any clues? Is it a known bug?
Re: Eclipse 3.0 M5 - How to use 'org.eclipse.ui.startup' extension? [message #175844 is a reply to message #175380] Mon, 05 January 2004 13:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

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

Re: Eclipse 3.0 M5 - How to use 'org.eclipse.ui.startup' extension? [message #175851 is a reply to message #175844] Mon, 05 January 2004 14:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sandipchitale.fairisaac.com

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
> 
>
Re: Eclipse 3.0 M5 - How to use 'org.eclipse.ui.startup' extension? [message #176071 is a reply to message #175851] Mon, 05 January 2004 23:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ed.burnette.REMOVE.THIS.sas.com

Sandip,
Please see the source code for the FileOpen plug-in - it does exactly what
you describe. You can find it in the download section of
www.eclipsepowered.org. A client program is provided that works pretty much
like emacsclient. It hasn't been ported to 3.0 (since I was really hoping
that most or all of it would be included in the release) but that shouldn't
be too hard since you're familiar with the external file action already.

--
Ed


"Sandip Chitale" <sandipchitale@fairisaac.com> wrote in message
news:btce45$gfc$1@eclipse.org...
> 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
Re: Eclipse 3.0 M5 - How to use 'org.eclipse.ui.startup' extension? [message #176103 is a reply to message #176071] Tue, 06 January 2004 01:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sandipchitale.comcast.net

Hi Ed,

I knew someone must have done this. I just could not find it.
I will look into it.

Thanks,
sandip

PS: I will check out how the startup issue was dealt with in the
plug-in, if at all.

"Ed Burnette" <ed.burnette@REMOVE.THIS.sas.com> wrote in message news:btde8f$h35$1@eclipse.org...
> Sandip,
> Please see the source code for the FileOpen plug-in - it does exactly what
> you describe. You can find it in the download section of
> www.eclipsepowered.org. A client program is provided that works pretty much
> like emacsclient. It hasn't been ported to 3.0 (since I was really hoping
> that most or all of it would be included in the release) but that shouldn't
> be too hard since you're familiar with the external file action already.
>
> --
> Ed
>
>
> "Sandip Chitale" <sandipchitale@fairisaac.com> wrote in message
> news:btce45$gfc$1@eclipse.org...
> > 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
>
>
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 Go to previous message
Eclipse UserFriend
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
>>
>>
>
>
>
Previous Topic:problems to open Eclipse
Next Topic:Backward compatibility issues
Goto Forum:
  


Current Time: Fri Aug 29 04:30:47 EDT 2025

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

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

Back to the top