Revision: 3140
          http://vexi.svn.sourceforge.net/vexi/?rev=3140&view=rev
Author:   mkpg2
Date:     2008-10-26 02:17:26 +0000 (Sun, 26 Oct 2008)

Log Message:
-----------
Fix. Editor linking.
Feature. Added text field for specifying vm arguments in the launcher.

Modified Paths:
--------------
    trunk/tools/org.vexi.vexidev/plugin.xml
    trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/IConstants.java
    
trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/debug/VexiRunnerConfig.java
    trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/debug/ui/LaunchTab.java
    
trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/debug/ui/VexiLaunchConfigDelegate.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-25 04:16:14 UTC (rev 
3139)
+++ trunk/tools/org.vexi.vexidev/plugin.xml     2008-10-26 02:17:26 UTC (rev 
3140)
@@ -281,7 +281,7 @@
            <!-- disabling link with as it does not work!! -->
            <property
                  name="org.eclipse.ui.navigator.hideLinkWithEditorAction"
-                 value="true">
+                 value="false">
            </property>
         </options>
     </viewer>
@@ -290,6 +290,7 @@
             <contentExtension 
pattern="org.eclipse.ui.navigator.resourceContent"/>
             <contentExtension 
pattern="org.vexi.vexidev.navigator.vexicontent"/>
             <contentExtension pattern="org.vexi.vexidev.navigator.filters.*"/>
+            <contentExtension 
pattern="org.eclipse.ui.navigator.resources.linkHelper"/>
         </includes>
     </viewerContentBinding>
     <viewerActionBinding viewerId="org.vexi.vexidev.explorer">

Modified: trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/IConstants.java
===================================================================
--- trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/IConstants.java   
2008-10-25 04:16:14 UTC (rev 3139)
+++ trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/IConstants.java   
2008-10-26 02:17:26 UTC (rev 3140)
@@ -19,6 +19,7 @@
        // LAUNCH CONFIG PROPERTIES
        public static final String P_LAUNCH_PROJ =         
"vexidev.P_LAUNCH_PROJ";     
        public static final String P_LAUNCH_ARGS =         
"vexidev.P_LAUNCH_ARGS";     
+       public static final String P_LAUNCH_VMARGS =       
"vexidev.P_LAUNCH_VMARGS";   
        public static final String P_LAUNCH_MAINTEMPLATE = 
"vexidev.P_LAUNCH_MAINTEMPLATE";
        public static final String P_LAUNCH_PATH =         
"vexidev.P_LAUNCH_PATH";
        

Modified: 
trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/debug/VexiRunnerConfig.java
===================================================================
--- 
trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/debug/VexiRunnerConfig.java   
    2008-10-25 04:16:14 UTC (rev 3139)
+++ 
trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/debug/VexiRunnerConfig.java   
    2008-10-26 02:17:26 UTC (rev 3140)
@@ -36,14 +36,17 @@
        public String[] cmdLine;
 
        
-       static public String[] constructCommand(String binaryFile, String 
argString, String path, String mainTemplate){
+       static public String[] constructCommand(String binaryFile, String 
vmArgString, String argString, String path, String mainTemplate){
                
+               String[] vmargs = vmArgString.split("\\s+");
                String[] args1 = argString.split("\\s+");
                String[] args2 =  arrayFromPathAttr(path);
                List<String> cmdLine = new LinkedList<String>();
                //String[] cmdLine = new String[4+ args1.length + args2.length 
+ 1];
                cmdLine.add("java");
                cmdLine.add("-Djava.awt.headless=false");
+               for(String s: vmargs)
+                       cmdLine.add(s);    
                cmdLine.add("-jar");
                cmdLine.add(binaryFile);
                if(mainTemplate.trim().length()>0){
@@ -69,10 +72,11 @@
                                                        "No vexi binary 
specified"));
                String path = conf.getAttribute(P_LAUNCH_PATH,(String)null);  
                String argString = 
conf.getAttribute(P_LAUNCH_ARGS,(String)null);
+               String vmArgString = conf.getAttribute(P_LAUNCH_VMARGS, 
(String)null);
                argString = argString==null?"":argString.trim(); 
                String mainTemplate = 
conf.getAttribute(P_LAUNCH_MAINTEMPLATE,(String)null);  
                
-               cmdLine = constructCommand(binaryFile, argString, path, 
mainTemplate);
+               cmdLine = constructCommand(binaryFile, vmArgString, argString, 
path, mainTemplate);
                envp = new String[0];
 
        }

Modified: 
trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/debug/ui/LaunchTab.java
===================================================================
--- trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/debug/ui/LaunchTab.java   
2008-10-25 04:16:14 UTC (rev 3139)
+++ trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/debug/ui/LaunchTab.java   
2008-10-26 02:17:26 UTC (rev 3140)
@@ -58,6 +58,7 @@
 
        // Widgets
        private Text argumentsField;
+       private Text vmArgumentsField;
        private Text mainTemplateField;
 
        //Project UI widgets
@@ -111,11 +112,14 @@
                createShowButton(comp, data);
 
                // Specify arguments
-               createArguments(comp);
-
+               createArguments(comp);          
                //////
                // Specify the vexi entry point
                createMainTemplate(comp);
+               // Specify vm arguments
+               createVmArguments(comp);
+
+               
                /*Label label4 = new Label(comp, SWT.NONE);
                label4.setText("Vexi Entry point");
                data = new GridData();
@@ -208,6 +212,23 @@
                argumentsField.addModifyListener(modifyListener);
        }
        
+       private void createVmArguments(Composite parent) {
+               Font font= parent.getFont();
+               Group group= new Group(parent, SWT.NONE);
+               group.setText("JVM options"); 
+               GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+               group.setLayoutData(gd);
+               GridLayout layout = new GridLayout();
+               layout.numColumns = 1;
+               group.setLayout(layout);
+               group.setFont(font);
+               vmArgumentsField = new Text(group, SWT.SINGLE | SWT.BORDER);
+               gd = new GridData(GridData.FILL_HORIZONTAL);
+               vmArgumentsField.setLayoutData(gd);
+               vmArgumentsField.setFont(font);
+               vmArgumentsField.addModifyListener(modifyListener);
+       }
+       
        private void createMainTemplate(Composite parent) {
                Font font= parent.getFont();
                Group group= new Group(parent, SWT.NONE);
@@ -239,10 +260,11 @@
                                String binaryFile = 
store.getString(PREF_VEXIBINARY);
                                
                                String argString = 
argumentsField.getText().trim(); 
+                               String vmArgString = 
vmArgumentsField.getText().trim(); 
                                String mainTemplate = 
mainTemplateField.getText().trim(); 
                                String path = launchPathPage.getValue();
                                
-                               String[] cmds = 
VexiRunnerConfig.constructCommand(binaryFile, argString, path, mainTemplate);
+                               String[] cmds = 
VexiRunnerConfig.constructCommand(binaryFile, vmArgString, argString, path, 
mainTemplate);
                                String cmdLine = "";
                                for(int i=0; i<cmds.length; i++){
                                        cmdLine+= cmds[i] + " ";
@@ -338,6 +360,8 @@
                        this.fProjText.setText(value==null?"":value);  
                        value = conf.getAttribute(P_LAUNCH_ARGS,(String)null);
                        this.argumentsField.setText(value==null?"":value);  
+                       value = conf.getAttribute(P_LAUNCH_VMARGS,(String)null);
+                       this.vmArgumentsField.setText(value==null?"":value);  
                        value = 
conf.getAttribute(P_LAUNCH_MAINTEMPLATE,(String)null);
                        this.mainTemplateField.setText(value==null?"":value);  
 
@@ -361,6 +385,9 @@
 
                value = this.argumentsField.getText().trim(); 
                conf.setAttribute(P_LAUNCH_ARGS, value);
+               
+               value = this.vmArgumentsField.getText().trim(); 
+               conf.setAttribute(P_LAUNCH_VMARGS, value);
 
                value = this.mainTemplateField.getText().trim(); 
                conf.setAttribute(P_LAUNCH_MAINTEMPLATE, value);

Modified: 
trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/debug/ui/VexiLaunchConfigDelegate.java
===================================================================
--- 
trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/debug/ui/VexiLaunchConfigDelegate.java
    2008-10-25 04:16:14 UTC (rev 3139)
+++ 
trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/debug/ui/VexiLaunchConfigDelegate.java
    2008-10-26 02:17:26 UTC (rev 3140)
@@ -13,7 +13,6 @@
 import org.eclipse.debug.core.ILaunch;
 import org.eclipse.debug.core.ILaunchConfiguration;
 import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
-import org.eclipse.ui.IWindowListener;
 import org.vexi.vexidev.debug.VexiRunner;
 import org.vexi.vexidev.debug.VexiRunnerConfig;
 
@@ -28,7 +27,6 @@
  */
 public class VexiLaunchConfigDelegate implements ILaunchConfigurationDelegate
        {
-       private static IWindowListener windowListener;
        
        /**
         * Launches the vexi process.
@@ -46,7 +44,8 @@
                
                monitor.worked(1);
                try {
-                       Process p = VexiRunner.run(runConfig, monitor, launch);
+                       //Process p = 
+                               VexiRunner.run(runConfig, monitor, launch);
                        //DebugPlugin.newProcess(launch,p,"Vexi");
                } catch (IOException e) {
                        e.printStackTrace();

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-25 04:16:14 UTC (rev 3139)
+++ 
trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/navigator/VexiModelProvider.java
  2008-10-26 02:17:26 UTC (rev 3140)
@@ -16,6 +16,7 @@
 import java.util.Set;
 import java.util.WeakHashMap;
 
+import org.eclipse.core.resources.IContainer;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IFolder;
 import org.eclipse.core.resources.IProject;
@@ -150,15 +151,63 @@
                return rem;
        }
 
+       private boolean interceptRefreshOrUpdate(Set targets){
+              LinkedHashSet newtargets = new LinkedHashSet();
+               for (Iterator tItr = targets.iterator(); tItr.hasNext();) {
+                   Object t = tItr.next();
+                   
+                   if(t == null){
+                       //only case when a child is removed and another one is 
not added (null)
+                       tItr.remove();
+                       continue;
+                   }
+                   
+                   if(t instanceof IResource && !(t instanceof IVexiResource)){
+                       IResource res = (IResource) t;
+                       IVexiResource vres = getMapping(res);
+                       if(vres != null){
+                           //if it is in the vexi model, just swap
+                           tItr.remove();
+                           newtargets.add(vres);
+                           break;
+                       }
+                       while(res!=null){
+                               vres = getMapping(res);
+                               if(vres != null){
+                                   break;
+                               }
+                               IContainer p = res.getParent();
+                               if(res instanceof IFolder && p instanceof 
IProject){
+                                       // The folder is a vexi src folder, it 
just does not 
+                                       // know it yet!!
+                               VexiProject vproject = 
(VexiProject)((IProject)p).getAdapter(VexiProject.class);
+                                       Set<IResource> srcPath = new 
HashSet(vproject.getSourcePath());
+                                       if(srcPath.contains(res)){
+                                               
newtargets.add(getVexiSourceFolder(p, (IFolder) res));
+                                       }
+                               }
+                               res = p;
+                       }
+                   }
+               }
+               if (!newtargets.isEmpty()) {
+                       targets.addAll(newtargets);
+                   return true;
+               }
+               return false;        
+       }
 
        public boolean interceptRefresh(PipelinedViewerUpdate 
refreshSynchronization) {
-               return false;
+               return 
interceptRefreshOrUpdate(refreshSynchronization.getRefreshTargets());
        }
 
 
        public boolean interceptUpdate(PipelinedViewerUpdate 
anUpdateSynchronization) {
-               return false;
+               return 
interceptRefreshOrUpdate(anUpdateSynchronization.getRefreshTargets());
        }
+       
+       
+       
 
        public void init(ICommonContentExtensionSite config) {}
 


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