geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r559936 - in /geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui: ./ Activator.java Jdes2gLauncher.java Jres2gLauncher.java Jsrc2gLauncher.java
Date Thu, 26 Jul 2007 18:46:58 GMT
Author: sppatel
Date: Thu Jul 26 11:46:57 2007
New Revision: 559936

URL: http://svn.apache.org/viewvc?view=rev&rev=559936
Log:
add missing files for last commit

Added:
    geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/
    geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Activator.java
  (with props)
    geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Jdes2gLauncher.java
  (with props)
    geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Jres2gLauncher.java
  (with props)
    geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Jsrc2gLauncher.java
  (with props)

Added: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Activator.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Activator.java?view=auto&rev=559936
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Activator.java
(added)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Activator.java
Thu Jul 26 11:46:57 2007
@@ -0,0 +1,45 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.j2g.util.ui;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+public class Activator extends AbstractUIPlugin {
+
+	public static final String PLUGIN_ID = "org.apache.geronimo.j2g.util.ui";
+	private static Activator plugin;
+
+	public Activator() {
+		Activator.plugin = this;
+	}
+
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+	}
+
+	public void stop(BundleContext context) throws Exception {
+		Activator.plugin = null;
+		super.stop(context);
+	}
+
+	public static Activator getDefault() {
+		return Activator.plugin;
+	}
+
+}

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Activator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Activator.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Activator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Jdes2gLauncher.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Jdes2gLauncher.java?view=auto&rev=559936
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Jdes2gLauncher.java
(added)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Jdes2gLauncher.java
Thu Jul 26 11:46:57 2007
@@ -0,0 +1,165 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.j2g.util.ui;
+
+import java.io.*;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.ActionDelegate;
+import org.eclipse.ui.console.*;
+
+public class Jdes2gLauncher
+	extends ActionDelegate
+	implements IViewActionDelegate 
+{
+
+	/**
+	 * Eclipse home.
+	 */
+	private String eclipseHomePath;
+	
+	/**
+	 * Eclipse workspace.
+	 */
+	private String eclipseWorkspacePath;
+	
+	/**
+	 * Geronimo Home.
+	 */
+	private String geronimoHome;
+	
+	/**
+	 * Source directory.
+	 */
+	private String sourceDir;
+	
+	/**
+	 * Web directory.
+	 */
+	private String webDir = "";
+
+
+	public void run(IAction action) {
+		MessageConsole console = new MessageConsole("System Output", null);
+		ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { console });
+		ConsolePlugin.getDefault().getConsoleManager().showConsoleView(console);
+		MessageConsoleStream stream = console.newMessageStream();
+		System.setOut(new PrintStream(stream));
+		System.setErr(new PrintStream(stream));
+		String fdselected = new String();
+		MessageBox prompt = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
SWT.ICON_WARNING);
+		MessageBox yesNoBox = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
SWT.ICON_QUESTION|SWT.YES|SWT.NO);
+		DirectoryDialog fd = new DirectoryDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
SWT.OPEN);
+		String cmdOutput = null;
+		String[] cmd = new String[3];
+		
+		// Check environment for eclipse home
+		
+		eclipseHomePath = System.getenv("ECLIPSE_HOME");	
+		if (eclipseHomePath == null)
+		{
+			prompt.setMessage("'ECLIPSE_HOME' was not found in your environment.\n" +
+					"Please set it and relaunch Eclipse.");
+			prompt.open();
+			return;
+		}
+
+		//Check environment for Workspace dir.
+		
+		eclipseWorkspacePath = System.getenv("WORKSPACE");	
+		if (eclipseWorkspacePath == null)
+		{
+			prompt.setMessage("'WORKSPACE' was not found in your environment.\n" +
+					"Please select the location of your temporary Eclipse Workspace now.");
+			prompt.open();
+			fd.setMessage("Select Eclipse Workspace directory");
+			fd.setText("Select Eclipse Workspace directory");
+			fd.setFilterPath(System.getProperty("user.home"));	
+			fdselected = fd.open();
+			if (fdselected == null)
+				return;
+			eclipseWorkspacePath = fdselected;
+		}
+
+		//Select target directory
+		prompt.setMessage("Please select application root directory to convert.");
+		prompt.open();
+		fd.setMessage("Select application root directory");
+		fd.setText("Select application root directory");
+		fd.setFilterPath(System.getProperty("user.home"));	
+		sourceDir = fd.open();
+		if (sourceDir == null)
+			return;
+		yesNoBox.setMessage("Jdes2g is going to be executed on "+sourceDir+".\n"+
+			"This process may take a while, and cause Eclipse to appear unresponsive.\n"+
+				"Continue?");
+		if (SWT.NO == yesNoBox.open())
+		{
+			return;
+		}
+		
+		//Everything but windows uses this		
+		
+		if (System.getProperty("os.name").toUpperCase().indexOf("WINDOWS") == -1)
+		{
+			cmd[0] = "bash";
+			cmd[1] = "-c";
+		}
+		else	//This is just for windows
+		{
+			cmd[0] = "cmd";
+			cmd[1] = "/c";
+		}
+		cmd[2] = "java -classpath "+eclipseHomePath+System.getProperty("file.separator")+"plugins"+System.getProperty("file.separator")+"org.eclipse.equinox.launcher_*.jar
org.eclipse.equinox.launcher.Main -application org.apache.geronimo.j2g.descriptors.tool -data
"+eclipseWorkspacePath+" "+sourceDir;
+		
+		System.out.println("Executing: "+cmd[2]);
+		try {
+        Process cmdProcess = Runtime.getRuntime().exec(cmd);
+        
+        BufferedReader stdInput = new BufferedReader(new 
+             InputStreamReader(cmdProcess.getInputStream()));
+
+        BufferedReader stdError = new BufferedReader(new 
+             InputStreamReader(cmdProcess.getErrorStream()));
+        
+        while ((cmdOutput = stdInput.readLine()) != null) {
+            System.out.println(cmdOutput);
+        }
+
+        while ((cmdOutput = stdError.readLine()) != null) {
+            System.out.println(cmdOutput);
+        }
+    }
+
+    catch (IOException e) {
+        System.out.println("Error executing "+cmd[2]);
+        e.printStackTrace();
+    }
+	}
+
+	public void init(IViewPart view) {
+		
+	}
+
+}
+

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Jdes2gLauncher.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Jdes2gLauncher.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Jres2gLauncher.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Jres2gLauncher.java?view=auto&rev=559936
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Jres2gLauncher.java
(added)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Jres2gLauncher.java
Thu Jul 26 11:46:57 2007
@@ -0,0 +1,164 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.j2g.util.ui;
+
+import java.io.*;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.ActionDelegate;
+import org.eclipse.ui.console.*;
+
+public class Jres2gLauncher
+	extends ActionDelegate
+	implements IViewActionDelegate 
+{
+
+	/**
+	 * Eclipse home.
+	 */
+	private String eclipseHomePath;
+	
+	/**
+	 * Eclipse workspace.
+	 */
+	private String eclipseWorkspacePath;
+	
+	/**
+	 * Geronimo Home.
+	 */
+	private String geronimoHome;
+	
+	/**
+	 * Source directory.
+	 */
+	private String sourceDir;
+	
+	/**
+	 * Web directory.
+	 */
+	private String webDir = "";
+
+	public void run(IAction action) {
+		MessageConsole console = new MessageConsole("System Output", null);
+		ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { console });
+		ConsolePlugin.getDefault().getConsoleManager().showConsoleView(console);
+		MessageConsoleStream stream = console.newMessageStream();
+		System.setOut(new PrintStream(stream));
+		System.setErr(new PrintStream(stream));
+		String fdselected = new String();
+		MessageBox prompt = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
SWT.ICON_WARNING);
+		MessageBox yesNoBox = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
SWT.ICON_QUESTION|SWT.YES|SWT.NO);
+		DirectoryDialog fd = new DirectoryDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
SWT.OPEN);
+		String cmdOutput = null;
+		String[] cmd = new String[3];
+		
+		// Check environment for eclipse home
+		
+		eclipseHomePath = System.getenv("ECLIPSE_HOME");	
+		if (eclipseHomePath == null)
+		{
+			prompt.setMessage("'ECLIPSE_HOME' was not found in your environment.\n" +
+					"Please set it and relaunch Eclipse.");
+			prompt.open();
+			return;
+		}
+
+		//Check environment for Workspace dir.
+		
+		eclipseWorkspacePath = System.getenv("WORKSPACE");	
+		if (eclipseWorkspacePath == null)
+		{
+			prompt.setMessage("'WORKSPACE' was not found in your environment.\n" +
+					"Please select the location of your temporary Eclipse Workspace now.");
+			prompt.open();
+			fd.setMessage("Select Eclipse Workspace directory");
+			fd.setText("Select Eclipse Workspace directory");
+			fd.setFilterPath(System.getProperty("user.home"));	
+			fdselected = fd.open();
+			if (fdselected == null)
+				return;
+			eclipseWorkspacePath = fdselected;
+		}
+		
+		//Select target directory
+		prompt.setMessage("Please select application root directory to convert.");
+		prompt.open();
+		fd.setMessage("Select application root directory");
+		fd.setText("Select application root directory");
+		fd.setFilterPath(System.getProperty("user.home"));	
+		sourceDir = fd.open();
+		if (sourceDir == null)
+				return;
+		yesNoBox.setMessage("Jres2g is going to be executed on "+sourceDir+".\n"+
+			"This process may take a while, and cause Eclipse to appear unresponsive.\n"+
+				"Continue?");
+		if (SWT.NO == yesNoBox.open())
+		{
+			return;
+		}
+		
+		//Everything but windows uses this		
+		
+		if (System.getProperty("os.name").toUpperCase().indexOf("WINDOWS") == -1)
+		{
+			cmd[0] = "bash";
+			cmd[1] = "-c";
+		}
+		else	//This is just for windows
+		{
+			cmd[0] = "cmd";
+			cmd[1] = "/c";
+		}
+		cmd[2] = "java -classpath "+eclipseHomePath+System.getProperty("file.separator")+"plugins"+System.getProperty("file.separator")+"org.eclipse.equinox.launcher_*.jar
org.eclipse.equinox.launcher.Main -application org.apache.geronimo.j2g.resources.tool -data
"+eclipseWorkspacePath+" "+sourceDir;
+		
+		System.out.println("Executing: "+cmd[2]);
+		try {
+        Process cmdProcess = Runtime.getRuntime().exec(cmd);
+        
+        BufferedReader stdInput = new BufferedReader(new 
+             InputStreamReader(cmdProcess.getInputStream()));
+
+        BufferedReader stdError = new BufferedReader(new 
+             InputStreamReader(cmdProcess.getErrorStream()));
+        
+        while ((cmdOutput = stdInput.readLine()) != null) {
+            System.out.println(cmdOutput);
+        }
+
+        while ((cmdOutput = stdError.readLine()) != null) {
+            System.out.println(cmdOutput);
+        }
+    }
+
+    catch (IOException e) {
+        System.out.println("Error executing "+cmd[2]);
+        e.printStackTrace();
+    }
+	}
+
+	public void init(IViewPart view) {
+		
+	}
+
+}
+

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Jres2gLauncher.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Jres2gLauncher.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Jsrc2gLauncher.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Jsrc2gLauncher.java?view=auto&rev=559936
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Jsrc2gLauncher.java
(added)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Jsrc2gLauncher.java
Thu Jul 26 11:46:57 2007
@@ -0,0 +1,190 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.j2g.util.ui;
+
+import java.io.*;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.ActionDelegate;
+import org.eclipse.ui.console.*;
+
+public class Jsrc2gLauncher
+	extends ActionDelegate
+	implements IViewActionDelegate 
+{
+
+	/**
+	 * Eclipse home.
+	 */
+	private String eclipseHomePath;
+	
+	/**
+	 * Eclipse workspace.
+	 */
+	private String eclipseWorkspacePath;
+	
+	/**
+	 * Geronimo Home.
+	 */
+	private String geronimoHome;
+	
+	/**
+	 * Source directory.
+	 */
+	private String sourceDir;
+	
+	/**
+	 * Web directory.
+	 */
+	private String webDir = "";
+
+	public void run(IAction action) {
+		MessageConsole console = new MessageConsole("System Output", null);
+		ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { console });
+		ConsolePlugin.getDefault().getConsoleManager().showConsoleView(console);
+		MessageConsoleStream stream = console.newMessageStream();
+		System.setOut(new PrintStream(stream));
+		System.setErr(new PrintStream(stream));
+		String fdselected = new String();
+		MessageBox prompt = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
SWT.ICON_WARNING);
+		MessageBox yesNoBox = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
SWT.ICON_QUESTION|SWT.YES|SWT.NO);
+		DirectoryDialog fd = new DirectoryDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
SWT.OPEN);
+		String cmdOutput = null;
+		String[] cmd = new String[3];
+		
+		// Check environment for eclipse home
+		
+		eclipseHomePath = System.getenv("ECLIPSE_HOME");	
+		if (eclipseHomePath == null)
+		{
+			prompt.setMessage("'ECLIPSE_HOME' was not found in your environment.\n" +
+					"Please select the location of your Eclipse SDK now.");
+			prompt.open();
+			fd.setMessage("Select Eclipse SDK directory");
+			fd.setText("Select Eclipse SDK directory");
+			fd.setFilterPath(System.getProperty("user.home"));	
+			fdselected = fd.open();
+			if (fdselected == null)
+				return;
+			eclipseHomePath = fdselected;
+		}
+		
+		//Check environment for Workspace dir.		
+
+		eclipseHomePath = System.getenv("ECLIPSE_HOME");	
+		if (eclipseHomePath == null)
+		{
+			prompt.setMessage("'ECLIPSE_HOME' was not found in your environment.\n" +
+					"Please set it and relaunch Eclipse.");
+			prompt.open();
+			return;
+		}
+		
+		//Check environment for Geronimo Home		
+			
+		geronimoHome = System.getenv("GERONIMO_HOME");	
+		if (geronimoHome == null)
+		{
+			prompt.setMessage("'GERONIMO_HOME' was not found in your environment.\n" +
+					"Please select the location of Geronimo now.");
+			prompt.open();
+			fd.setMessage("Select Geronimo directory");
+			fd.setText("Select Geronimo directory");
+			fd.setFilterPath(System.getProperty("user.home"));	
+			fdselected = fd.open();
+			if (fdselected == null)
+				return;
+			geronimoHome = fdselected;
+		}
+		
+		//Select target directories
+		prompt.setMessage("Please select application source directory to convert.");
+		prompt.open();
+		fd.setMessage("Select application source directory");
+		fd.setText("Select application source directory");
+		fd.setFilterPath(System.getProperty("user.home"));	
+		sourceDir = fd.open();
+		if (sourceDir == null)
+			return;
+		yesNoBox.setMessage("Do you wish to convert web (JSP) sources as well?");
+		if (SWT.YES == yesNoBox.open())
+		{
+			webDir = " -web ";
+			fd.setMessage("Select web (JSP) source directory");
+			fd.setText("Select web (JSP) source directory");
+			fd.setFilterPath(System.getProperty("user.home"));	
+			webDir = webDir+fd.open();
+		}
+		yesNoBox.setMessage("Jsrc2g is going to be executed with -src "+sourceDir+webDir+".\n"+
+			"This process may take a while, and cause Eclipse to appear unresponsive.\n"+
+				"Continue?");
+		if (SWT.NO == yesNoBox.open())
+		{
+			return;
+		}
+		
+		//Everything but windows uses this		
+		
+		if (System.getProperty("os.name").toUpperCase().indexOf("WINDOWS") == -1)
+		{
+			cmd[0] = "bash";
+			cmd[1] = "-c";
+		}
+		else	//This is just for windows
+		{
+			cmd[0] = "cmd";
+			cmd[1] = "/c";
+		}
+		cmd[2] = "java -classpath "+eclipseHomePath+System.getProperty("file.separator")+"plugins"+System.getProperty("file.separator")+"org.eclipse.equinox.launcher_*.jar
org.eclipse.equinox.launcher.Main -application org.apache.geronimo.j2g.sources.tool -data
"+eclipseWorkspacePath+webDir+" -configuration "+eclipseHomePath+System.getProperty("file.separator")+"configuration
-src "+sourceDir+" -geronimo "+geronimoHome;
+		
+		System.out.println("Executing: "+cmd[2]);
+		try {
+        Process cmdProcess = Runtime.getRuntime().exec(cmd);
+        
+        BufferedReader stdInput = new BufferedReader(new 
+             InputStreamReader(cmdProcess.getInputStream()));
+
+        BufferedReader stdError = new BufferedReader(new 
+             InputStreamReader(cmdProcess.getErrorStream()));
+        
+        while ((cmdOutput = stdInput.readLine()) != null) {
+            System.out.println(cmdOutput);
+        }
+
+        while ((cmdOutput = stdError.readLine()) != null) {
+            System.out.println(cmdOutput);
+        }
+    }
+
+    catch (IOException e) {
+        System.out.println("Error executing "+cmd[2]);
+        e.printStackTrace();
+    }
+	}
+
+	public void init(IViewPart view) {
+		
+	}
+
+}
+

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Jsrc2gLauncher.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/ui/Jsrc2gLauncher.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message