1297 |
// Don't expand if last path component is a leaf node. |
// Don't expand if last path component is a leaf node. |
1298 |
if ((path == null) || (treeModel.isLeaf(path.getLastPathComponent()))) |
if ((path == null) || (treeModel.isLeaf(path.getLastPathComponent()))) |
1299 |
return; |
return; |
1300 |
|
|
1301 |
setExpandedState(path, true); |
setExpandedState(path, true); |
1302 |
} |
} |
1303 |
|
|
1503 |
return null; |
return null; |
1504 |
} |
} |
1505 |
|
|
|
private void checkExpandParents(TreePath path) throws ExpandVetoException |
|
|
{ |
|
|
|
|
|
TreePath parent = path.getParentPath(); |
|
|
|
|
|
if (parent != null) |
|
|
checkExpandParents(parent); |
|
|
|
|
|
fireTreeWillExpand(path); |
|
|
} |
|
|
|
|
1506 |
private void doExpandParents(TreePath path, boolean state) |
private void doExpandParents(TreePath path, boolean state) |
1507 |
{ |
{ |
1508 |
TreePath parent = path.getParentPath(); |
TreePath parent = path.getParentPath(); |
|
|
|
1509 |
if (isExpanded(parent)) |
if (isExpanded(parent)) |
1510 |
{ |
{ |
1511 |
nodeStates.put(path, state ? EXPANDED : COLLAPSED); |
nodeStates.put(path, state ? EXPANDED : COLLAPSED); |
1525 |
|
|
1526 |
TreePath parent = path.getParentPath(); |
TreePath parent = path.getParentPath(); |
1527 |
|
|
|
try |
|
|
{ |
|
|
if (parent != null) |
|
|
checkExpandParents(parent); |
|
|
} |
|
|
catch (ExpandVetoException e) |
|
|
{ |
|
|
// Expansion vetoed. |
|
|
return; |
|
|
} |
|
|
|
|
1528 |
doExpandParents(path, state); |
doExpandParents(path, state); |
1529 |
} |
} |
1530 |
|
|