OutlineView Expanding nodes
"Thielmann, Marco" <[email protected]> Fri, 3 Nov 2017 13:46:06 +0000
| Newsgroups | gmane.comp.java.netbeans.modules.openide.devel |
|---|---|
| Message-ID | <[email protected]> |
--_000_729F4796E53CC14A92CE49B2830699E97E1CF9C5DERFW1EX00globa_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
I want to expand all nodes in an OutlineView, but so far my attempts failed=
.
I tried it using the code below, which I called in the constructor, right a=
fter I set the root context of the ExplorerManager:
private void expandAll() {
Node node =3D explorerManager.getRootContext();
((OutlineView) outlineView).expandNode(node);
}
public void expandAll(Node node) {
if (node =3D=3D null) {
return;
}
((OutlineView) outlineView).expandNode(node);
for (Node child : node.getChildren().getNodes(true)) {
expandAll(child);
}
}
I uploaded a minimal example to github:
https://github.com/mthOne/examples
Maybe someone can take a look at this and tell me, what I=B4m doing wrong h=
ere?
Thanks in advance,
Marco
Rovema GmbH
Industriestr. 1, 35463 Fernwald, Germany
Gesch=E4ftsf=FChrung:
Thomas Becker, Sprecher der Gesch=E4ftsf=FChrung
Ralf Buch
Handelsreg.-Eintrag: Amtsger. Gie=DFen, HRB 8551
--_000_729F4796E53CC14A92CE49B2830699E97E1CF9C5DERFW1EX00globa_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
<meta name=3D"Generator" content=3D"Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.E-MailFormatvorlage17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"DE" link=3D"blue" vlink=3D"purple">
<div class=3D"WordSection1">
<p class=3D"MsoNormal">Hi,<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">I want to expand all nodes in an OutlineView, but so=
far my attempts failed.<o:p></o:p></p>
<p class=3D"MsoNormal">I tried it using the code below, which I called in t=
he constructor, right after I set the root context of the ExplorerManager:<=
o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal"> private void expandAll() {<o:p></o:p></p>
<p class=3D"MsoNormal"> Node node=
=3D explorerManager.getRootContext();<o:p></o:p></p>
<p class=3D"MsoNormal"> ((Outline=
View) outlineView).expandNode(node);<o:p></o:p></p>
<p class=3D"MsoNormal"> }<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal"> public void expandAll(Node node) =
{<o:p></o:p></p>
<p class=3D"MsoNormal"> if (node =
=3D=3D null) {<o:p></o:p></p>
<p class=3D"MsoNormal"> &nbs=
p; return;<o:p></o:p></p>
<p class=3D"MsoNormal"> }<o:p></o=
:p></p>
<p class=3D"MsoNormal"> ((Outline=
View) outlineView).expandNode(node);<o:p></o:p></p>
<p class=3D"MsoNormal"> for (Node=
child : node.getChildren().getNodes(true)) {<o:p></o:p></p>
<p class=3D"MsoNormal"> &nbs=
p; expandAll(child);<o:p></o:p></p>
<p class=3D"MsoNormal"> }<o:p></o=
:p></p>
<p class=3D"MsoNormal"> }<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">I uploaded a minimal example to github:<o:p></o:p></=
p>
<p class=3D"MsoNormal"><a href=3D"https://github.com/mthOne/examples">https=
://github.com/mthOne/examples</a><o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">Maybe someone can take a look at this and tell me, w=
hat I=B4m doing wrong here?<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">Thanks in advance,<o:p></o:p></p>
<p class=3D"MsoNormal">Marco<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
</div>
<br>
<font size=3D"2" face=3D"Arial" color=3D"#000000">Rovema GmbH<br>
Industriestr. 1, 35463 Fernwald, Germany<br>
Gesch=E4ftsf=FChrung:<br>
Thomas Becker, Sprecher der Gesch=E4ftsf=FChrung<br>
Ralf Buch <br>
Handelsreg.-Eintrag: Amtsger. Gie=DFen, HRB 8551</font>
</body>
</html>
--_000_729F4796E53CC14A92CE49B2830699E97E1CF9C5DERFW1EX00globa_--