Skip to main content



      Home
Home » Language IDEs » ServerTools (WTP) » extending the wtp xml-editor
extending the wtp xml-editor [message #639722] Wed, 17 November 2010 10:18 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: extending the wtp xml-editor [message #639971 is a reply to message #639722] Thu, 18 November 2010 10:16 Go to previous messageGo to next message
Eclipse UserFriend
Luke,

I am not clear on what you are trying to do. But I *THINK* that 'foldingstrategy' extension is not what you need. And if it was I would strongly recommend against extending our internal XMLFoldingStrategy and stay with using the public API.

From what I can tell what you want to do is:

1. listen to events of when people close and open folding annotations
2. react to thous events by opening and closing other folding annotations

What I think you don't want to do is add any new folding annotations, which is what the 'foldingstrategy' extension is for.

Let me know if my assessment is correct and I maybe able to help you further.
Re: extending the wtp xml-editor [message #640641 is a reply to message #639971] Mon, 22 November 2010 11:46 Go to previous messageGo to next message
Eclipse UserFriend
Lukas,

I would suggest taking a look at org.eclipse.jface.text.source.AnnotationModel. It is the one keeping track of all of the folding annotations added by the SSE extensions and looks like it may have some listener hooks that you could use.

Blue Skies,

~Ian
Re: extending the wtp xml-editor [message #640864 is a reply to message #639971] Tue, 23 November 2010 06:26 Go to previous messageGo to next message
Eclipse UserFriend
Ian,

thanks for your help. I finally get notified when one or more ProjectionAnnotation were collapsed or expanded. The solution is to add a listener to the ProjectionAnnotationModel. The model offers a method to retrieve a modification stamp which contains all modified annotatios. But next question is how can i get further information about the xml-node related to this annotation. I can't see the connection between it!?
Re: extending the wtp xml-editor [message #640894 is a reply to message #640864] Tue, 23 November 2010 08:26 Go to previous message
Eclipse UserFriend
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
Previous Topic:quickasist/markerresolution triggered by clicking on the left side editor icon?
Next Topic:Trying to set multiple source folders in Java facet
Goto Forum:
  


Current Time: Fri Jul 04 01:21:52 EDT 2025

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

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

Back to the top