| extending the wtp xml-editor [message #639722] |
Wed, 17 November 2010 10:18  |
Luke Missing name Messages: 5 Registered: October 2010 |
Junior Member |
|
|
Hey,
I would like to add something like a listener to a projection annotation,
which will be notified when a folding will be extended. In dependence of the
information in this node which was expanded I would like to expand several
other nodes. All in all the extension should do a context related expansion
of folding elements.
My first idea was this extension where I was able to add my own folding
strategy. But I dont know how to go further....any ideas?
<extension point="org.eclipse.wst.sse.ui.editorConfiguration">
<provisionalConfiguration
type="foldingstrategy"
class="...TestspecFoldingStrategy"
target="mytarget" />
</extension>
Thanks
Lukas
|
|
|
| Re: extending the wtp xml-editor [message #639860 is a reply to message #639722] |
Thu, 18 November 2010 02:56   |
Sarika Sinha Messages: 38 Registered: February 2010 Location: Bangalore, India |
Member |
|
|
Hi,
Yes you can use this extemsion pt to extend folding strategy. Your new class can extend org.eclipse.wst.xml.ui.internal.projection.XMLFoldingStrateg y and do the additional work.
Sarika Sinha
WTP Programmer
Source Editing
|
|
|
|
|
|
| Re: extending the wtp xml-editor [message #640894 is a reply to message #640864] |
Tue, 23 November 2010 08:26  |
 |
Ian Tewksbury Messages: 48 Registered: July 2009 Location: RTP, NC, USA |
Member |
|
|
Luke,
I am not sure what information you get from the ProjectionAnnotationModel but you probably want to get your hands on the IStructuredDocument or maybe the IStructuredModel for the file with the annoation and then you can use the offsets of the annoation to get the information for the region being folded from either the document or the model depending on which has the exact info you are looking for. You can use the org.eclipse.wst.sse.core.StructuredModelManager to get the document (if you don't already have it) or the Model.
Blue Skies,
~Ian
Ian Tewksbury
WTP JavaScript Tools
IBM Rational
-----
“When once you have tasted flight, you will forever walk the earth with your eyes turned skyward, for there you have been, and there you will always long to return.” ~Leonardo da Vinci
|
|
|
Powered by
FUDForum. Page generated in 0.01795 seconds