Using XML Editor in my plugin - is there some clean way ? [message #125344] |
Sun, 24 July 2005 19:49  |
Eclipse User |
|
|
|
hi !
Im trying to find a way to use web tools xml source editor in my
plugin... I searched this forum and docs but I didn't find what I need
or I overlooked it :)
It's quite simple: Im working on my plugin suite that is used for some
special tasks regarding editing of our format of deploy files... Our
plugin implements visual editing and generating source for lazy users
who dont want edit source directly... BUT: under this layer these
deploy files are simply xml files and there is need to have the
possibility to edit them directly in "source mode"...
Till now we used XMLEditor class from solareclipse suite but
solareclipse seems dead and there are bugs when used in eclipse 3.x so
Im trying to replace it by xml editor from webtools - webtools seems
like great and rapidly improving tools package being developed as part
of eclipse project. I dont wanna extend it by adding features, I only
want to use it as one page in our multi-page editor...
I succesfully used XMLMultiPageEditorPart, now Im able to edit our xml
files but I have some questions:
1. is there some clean way ? Now Im using directly mentioned class from
internal package, but my experience tells me that it's not best idea -
some time ago I was migrating our plugins to compile it under Eclipse
3.0 and 3.1 and this was real nightmare - developers who originally
implemented our plugin used classes from internal packages wildly and
you can imagine what refactoring of such code was - internal
implementation is not documented and the code was also completely
undocumented :))
2. is there way to enable syntax highlighting in my code for our files
? These files have not *.xml extension and I cant add these extensions
to XML Content Type in eclipse preferences because I need these
extensions associated with our plugin. I was not diging much in source
code but I found some methods in StructuredTextEditor connected with
StructuredTextViewerConfiguration class - is this the place for some
info ?
Thanks for any answer and sorry for long boring post :)
|
|
|
|
|
|
|
|
|
Re: Using XML Editor in my plugin - is there some clean way ? [message #127407 is a reply to message #127011] |
Fri, 29 July 2005 10:55  |
Eclipse User |
|
|
|
Originally posted by: news.brkerez.cz
hi,
Amy Wu wrote:
> When you need to call getDocumentProvider, what you can do is call
> getAdapter(ITextEditor.class) and that should return an ITextEditor back to
> you. There is a getDocumentProvider() method on that interface.
thanks I'll try it when there will be some free time...
> StructuredTextEditorXML is the XML Source Page editor. It is just 1 single
> page editor. The XMLMultiPageEditor contains a design and source page. The
> source page it contains is StructuredTextEditorXML.
Im dumb :) This was of course the first thing that I was thinking about,
names of classes are pretty self-explanatory... Then I tried it (replacing
XMLMultiPageEditorPart by StructuredTextEditorXML), but (hell knows why) I
was surprised because I had still design page when I opened my deploy file
so I was confused and asking here... Now I tried it again and of course
there is source page only :) I dont know what I was doing before, maybee
I didnt compile or run it right, hell knows :) Thanks anyway
> Hope this helps.
sure, any answers are welcome...
|
|
|
Powered by
FUDForum. Page generated in 0.04950 seconds