Revision: 3136
          http://vexi.svn.sourceforge.net/vexi/?rev=3136&view=rev
Author:   mkpg2
Date:     2008-10-19 00:47:31 +0000 (Sun, 19 Oct 2008)

Log Message:
-----------
Fixes.
  - parse ' ' style strings
  - flattened packages in explorer only when they contain template files

Modified Paths:
--------------
    trunk/tools/org.vexi.vexidev/plugin.xml
    trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/editor/VSScanner.java
    
trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/editor/VexiDocumentProvider.java
    
trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/navigator/VexiModelProvider.java

Modified: trunk/tools/org.vexi.vexidev/plugin.xml
===================================================================
--- trunk/tools/org.vexi.vexidev/plugin.xml     2008-10-18 23:17:14 UTC (rev 
3135)
+++ trunk/tools/org.vexi.vexidev/plugin.xml     2008-10-19 00:47:31 UTC (rev 
3136)
@@ -281,7 +281,7 @@
            <!-- disabling link with as it does not work!! -->
            <property
                  name="org.eclipse.ui.navigator.hideLinkWithEditorAction"
-                 value="false">
+                 value="true">
            </property>
         </options>
     </viewer>

Modified: 
trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/editor/VSScanner.java
===================================================================
--- trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/editor/VSScanner.java     
2008-10-18 23:17:14 UTC (rev 3135)
+++ trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/editor/VSScanner.java     
2008-10-19 00:47:31 UTC (rev 3136)
@@ -56,7 +56,7 @@
                rules.add(wordRule);
                rules.add(new WordRule(new NumberDetector(), numberToken));
                rules.add(new SingleLineRule("\"", "\"", stringToken));
-           
+               rules.add(new SingleLineRule("'", "'", stringToken));
                
                setRules(rules.toArray(new IRule[rules.size()]));
        }

Modified: 
trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/editor/VexiDocumentProvider.java
===================================================================
--- 
trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/editor/VexiDocumentProvider.java
  2008-10-18 23:17:14 UTC (rev 3135)
+++ 
trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/editor/VexiDocumentProvider.java
  2008-10-19 00:47:31 UTC (rev 3136)
@@ -17,8 +17,8 @@
                addVexiParitioner(document);
                
                // Also adds Vexi nature to the project.
-               // The reason this is done here is because I want to assign 
python
-               // nature automatically to any project that has active python 
files.
+               // The reason this is done here is because we want to assign 
vexi
+               // nature automatically to any project that has active vexi 
files.
                if (element instanceof FileEditorInput) {
                        IFile file = 
(IFile)((FileEditorInput)element).getAdapter(IFile.class);
                        if (file != null){

Modified: 
trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/navigator/VexiModelProvider.java
===================================================================
--- 
trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/navigator/VexiModelProvider.java
  2008-10-18 23:17:14 UTC (rev 3135)
+++ 
trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/navigator/VexiModelProvider.java
  2008-10-19 00:47:31 UTC (rev 3136)
@@ -168,7 +168,7 @@
        
        private void getPackages(IVexiResource container, Collection packages, 
VexiSourceFolder srcFolder){
                Object[] children = 
super.getChildren(container.getActualObject());
-               boolean hasFiles = children.length==0;
+               boolean hasFiles = false;
                
                for(Object o: children){
                        if(o instanceof IFolder){
@@ -177,7 +177,11 @@
                                VexiPackage pAckage = getVexiPackage(container, 
ifolder, srcFolder);
                                getPackages(pAckage, packages, srcFolder);
                        }else{
-                               hasFiles = true;
+                               if(o instanceof IFile){
+                                       if(((IFile)o).getName().endsWith(".t")){
+                                               hasFiles = true;
+                                       }
+                               }
                        }
                }
                
@@ -186,6 +190,25 @@
                }
        }
        
+       private boolean isPackage(IFolder container){
+               Object[] children = super.getChildren(container);
+               
+               for(Object o: children){
+                       if(o instanceof IFolder){
+                               IFolder ifolder = (IFolder)o;
+                               if(ifolder.getName().startsWith(".")) continue;
+                               if(isPackage(ifolder)) return true;
+                       }else{
+                               if(o instanceof IFile){
+                                       if(((IFile)o).getName().endsWith(".t")){
+                                               return true;
+                                       }
+                               }
+                       }
+               }
+               return false;
+       }
+       
        @Override
        public Object getParent(Object element) {
                if(element instanceof IVexiResource){
@@ -213,14 +236,15 @@
                                // add files, if there are any in the 'default 
package'
                                Object[] cs = 
super.getChildren(((IVexiResource)element).getActualObject());
                                for(Object o: cs){
-                                       if(o instanceof IFile) r.add(o);
+                                       if(o instanceof IFolder && 
isPackage((IFolder)o)) continue;
+                                       r.add(o);
                                }
                                return r.toArray();
                        } else if(element instanceof VexiPackage){
                                Object[] os = 
super.getChildren(((IVexiResource)element).getActualObject());
                                List r = new LinkedList();
                                for(Object o: os){
-                                       if(o instanceof IFolder) continue;
+                                       if(o instanceof IFolder && 
isPackage((IFolder)o)) continue;
                                        r.add(o);
                                }
                                return r.toArray();


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to