Specific rules in the folding/unfolding action (author mode)

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Vincent
Posts: 52
Joined: Thu Dec 15, 2011 7:56 pm

Specific rules in the folding/unfolding action (author mode)

Post by Vincent »

Hi,


Concerning folding elements, you provide those actions :
  • Close Other Folds (Ctrl+NumPad+/) - Folds all the elements except the current element.
  • Collapse Child Folds (Ctrl+Decimal) - Folds the elements indented with one level inside the current element.
  • Expand Child Folds (Ctrl+Equals)- Unfolds all child elements of the currently selected element.
  • Expand All (Ctrl+NumPad+*) - Unfolds all elements in the current document.
  • Toggle Fold - Toggles the state of the current fold.

Can we create (with a plugin for example) such actions with specific behavior ?



For example,

I have an XML tree like :

Code: Select all


<root>
<part1>
<elementA>text</elementA>
<elementB>text</elementB>
<elementC>text</elementC>
<elementD>text</elementD>
</part1>
<part2>
<elementA>text</elementA>
<elementB>text</elementB>
<elementC>text</elementC>
<elementD>text</elementD>
</part2>
</root>
What can I do for creating a button that folds/unfolds all the elements A and D (in author mode).
(The rules concerning the folding/unfolding can be tricky, the key is to be able to control your unfolding action)


Thank you,


Vincent.
Radu
Posts: 9448
Joined: Fri Jul 09, 2004 5:18 pm

Re: Specific rules in the folding/unfolding action (author mode)

Post by Radu »

Hi Vincent,

Could you elaborate a little bit on the use case? It would help me to see the bug picture.
From what I understand you have already declared in the CSS that the elementA and elementD tags are foldable.
You just need a way to fold/unfold nodes using our API instead of having the user click the fold icons, right?
We do not yet have API to fold/unfold specific elements. Should we try to add the API to fold/unfold a specific AuthorNode?
How about if you try to hide the node completely using the CSS "display:none" property?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Vincent
Posts: 52
Joined: Thu Dec 15, 2011 7:56 pm

Re: Specific rules in the folding/unfolding action (author mode)

Post by Vincent »

Radu, Thank you for your answer.


We are aware that this is not so simple and we understand that it's not yet in the API. That's why, for this point, we are going to try to adapt our process with your existing functionality.
Having this feature would have brought more freedom, but it may be fine with another approach.



I'll let you know.


Vincent.
Radu
Posts: 9448
Joined: Fri Jul 09, 2004 5:18 pm

Re: Specific rules in the folding/unfolding action (author mode)

Post by Radu »

Hello Vincent,

We will try to add API for folding/unfolding elements and I'll update this thread when this happens.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply