want to write a macro plugin... please help [message #151265] |
Fri, 09 December 2005 18:31  |
Eclipse User |
|
|
|
Hi All,
I am a newbie in writing eclipse plugins...
I want to write a macro plugin on top of the wst plugin.
For example I have a file xyz.xml the content is:
.... <macro name="content"/> ...
The editor should not display the macro tag but the content of this
macro, that he will find in another file like:
.... <content> process </content> ...
instead of
.... <macro name="content"/> ...
So the question is, where should I write the replacement from the macro
tag to the content.
I thought about a contribution to the extension point:
org.eclipse.ui.editors.documentProviders and extend my document provider
class from TextDocumentProvider.
So if the documentprovider tries to connect with the ressource I will do
the replacement. And if someone would save the document than I will
replace the macro tag back...
But for me this seems to be very ugly, if someone has a better idea to
do this replacement i will be very happy ;-)
Greetings...
Sandro
|
|
|
Re: want to write a macro plugin... please help [message #151290 is a reply to message #151265] |
Fri, 09 December 2005 22:53  |
Eclipse User |
|
|
|
> I want to write a macro plugin on top of the wst plugin.
> For example I have a file xyz.xml the content is:
> ... <macro name=3D"content"/> ...
>
> The editor should not display the macro tag but the content of this
> macro, that he will find in another file like:
> ... <content> process </content> ...
> instead of
> ... <macro name=3D"content"/> ...
>
> So the question is, where should I write the replacement from the macr=
o
> tag to the content.
> I thought about a contribution to the extension point:
> org.eclipse.ui.editors.documentProviders and extend my document provid=
er
> class from TextDocumentProvider.
> So if the documentprovider tries to connect with the ressource I will =
do
> the replacement. And if someone would save the document than I will
> replace the macro tag back...
>
And interesting problem. I am not aware of any particular approach that =
would
do what you want. (or ... help much with what you want) but ...
Are you locked into this design?
My intuition is you'd always get into 'trouble' doing some this sort of =
"replacemnt"
of source.
Have you considered more of a graphical or multipage editor ... so, for =
example, when the
<macro name=3D"content"/>
tag was clicked, or hot linked, that would then open another "file" (or =
tab, or sub-pane) to edit?
Sounds like a hard problem.
|
|
|
Powered by
FUDForum. Page generated in 0.27607 seconds