Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » create IDOMElement
create IDOMElement [message #481518] Fri, 21 August 2009 11:09 Go to next message
Siarhei Navatski is currently offline Siarhei NavatskiFriend
Messages: 14
Registered: July 2009
Junior Member
Hi, I have next question

There are two Editors in MultipageEditor. First editor is SSE xml
editor. Second editor is visual editor which use structured model
(IDOMModel) common for both editors.
In the visual editor I want to create a new element which correspond
with IDOMElement. I do so:

IDOMElement newElement =
((IDOMDocument)getDocument()).createElement("elementName");
((IDOMElement)getParent()).appendChild(newElement);

It's ok - document contains new element, BUT STRUCTURED DOCUMENT REGIONS
of new element ISN'T INITIALIZED. How I can set them right?

thanks
Re: create IDOMElement [message #481601 is a reply to message #481518] Fri, 21 August 2009 17:35 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4430
Registered: July 2009
Senior Member

Navatski Siarhei wrote:
> There are two Editors in MultipageEditor. First editor is SSE xml
> editor. Second editor is visual editor which use structured model
> (IDOMModel) common for both editors.
> In the visual editor I want to create a new element which correspond
> with IDOMElement. I do so:
>
> IDOMElement newElement =
> ((IDOMDocument)getDocument()).createElement("elementName");
> ((IDOMElement)getParent()).appendChild(newElement);
>
> It's ok - document contains new element, BUT STRUCTURED DOCUMENT REGIONS
> of new element ISN'T INITIALIZED. How I can set them right?
>
> thanks

Is getParent() already part of the DOM Document in your example?

--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: create IDOMElement [message #482549 is a reply to message #481518] Thu, 27 August 2009 01:21 Go to previous message
David Williams is currently offline David WilliamsFriend
Messages: 176
Registered: July 2009
Senior Member
Navatski Siarhei wrote:
> ...
> It's ok - document contains new element, BUT STRUCTURED DOCUMENT
> REGIONS of new element ISN'T INITIALIZED. How I can set them right?
> ...
Just a guess ... I wonder if you _really_ have a common model? A single
instance that a single instance of a common, shared IDocument? You can
have two editors with different instances of IDocument that "stay in
sync" based on the way file buffers work ... but that's not the same as
a common DOM Model. You might put in some printlns to get the objects'
hashcodes to confirm they are the same instance. And/or, you might write
a tiny test, independent of editors, to see if the DOM code works as you
expect.
Previous Topic:How To Open Bundle Entry In Browser
Next Topic:Glassfish Publishing Issue
Goto Forum:
  


Current Time: Fri Mar 29 08:56:33 GMT 2024

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

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

Back to the top