Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Alternative to extending an 'internal' class(Looking to write a pseudo-java-launcher without extending SharedJavaMainTab)
Alternative to extending an 'internal' class [message #871445] Sun, 13 May 2012 19:50 Go to next message
Chris Ainsley is currently offline Chris AinsleyFriend
Messages: 78
Registered: March 2010
Location: UK
Member
Hi,

I'm currently writing my first Eclipse plug-in, and its going slowly, but I'm excited to be making progress.

I'm having a trivial problem but not sure what is the correct way forward so I'm posting here.

I'm writing a launcher to launch certain types of files via a JVM (but the launching dialogs are completely customised). Think of it as similar to the difference between a regular java app, an applet and a remote java app.

Bearing that in mind, I looked to the org.eclipse.jdt.debug.ui.launchConfigurations.AppletMainTab for inspiration on how to modify a main tab. This class extends the 'org.eclipse.jdt.internal.debug.ui.launcher.SharedJavaMainTab' and as such, there is very little code in the actual AppletMainTab class itself.

My question is, why is the 'org.eclipse.jdt.internal.debug.ui.launcher.SharedJavaMainTab' internal, and is it ok for me to extend this class even though its internal?

Of course, if I don't extend this class, then I can only think of copying and pasting from the internal classes into my own class as I need 90% of the same behaviour.

Can anyone recommend what is the corrent solution here?

Regards,

Chris
Re: Alternative to extending an 'internal' class [message #871609 is a reply to message #871445] Mon, 14 May 2012 14:16 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 13.05.2012 21:50, Chris Ainsley wrote:
> Hi,
>
> I'm currently writing my first Eclipse plug-in, and its going slowly,
> but I'm excited to be making progress.
>
> I'm having a trivial problem but not sure what is the correct way
> forward so I'm posting here.
>
> I'm writing a launcher to launch certain types of files via a JVM (but
> the launching dialogs are completely customised). Think of it as
> similar to the difference between a regular java app, an applet and a
> remote java app.
> Bearing that in mind, I looked to the
> org.eclipse.jdt.debug.ui.launchConfigurations.AppletMainTab for
> inspiration on how to modify a main tab. This class extends the
> 'org.eclipse.jdt.internal.debug.ui.launcher.SharedJavaMainTab' and as
> such, there is very little code in the actual AppletMainTab class itself.
>
> My question is, why is the
> 'org.eclipse.jdt.internal.debug.ui.launcher.SharedJavaMainTab' internal,
Providing an API is expensive in the sense that it locks in the product.
Therefore those are often only provided on request.
> and is it ok for me to extend this class even though its internal?
You can use it but in the next Eclipse version this class might not be
there anymore or work differently. You might have to adjust your code then.
> Of course, if I don't extend this class, then I can only think of
> copying and pasting from the internal classes into my own class as I
> need 90% of the same behaviour.
>
> Can anyone recommend what is the corrent solution here?
The correct solution is to only use official API, especially if you
intend to ship a product.

Dani
>
> Regards,
>
> Chris
Previous Topic:Java Eclipse console not working [SOLVED (false alarm)]
Next Topic:step filtering - set packages to go into
Goto Forum:
  


Current Time: Wed Sep 25 19:32:23 GMT 2024

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

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

Back to the top