Skip to content
Snippets Groups Projects
Commit 14fd0c91 authored by Gwenaelle ABEILLE's avatar Gwenaelle ABEILLE
Browse files

Merge branch 'TANGOARCH-729' into 'master'

TANGOARCH-729

See merge request !1
parents ba6ac644 6e193c01
Branches
No related tags found
1 merge request!1TANGOARCH-729
/target/
.project
.classpath
.settings
......@@ -59,17 +59,17 @@ public class AttributesTree extends BensikinTree {
/**
* Standard tree building from a model, plus sets the following options:
* -setExpandsSelectedPaths ( true ) -->expands selected paths
* -setScrollsOnExpand ( true ) -->scrolls if necessary on expansion
* -setShowsRootHandles ( true ) --> shows the root handle even if empty
* -setToggleClickCount ( 1 ) -->one click tree expansion/collapse
* <ul>
* <li><code>setExpandsSelectedPaths(true)</code> --> expands selected paths</li>
* <li><code>setScrollsOnExpand(true)</code> --> scrolls if necessary on expansion</li>
* <li><code>setShowsRootHandles(true)</code> --> shows the root handle even if empty</li>
* <li><code>setToggleClickCount(1)</code> --> one click tree expansion/collapse</li>
* </ul>
*
* @param newModel
* The model
* @param newModel The model
*/
protected AttributesTree(TreeModel newModel) {
super(newModel);
this.setExpandsSelectedPaths(true);
this.setScrollsOnExpand(true);
this.setShowsRootHandles(true);
......@@ -78,22 +78,18 @@ public class AttributesTree extends BensikinTree {
}
/**
* Returns a list of all the tree attributes that are under a currently
* selected node. Warning, since attributes trees are only loaded up to
* member level until each member is clicked, the list will be empty if no
* member's attributes list has been loaded yet.
* Returns a list of all the tree attributes that are under a currently selected node. Warning, since attributes
* trees are only loaded up to member level until each member is clicked, the list will be empty if no member's
* attributes list has been loaded yet.
*
* @param remove
* If true, removes each of the found nodes from the tree
* @return A List containing TreePath objects, each representing the path to
* one of the attributes under one of the selected nodes.
* @param remove If true, removes each of the found nodes from the tree
* @return A List containing TreePath objects, each representing the path to one of the attributes under one of the
* selected nodes.
*/
public List<TreePath> getListOfAttributesTreePathUnderSelectedNodes(boolean remove) {
List<TreePath> attributes = new ArrayList<>();
TreePath[] selectedPath = this.getSelectionPaths();
if (selectedPath == null || selectedPath.length == 0) {
return null;
}
List<TreePath> attributes = new ArrayList<TreePath>();
if ((selectedPath != null) && (selectedPath.length > 0)) {
// as many loops as there are selected nodes
for (int i = 0; i < selectedPath.length; i++) {
TreePath currentSelectedTreePath = selectedPath[i];
......@@ -114,6 +110,7 @@ public class AttributesTree extends BensikinTree {
currentSelectedNode.removeFromParent();
}
}
}
return attributes;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment