Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » How does Eclipse decide which of the 2 Fragments of a Plugin to load ???
How does Eclipse decide which of the 2 Fragments of a Plugin to load ??? [message #74100] Fri, 06 October 2006 20:51 Go to next message
Eclipse UserFriend
Originally posted by: java.jago.gmail.com

Hi,

We know the Eclipse Plugin: org.eclipse.swt

On Linux this plugin has ONE of the two Fragments:

1. org.eclipse.swt.gtk.linux.xxx.jar
2. org.eclipse.swt.motif.linux.xxx.jar


Actually I can have an Eclipse-Distribution which has both fragments and
I choose between GTK and MOTIF with:

-ws gtk
-ws motif

in the eclipse.ini


My question: If I don't specify anything in eclipse.ini - how does
Eclipse decide which Fragment to use during startup ???

Because Eclipse chooses one of them if I don't specify it in eclipse.ini
- how ?



2nd Question: Can I somehow else (e.g. read it out from some
Eclipse-PreferenceStore instead of the command line or eclipse.ini) tell
Eclipse which Fragment it should take?
Re: How does Eclipse decide which of the 2 Fragments of a Plugin to load ??? [message #74118 is a reply to message #74100] Sat, 07 October 2006 11:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alex_blewitt.yahoo.com

Don't cross post:

http://www.eclipsezone.com/eclipse/forums/t82443.html
http://www.eclipsezone.com/eclipse/forums/t82440.html
http://www.eclipsezone.com/eclipse/forums/t82441.html

You should get an answer from the Equinox group, though.
Re: How does Eclipse decide which of the 2 Fragments of a Plugin to load ??? [message #74134 is a reply to message #74100] Sat, 07 October 2006 15:34 Go to previous messageGo to next message
Darryl Miles is currently offline Darryl MilesFriend
Messages: 123
Registered: July 2009
Senior Member
exquisitus wrote:
> On Linux this plugin has ONE of the two Fragments:
>
> 1. org.eclipse.swt.gtk.linux.xxx.jar
> 2. org.eclipse.swt.motif.linux.xxx.jar
>
>
> Actually I can have an Eclipse-Distribution which has both fragments and
> I choose between GTK and MOTIF with:
>
> -ws gtk
> -ws motif
>
> in the eclipse.ini


Inside each JAR which makes up each fragment lookup the
Bundle-PlatformFilter option to the MANIFEST.MF.

Eclipse-PlatformFilter: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=x86))

http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse. platform.doc.isv/reference/misc/bundle_manifest.html


> My question: If I don't specify anything in eclipse.ini - how does
> Eclipse decide which Fragment to use during startup ???
>
> Because Eclipse chooses one of them if I don't specify it in eclipse.ini
> - how ?

Its all automatic. When you select in the INI file you are picking
which is will use, then each contributing fragment uses
Eclipse-PlatformFilter to select the correct contribution.


Darryl
Re: How does Eclipse decide which of the 2 Fragments of a Plugin to load ??? [message #74169 is a reply to message #74134] Sat, 07 October 2006 18:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: java.jago.gmail.com

Darryl L. Miles wrote:
> exquisitus wrote:
>
>> On Linux this plugin has ONE of the two Fragments:
>>
>> 1. org.eclipse.swt.gtk.linux.xxx.jar
>> 2. org.eclipse.swt.motif.linux.xxx.jar
>>
>>
>> Actually I can have an Eclipse-Distribution which has both fragments
>> and I choose between GTK and MOTIF with:
>>
>> -ws gtk
>> -ws motif
>>
>> in the eclipse.ini
>
>
>
> Inside each JAR which makes up each fragment lookup the
> Bundle-PlatformFilter option to the MANIFEST.MF.
>
> Eclipse-PlatformFilter: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=x86))
>
> http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse. platform.doc.isv/reference/misc/bundle_manifest.html

I know that. osgi.ws is either gtk or motif. But that's not my problem.
I want to understand the descision process of Eclipse - how does Eclipse
choose gtk or motif If I don't specify anything ?

>
>
>
>> My question: If I don't specify anything in eclipse.ini - how does
>> Eclipse decide which Fragment to use during startup ???
>>
>> Because Eclipse chooses one of them if I don't specify it in
>> eclipse.ini - how ?
>
>
> Its all automatic. When you select in the INI file you are picking
> which is will use, then each contributing fragment uses
> Eclipse-PlatformFilter to select the correct contribution.

That's the point - if I don't write ANYTHING into eclipse.ini BUT still
it chooses one of the two fragments. My question is - how does Eclipse
decide that it chooses one instead of the other (again I didn't specify
anything in eclipse.ini)

