geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lin...@apache.org
Subject svn commit: r582933 - in /geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui: ./ META-INF/ src/ src/org/ src/org/apache/ src/org/apache/geronimo/ src/org/apache/geronimo/devtools/ src/org/apache/geronimo/devtools/j2g/ src/org/apach...
Date Mon, 08 Oct 2007 18:51:59 GMT
Author: linsun
Date: Mon Oct  8 11:51:57 2007
New Revision: 582933

URL: http://svn.apache.org/viewvc?rev=582933&view=rev
Log:
update the ui plugin for GERONIMODEVTOOLS-221

Added:
    geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/
    geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/.classpath   (with
props)
    geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/.project   (with
props)
    geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/META-INF/
    geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/META-INF/MANIFEST.MF
    geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/build.properties
  (with props)
    geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/plugin.xml   (with
props)
    geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/pom.xml   (with
props)
    geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/
    geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/
    geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/
    geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/
    geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/
    geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/
    geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/
    geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Activator.java
  (with props)
    geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Jdes2gLauncher.java
  (with props)
    geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Jres2gLauncher.java
  (with props)
    geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Jsrc2gLauncher.java
  (with props)

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/.classpath
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/.classpath?rev=582933&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/.classpath (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/.classpath Mon
Oct  8 11:51:57 2007
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry excluding="**/*.java" including="plugin.xml" kind="src" path=""/>
+	<classpathentry excluding="**/*.java" including="*.jar" kind="src" path="lib"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" output="target/test-classes" path="test"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>

Propchange: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/.classpath
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/.project
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/.project?rev=582933&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/.project (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/.project Mon Oct
 8 11:51:57 2007
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.apache.geronimo.devtools.j2g.ui</name>
+	<comment>JBoss to Geronimo Conversion Tool</comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>LaunchConfigHandle</key>
+					<value>&lt;project&gt;/.externalToolBuilders/Maven_Ant_Builder.launch</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.pde.PluginNature</nature>
+	</natures>
+</projectDescription>

Propchange: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/.project
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/META-INF/MANIFEST.MF?rev=582933&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/META-INF/MANIFEST.MF
(added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/META-INF/MANIFEST.MF
Mon Oct  8 11:51:57 2007
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: J2G XML Conversion Helper Plug-in
+Bundle-SymbolicName: org.apache.geronimo.devtools.j2g.ui;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Vendor: Apache.org
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.ui,
+ org.eclipse.debug.ui,
+ org.eclipse.ui.console
+Bundle-ClassPath: .
+Bundle-Activator: org.apache.geronimo.devtools.j2g.ui.Activator
+Eclipse-LazyStart: true
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/build.properties
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/build.properties?rev=582933&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/build.properties
(added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/build.properties
Mon Oct  8 11:51:57 2007
@@ -0,0 +1,21 @@
+/**
+ *  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.
+ */
+ source.. = src/
+output.. = classes/
+bin.includes = plugin.xml,\
+               META-INF/,\
+               .

Propchange: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/build.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/plugin.xml?rev=582933&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/plugin.xml (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/plugin.xml Mon
Oct  8 11:51:57 2007
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<!--
+  ~ 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.
+  -->
+<plugin>
+<extension point="org.eclipse.ui.popupMenus">
+		<viewerContribution
+		id="org.apache.geronimo.devtools.j2g.ui.popup.navigator"
+		targetID="org.eclipse.ui.views.ResourceNavigator">
+		<menu
+			id="org.apache.geronimo.devtools.j2g.ui.navigator.subMenu"
+			label="J2G Migration"
+			path="additions">
+			<separator name="group1"/>
+		</menu>
+		<action
+			id="org.apache.geronimo.devtools.j2g.ui.navigator.action1"
+			label="3. Resource Migration Tool (jres2g)"
+			helpContextId="org.apache.geronimo.devtools.j2g.ui.navigator.action1"
+			menubarPath="org.apache.geronimo.devtools.j2g.ui.navigator.subMenu/group1"
+			class="org.apache.geronimo.devtools.j2g.ui.Jres2gLauncher">
+		</action>
+		<action
+			id="org.apache.geronimo.devtools.j2g.ui.navigator.action3"
+			label="2. Descriptors Conversion Tool (jdes2g)"
+			helpContextId="org.apache.geronimo.devtools.j2g.ui.navigator.action3"
+			menubarPath="org.apache.geronimo.devtools.j2g.ui.navigator.subMenu/group1"
+			class="org.apache.geronimo.devtools.j2g.ui.Jdes2gLauncher">
+		</action>
+		<action
+			id="org.apache.geronimo.devtools.j2g.ui.navigator.action2"
+			label="1. Source Identification Tool (jsrc2g)"
+			helpContextId="org.apache.geronimo.devtools.j2g.ui.navigator.action2"
+			menubarPath="org.apache.geronimo.devtools.j2g.ui.navigator.subMenu/group1"
+			class="org.apache.geronimo.devtools.j2g.ui.Jsrc2gLauncher">
+		</action>
+	</viewerContribution>
+</extension>
+</plugin>
+

Propchange: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/plugin.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/pom.xml?rev=582933&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/pom.xml (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/pom.xml Mon Oct
 8 11:51:57 2007
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<!-- $Rev: 561821 $ $Date: 2007-08-01 11:05:12 -0400 (Wed, 01 Aug 2007) $ -->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.geronimo.devtools.j2g</groupId>
+        <artifactId>plugins</artifactId>
+        <version>1.0.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>org.apache.geronimo.devtools.j2g.ui</artifactId>
+    <packaging>jar</packaging>
+    <name>${artifactId}</name>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>.</directory>
+                <includes>
+                    <include>plugin.xml</include>
+                </includes>
+            </resource>
+            <resource>
+                <directory>lib</directory>
+                <targetPath>lib</targetPath>
+                <includes>
+                    <include>*.jar</include>
+                </includes>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.geronimo.devtools</groupId>
+                <artifactId>maven-eclipsepde-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <artifactId>maven-antrun-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <artifactId>maven-jar-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Propchange: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Activator.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Activator.java?rev=582933&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Activator.java
(added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Activator.java
Mon Oct  8 11:51: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.devtools.j2g.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.devtools.j2g.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/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Activator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Jdes2gLauncher.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Jdes2gLauncher.java?rev=582933&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Jdes2gLauncher.java
(added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Jdes2gLauncher.java
Mon Oct  8 11:51: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.devtools.j2g.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.devtools.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/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Jdes2gLauncher.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Jres2gLauncher.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Jres2gLauncher.java?rev=582933&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Jres2gLauncher.java
(added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Jres2gLauncher.java
Mon Oct  8 11:51:57 2007
@@ -0,0 +1,161 @@
+/**
+ *  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.devtools.j2g.ui;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintStream;
+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.devtools.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/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Jres2gLauncher.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Jsrc2gLauncher.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Jsrc2gLauncher.java?rev=582933&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Jsrc2gLauncher.java
(added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Jsrc2gLauncher.java
Mon Oct  8 11:51:57 2007
@@ -0,0 +1,184 @@
+/**
+ *  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.devtools.j2g.ui;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintStream;
+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 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 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;
+        }
+
+        // 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.devtools.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/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.ui/src/org/apache/geronimo/devtools/j2g/ui/Jsrc2gLauncher.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message