Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarvin Mueller2013-06-25 03:06:15 -0400
committerMarvin Mueller2013-06-25 04:10:38 -0400
commit1761bf0594b7327d4b48ceeecb0ac31f9a7faa45 (patch)
tree73984f0a51e78b8bc565046f8b83c54897ba149f
parentcc06242f659a3d532a4f4a80e860d8df1844346d (diff)
downloadorg.eclipse.jubula.core-7.1.tar.gz
org.eclipse.jubula.core-7.1.tar.xz
org.eclipse.jubula.core-7.1.zip
Non-sprint task - fix for JTree is not expanded if childs are created dynamically7.1
-rw-r--r--org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/implclasses/tree/AbstractTreeOperationContext.java8
-rw-r--r--org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/implclasses/tree/ExpandCollapseTreeNodeOperation.java2
-rw-r--r--org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/tester/util/TreeOperationContext.java6
-rw-r--r--org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/tester/tree/TreeOperationContext.java10
4 files changed, 24 insertions, 2 deletions
diff --git a/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/implclasses/tree/AbstractTreeOperationContext.java b/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/implclasses/tree/AbstractTreeOperationContext.java
index 0ffc06951..35aa7e299 100644
--- a/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/implclasses/tree/AbstractTreeOperationContext.java
+++ b/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/implclasses/tree/AbstractTreeOperationContext.java
@@ -200,7 +200,13 @@ public abstract class AbstractTreeOperationContext {
* of graphical root nodes if <code>parent == null</code>.
*/
public abstract int getNumberOfChildren(Object parent);
-
+
+ /**
+ * @param node the node to check
+ * @return true if the node is a leaf
+ */
+ public abstract boolean isLeaf(Object node);
+
/**
*
* @param parent The parent node. Can be <code>null</code>.
diff --git a/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/implclasses/tree/ExpandCollapseTreeNodeOperation.java b/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/implclasses/tree/ExpandCollapseTreeNodeOperation.java
index 5ac8e9638..eed28bb92 100644
--- a/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/implclasses/tree/ExpandCollapseTreeNodeOperation.java
+++ b/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/implclasses/tree/ExpandCollapseTreeNodeOperation.java
@@ -43,7 +43,7 @@ public class ExpandCollapseTreeNodeOperation
final AbstractTreeOperationContext context = getContext();
// only try to expand/collapse the node if it's not a leaf
// this otherwise causes issues like #399042
- if (context.getNumberOfChildren(treeNode) > 0) {
+ if (!context.isLeaf(treeNode)) {
if (isCollapse()) {
context.collapseNode(treeNode);
} else {
diff --git a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/tester/util/TreeOperationContext.java b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/tester/util/TreeOperationContext.java
index e57b5184b..7c6256d83 100644
--- a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/tester/util/TreeOperationContext.java
+++ b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/tester/util/TreeOperationContext.java
@@ -537,5 +537,11 @@ public class TreeOperationContext extends AbstractTreeOperationContext {
return -1;
}
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isLeaf(Object node) {
+ return m_model.isLeaf(node);
+ }
} \ No newline at end of file
diff --git a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/tester/tree/TreeOperationContext.java b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/tester/tree/TreeOperationContext.java
index fad033f11..917d343e7 100644
--- a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/tester/tree/TreeOperationContext.java
+++ b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/tester/tree/TreeOperationContext.java
@@ -588,4 +588,14 @@ public class TreeOperationContext extends AbstractTreeOperationContext {
return -1;
}
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isLeaf(Object node) {
+ if (getNumberOfChildren(node) == 0) {
+ return true;
+ }
+ return false;
+ }
+
} \ No newline at end of file

Back to the top