A plugin backed by XML [message #286127] |
Thu, 02 June 2005 20:03  |
Eclipse User |
|
|
|
Originally posted by: craig.haenterprises.com.au
I currently have code (an application) that reads an XML file and
generates java classes. However, the XML file can get quite large and
cumbersome, so I would like to write an eclipse GUI plugin that lets you
manage the file through GUI controls - much like the GUI that lets you
manage a plugin's feature.xml file (ie. with one or more GUI tabs and an
XML source tab).
However, I must admit that I am confused about how I should model it
internally. Do most people keep a DOM tree (or some other internal
representation of the XML) and update that when the user changes something
on the GUI? If so, does that imply that the contents of the Source panel
gets regenerated from the internal representation every time the user
switches back to it? What about if the user changes the XML directly; at
what point do I refresh the internal representation and/or the GUI
controls?
Sorry for the barrage of questions... I have searched around on the web
looking for a simple example, but couldn't find anything. Any advice or
pointers to existing articles would be very much appreciated. Many thanks.
Cheers,
Craig
|
|
|
|
Re: A plugin backed by XML [message #286143 is a reply to message #286142] |
Fri, 03 June 2005 01:20  |
Eclipse User |
|
|
|
Steve Blass wrote:
> Craig Edwards wrote:
>
>> I currently have code (an application) that reads an XML file and
>> generates java classes. However, the XML file can get quite large and
>> cumbersome, so I would like to write an eclipse GUI plugin that lets
>> you manage the file through GUI controls - much like the GUI that lets
>> you manage a plugin's feature.xml file (ie. with one or more GUI tabs
>> and an XML source tab).
>>
>> However, I must admit that I am confused about how I should model it
>> internally. Do most people keep a DOM tree (or some other internal
>> representation of the XML) and update that when the user changes
>> something on the GUI? If so, does that imply that the contents of the
>> Source panel gets regenerated from the internal representation every
>> time the user switches back to it? What about if the user changes the
>> XML directly; at what point do I refresh the internal representation
>> and/or the GUI controls?
>> Sorry for the barrage of questions... I have searched around on the
>> web looking for a simple example, but couldn't find anything. Any
>> advice or pointers to existing articles would be very much
>> appreciated. Many thanks.
>>
>> Cheers,
>> Craig
>>
>>
>>
>
> Have you looked at the EMF project? EMF is real useful for modeling
> models internally in Eclipse. Much heavy lifting around refresh and
> undo has already been done there and I think it is behind the
> implementation of the manifest editors, like that for feature.xml, in
> Eclipse itself.
>
> -
> Steve
.... but I could be wrong. This was in another thread here today:
unknown wrote:
>.so JDT ,PDE needn't EMF ?
>
no, neither JDT nor PDE require EMF
/adam
-
Steve
|
|
|
Powered by
FUDForum. Page generated in 0.03748 seconds