Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Fragments and Plug-ins
Fragments and Plug-ins [message #289404] Thu, 04 August 2005 12:20 Go to next message
Eclipse UserFriend
Originally posted by: callum.devnet-uk.net

I'm attempting to write a fragment for my plug-in, however I'm not sure if
this is infact what I require for the problem. I'll explain:

I want to display terms and conditions (T&Cs) for products. Most of these
products share common/general T&Cs, however obviously each product will
have its own specific T&Cs.

So I thought I can create a host plug-in that will contain the
general/common T&Cs, and for every product, I have a fragment which has
the product's specific T&Cs.

The thoery is to store the T&Cs in a file and read the file in and display
it in a Text widget.

In my host plug-in, I have a "terms" directory in the project root, and in
the "terms" dir I two others, "general" and "special". In these two
directories I store the files that contain the terms:

terms
+-|
|
+general
| |
| --general.terms
|
+special
|
-- special.terms


So, back to the thoery. When the host plug-in loads, it will get the
contents of the general.terms. (The special.terms is empty in the Host
plug-in).
Now, I write a Fragment that has the same structure for the special terms:

terms->special->special.terms

In the fragment's special.terms file I write the specific T&Cs, so that
when the plug-in loads, it will "replace" the empty file with the
fragment's version.

Am I misunderstanding fragments? The docs say the fragment and plug-in are
"logically merged", does this mean my method will work - the fragment's
file will replace the plug-in's file?

And if so, do I get the contents of the file in the same manner as I have
currently?

Platform.getBundle ("bundle").getEntry ("terms/specific/specific.terms")
;
// etc

I don't see a great deal of help with fragments on the net, except for a
"internalization tutorial", which doesn't really explain enough for my
liking.

Any help is appreciated,

Callum Urquhart
Re: Fragments and Plug-ins [message #289561 is a reply to message #289404] Mon, 08 August 2005 10:24 Go to previous message
Eclipse UserFriend
Originally posted by: callum.devnet-uk.net

To answer my own question: it appears the thoery is correct, however
in-order to access the file in the fragement, you use Platform.find ()
rather than Platform.getBundle ().getEntry which I was trying to use for
nearly 2 days ...

Incidentally, there seems to a serious lack of help/useful documentation
for certain parts of Eclipse concepts.
Previous Topic:Console plugin - Howto?
Next Topic:workbench perspective
Goto Forum:
  


Current Time: Sat Apr 27 03:20:40 GMT 2024

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

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

Back to the top