sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stefane...@apache.org
Subject svn commit: r1601849 - in /sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model: DirNode.java JcrNode.java
Date Wed, 11 Jun 2014 10:59:40 GMT
Author: stefanegli
Date: Wed Jun 11 10:59:40 2014
New Revision: 1601849

URL: http://svn.apache.org/r1601849
Log:
SLING-3656 related : nested nodes were not correctly showing up in the content browser

Modified:
    sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/DirNode.java
    sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/JcrNode.java

Modified: sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/DirNode.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/DirNode.java?rev=1601849&r1=1601848&r2=1601849&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/DirNode.java
(original)
+++ sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/DirNode.java
Wed Jun 11 10:59:40 2014
@@ -32,11 +32,16 @@ public class DirNode extends JcrNode {
 	private static String decode(String name) {
 		if (name.endsWith(".dir")) {
 			return name.substring(0, name.length()-4);
-		} else if (name.equals("_jcr_content")) {
-			return "jcr:content";
-		} else {
-			return null;
+		} else if (!name.startsWith("_")) {
+		    return null;
 		}
+		name = name.substring(1);
+		int pos = name.indexOf("_");
+		if (pos==-1) {
+		    return null;
+		}
+		name = name.substring(0, pos) + ":" + name.substring(pos+1);
+		return name;
 	}
 
 	static boolean isDirNode(IResource resource) {
@@ -137,4 +142,8 @@ public class DirNode extends JcrNode {
 	    return false;
 	}
 	
+	@Override
+	public String getLabel() {
+	    return getDecodedName();
+	}
 }

Modified: sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/JcrNode.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/JcrNode.java?rev=1601849&r1=1601848&r2=1601849&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/JcrNode.java
(original)
+++ sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/JcrNode.java
Wed Jun 11 10:59:40 2014
@@ -290,6 +290,18 @@ public class JcrNode implements IAdaptab
 				}
 			}
 		}
+		for (Iterator it = values.iterator(); it.hasNext();) {
+            JcrNode jcrNode = (JcrNode) it.next();
+            if (jcrNode instanceof DirNode) {
+                DirNode dirNode = (DirNode)jcrNode;
+                // DirNodes are candidates for hiding
+                JcrNode effectiveSibling = dirNode.getEffectiveSibling();
+                if (effectiveSibling!=null) {
+                    it.remove();
+                    continue;
+                }
+            }
+        }
 		
 		return values.toArray();
 	}



Mime
View raw message