Setting collapsible node display text from AstNode

SyntaxEditor for Windows Forms Forum

Posted 17 years ago by Kelly Leahy - Software Architect, Milliman
Version: 4.0.0244
Avatar
I'm using ICollapsible implementation on one of my AstNode-derived classes so that I can use automatic collapsing. However, I can't figure out how to set the display text I want the collapsed text to display (in the "grey box"). Is this possible to expose this value from the AstNode or do I have to do something more complex?

Kelly Leahy Software Architect Milliman, USA

Comments (4)

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Kelly,

You set it in the language class. Check out the documentation's "SyntaxEditor Language Definition Guide / Automatic Outlining" topic. It's described as the last item in there.


Actipro Software Support

Posted 17 years ago by Kelly Leahy - Software Architect, Milliman
Avatar
Ok... I'm closer now.

I see that I need to override SetOutliningNodeCollapsedText in the language.

However, is there any easy way to figure out which AstNode I'm collapsing? I don't see any easy way to do this rather than searching the AST itself to find the item. I would think the outlining parser already knows the node it's working on doesn't it? Is there any way for me to ask it which node the OutliningNode refers to?

I understand that an OutliningNode may not associate with an AstNode, in the case when the outlining node is added manually to the Outlining property, but in the case where it's added by the automatic outliner, can we have a property for the AstNode that gave rise to that outlining node? You could even make it store the ICollapsibleNode instead of the IAstNode if you deem that more flexible. Just some way to get back to the node would be nice...

Thanks

Kelly Leahy Software Architect Milliman, USA

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Kelly,

In the .NET Languages Add-on we store the AST node in the outlining node's ParseData property. So you can check that property. It should be filled in if you are using the CollapsibleNodeOutliningParser.


Actipro Software Support

Posted 17 years ago by Kelly Leahy - Software Architect, Milliman
Avatar
Thanks! That's exactly what I was looking for...

Kelly Leahy Software Architect Milliman, USA

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.