Thx,
exq
Re: How does Eclipse decide which of the 2 Fragments of a Plugin to load ??? [message #74223 is a reply to message #74169] Sun, 08 October 2006 12:03 Go to previous messageGo to next message
Darryl Miles is currently offline Darryl MilesFriend
Messages: 123
Registered: July 2009
Senior Member
exquisitus wrote:
> Darryl L. Miles wrote:
> I know that. osgi.ws is either gtk or motif. But that's not my problem.
> I want to understand the descision process of Eclipse - how does Eclipse
> choose gtk or motif If I don't specify anything ?

Ah I understand what you are asking now. Unfortunately I can not state
categorically your answer.


One thing that immediately springs to mind all the base platform
distributions come as motif OR gtk1 OR gtk2. So there is a bias already
to which widget set you get. Maybe this is to reduce distribution size
and not for any incompatibility reasons.


But if I were to implement auto-detection I'd start with querying the
window manager.

There is a mechanism that is part of the X.11 protocol, allowing two
different processes to communicate through the X.11 server, passing
queries though like events.

I can't point any documentation and my X.11 protocol knowledge maybe a
little rusty these days.

Maybe: http://en.wikipedia.org/wiki/ICCCM

You'd then need to find out what the defacto standard is for
constructing events for each window manager and trying each in turn.
Until you could establish which window manager the user is using and
from that bias the default widget set selection from those that are
available in your Eclipse installation.


> That's the point - if I don't write ANYTHING into eclipse.ini BUT still
> it chooses one of the two fragments. My question is - how does Eclipse
> decide that it chooses one instead of the other (again I didn't specify
> anything in eclipse.ini)

You are really asking, "How does Eclipse set the value of the osgi.ws
property?"

You are not really asking, "How does Eclipse pick which fragment to
load?" which is what your question sounds like to me.


Darryl
Re: How does Eclipse decide which of the 2 Fragments of a Plugin to load ??? [message #74380 is a reply to message #74223] Tue, 10 October 2006 12:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jeff_mcaffer.REMOVE.ca.ibm.com

Sorry, no magic. The executable decides. There are simply different
launchers for linux gtk and linux motif (for a given architecture). Get
both drops and do a bytewise comparison. You can see the complete
code (and the two different prebuilt launchers) at
http://dev.eclipse.org/viewcvs/index.cgi/platform-launcher/
Jeff


Darryl L. Miles wrote:
> exquisitus wrote:
>> Darryl L. Miles wrote:
>> I know that. osgi.ws is either gtk or motif. But that's not my
>> problem. I want to understand the descision process of Eclipse - how
>> does Eclipse choose gtk or motif If I don't specify anything ?
>
> Ah I understand what you are asking now. Unfortunately I can not state
> categorically your answer.
>
>
> One thing that immediately springs to mind all the base platform
> distributions come as motif OR gtk1 OR gtk2. So there is a bias already
> to which widget set you get. Maybe this is to reduce distribution size
> and not for any incompatibility reasons.
>
>
> But if I were to implement auto-detection I'd start with querying the
> window manager.
>
> There is a mechanism that is part of the X.11 protocol, allowing two
> different processes to communicate through the X.11 server, passing
> queries though like events.
>
> I can't point any documentation and my X.11 protocol knowledge maybe a
> little rusty these days.
>
> Maybe: http://en.wikipedia.org/wiki/ICCCM
>
> You'd then need to find out what the defacto standard is for
> constructing events for each window manager and trying each in turn.
> Until you could establish which window manager the user is using and
> from that bias the default widget set selection from those that are
> available in your Eclipse installation.
>
>
>> That's the point - if I don't write ANYTHING into eclipse.ini BUT
>> still it chooses one of the two fragments. My question is - how does
>> Eclipse decide that it chooses one instead of the other (again I
>> didn't specify anything in eclipse.ini)
>
> You are really asking, "How does Eclipse set the value of the osgi.ws
> property?"
>
> You are not really asking, "How does Eclipse pick which fragment to
> load?" which is what your question sounds like to me.
>
>
> Darryl
Re: How does Eclipse decide which of the 2 Fragments of a Plugin to load ??? [message #74713 is a reply to message #74169] Wed, 11 October 2006 17:04 Go to previous message
Eclipse UserFriend
Originally posted by: dj_houghton.nospam.ca.ibm.com

The executable is compiled with the constants to pass in. If you are
starting directly from the JAR and nothing is specified, there is some
basic "guess" code in the EclipseEnvironmentInfo class in the
org.eclipse.osgi project.

exquisitus wrote:
> Darryl L. Miles wrote:
>> exquisitus wrote:
>>
>>> On Linux this plugin has ONE of the two Fragments:
>>>
>>> 1. org.eclipse.swt.gtk.linux.xxx.jar
>>> 2. org.eclipse.swt.motif.linux.xxx.jar
>>>
>>>
>>> Actually I can have an Eclipse-Distribution which has both fragments
>>> and I choose between GTK and MOTIF with:
>>>
>>> -ws gtk
>>> -ws motif
>>>
>>> in the eclipse.ini
>>
>>
>>
>> Inside each JAR which makes up each fragment lookup the
>> Bundle-PlatformFilter option to the MANIFEST.MF.
>>
>> Eclipse-PlatformFilter: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=x86))
>>
>> http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse. platform.doc.isv/reference/misc/bundle_manifest.html
>
>
> I know that. osgi.ws is either gtk or motif. But that's not my problem.
> I want to understand the descision process of Eclipse - how does Eclipse
> choose gtk or motif If I don't specify anything ?
>
>>
>>
>>
>>> My question: If I don't specify anything in eclipse.ini - how does
>>> Eclipse decide which Fragment to use during startup ???
>>>
>>> Because Eclipse chooses one of them if I don't specify it in
>>> eclipse.ini - how ?
>>
>>
>> Its all automatic. When you select in the INI file you are picking
>> which is will use, then each contributing fragment uses
>> Eclipse-PlatformFilter to select the correct contribution.
>
> That's the point - if I don't write ANYTHING into eclipse.ini BUT still
> it chooses one of the two fragments. My question is - how does Eclipse
> decide that it chooses one instead of the other (again I didn't specify
> anything in eclipse.ini)
>
> Thx,
> exq
Previous Topic:Custom priority ClassLoader extention ?
Next Topic:problem with jdk version
Goto Forum:
  


Current Time: Fri Apr 26 23:38:42 GMT 2024

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

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

Back to the top