]> source.dussan.org Git - aspectj.git/commitdiff
Added new Granularity, DECLARED_ELEMENTS, and
authoracolyer <acolyer>
Wed, 26 Feb 2003 16:18:01 +0000 (16:18 +0000)
committeracolyer <acolyer>
Wed, 26 Feb 2003 16:18:01 +0000 (16:18 +0000)
new rule to acceptGranularity

ajde/src/org/aspectj/ajde/ui/StructureViewProperties.java
ajde/src/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java

index 1fa0c00b82f2bebd388e15c247c23f268641f4eb..230108d62aad2254a2b08fd293c62bc6e9a1e402 100644 (file)
@@ -236,7 +236,8 @@ public class StructureViewProperties {
                public static final Granularity FILE = new Granularity("file");
                public static final Granularity TYPE = new Granularity("type");
                public static final Granularity MEMBER = new Granularity("member");
-               public static final Granularity[] ALL = { PACKAGE, FILE, TYPE, MEMBER };
+               public static final Granularity DECLARED_ELEMENTS = new Granularity("declared body elements");
+               public static final Granularity[] ALL = { PACKAGE, FILE, TYPE, MEMBER, DECLARED_ELEMENTS };
                
                private final String name;
                
index 41a9a0bdc7e0ece06263bca5991706ed82227432..5d43089510ebcc720c68d873e16d8c75b34cc2ff 100644 (file)
@@ -150,9 +150,11 @@ public class TreeStructureViewBuilder {
        }
        
        private boolean acceptGranularity(ProgramElementNode.Kind kind, StructureViewProperties.Granularity granularity) {
-               if (kind == ProgramElementNode.Kind.CODE) return false;
-
-               if (granularity == StructureViewProperties.Granularity.MEMBER) {
+               
+               if (granularity == StructureViewProperties.Granularity.DECLARED_ELEMENTS) {
+                       return true;
+               } else if (granularity == StructureViewProperties.Granularity.MEMBER && 
+                       (kind == ProgramElementNode.Kind.CODE)) {
                        return true;
                } else if (granularity == StructureViewProperties.Granularity.TYPE
                        && (kind == ProgramElementNode.Kind.PROJECT