How to link multipage editor to source code file? [message #329143] |
Fri, 13 June 2008 17:15 |
Eclipse User |
|
|
|
Originally posted by: tchurch+eclipse.nullring.com
[Reposting from eclipse.newcomer group since this is forms related]
I am trying to develop a simple multipage editor that has 2 pages. The
first page is an eclipse form with a couple input fields, and the second
page is the source xml file. I am able to create both pages, but I am
missing a fundamental concept - how do I link the form page to the source
xml file? In other words, how can I have the input on the form page
automatically update the related field in the xml file when it is edited?
Does anyone have a simple example of how this works?
I have searched through the newsgroup and read through the help, but this
has not been clear to me. I have tried to trace through the code for the
Plugin Manifest Editor but have been unable to follow it.
My assumption is that I need some sort of listener on the input field,
probably a ModifyListener, which will open the xml file, parse it for the
correct field, update the field, and then refresh the source page. Is
this the correct approach?
|
|
|
Re: How to link multipage editor to source code file? [message #329163 is a reply to message #329143] |
Mon, 16 June 2008 09:36 |
Eclipse User |
|
|
|
Originally posted by: bangyi.nfs-china.com
Tim Church wrote:
> [Reposting from eclipse.newcomer group since this is forms related]
>
> I am trying to develop a simple multipage editor that has 2 pages. The
> first page is an eclipse form with a couple input fields, and the second
> page is the source xml file. I am able to create both pages, but I am
> missing a fundamental concept - how do I link the form page to the
> source xml file? In other words, how can I have the input on the form
> page automatically update the related field in the xml file when it is
> edited?
> Does anyone have a simple example of how this works?
>
> I have searched through the newsgroup and read through the help, but
> this has not been clear to me. I have tried to trace through the code
> for the Plugin Manifest Editor but have been unable to follow it.
> My assumption is that I need some sort of listener on the input field,
> probably a ModifyListener, which will open the xml file, parse it for
> the correct field, update the field, and then refresh the source page.
> Is this the correct approach?
>
hi, tim, you can analyze the source code of WST XML editor , which is a
two-page editor.
1 Record the line nubmer of every xml element when resolving XML file.
2 Every UI widget you constructed need contain a property whose value is
line number for according xml element.
you can do it like this :
widget.setData("StartLineNumber",elementLineMap.get(element));
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04618 seconds