Insert Fragment depending of the XML tree
Posted: Wed Jan 25, 2012 8:10 pm
Hi,
That's it, Eclipse is loaded with the sdk and I'm ready to develop !
I use the operation :
ro.sync.ecss.extensions.commons.operations.InsertFragmentOperation
To insert an XML fragment.
The point is, I have different cases depending the place of the caret in the XML tree.
Example :
Is the operation the good one in this case ?
How can I get the position of my caret in the java class ?
Thank you for your help.
Vincent.
That's it, Eclipse is loaded with the sdk and I'm ready to develop !

I use the operation :
ro.sync.ecss.extensions.commons.operations.InsertFragmentOperation
To insert an XML fragment.
The point is, I have different cases depending the place of the caret in the XML tree.
Example :
Code: Select all
<level1>
<level2>
<level3><my_fragment /></level3>
</level2>
</level1>
- If my caret has a level3 element as parent, I want my_fragment to be inserted inside the current level3.
- If my caret has a level2 element as parent, I want to create a level3 element (as a last child of the current level2) and insert my_fragment in it.
- If my caret has a level1 element as parent, I want to create a level2 element (as a last child of the current level1) with a level3 inside and I want to insert my_fragment in this level3.
Is the operation the good one in this case ?
How can I get the position of my caret in the java class ?
Thank you for your help.
Vincent.