tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r579074 - in /incubator/tuscany/java/sca/tools/plugin-core/src/main/java/org/apache/tuscany/sca/core/newwizards: NewComponentTypeWizardPage.java NewCompositeWizardPage.java
Date Tue, 25 Sep 2007 05:23:11 GMT
Author: jsdelfino
Date: Mon Sep 24 22:23:06 2007
New Revision: 579074

URL: http://svn.apache.org/viewvc?rev=579074&view=rev
Log:
Fixed incorrect path to Wizard icon. Simplified namespace and name of generated .composite
file.

Modified:
    incubator/tuscany/java/sca/tools/plugin-core/src/main/java/org/apache/tuscany/sca/core/newwizards/NewComponentTypeWizardPage.java
    incubator/tuscany/java/sca/tools/plugin-core/src/main/java/org/apache/tuscany/sca/core/newwizards/NewCompositeWizardPage.java

Modified: incubator/tuscany/java/sca/tools/plugin-core/src/main/java/org/apache/tuscany/sca/core/newwizards/NewComponentTypeWizardPage.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/plugin-core/src/main/java/org/apache/tuscany/sca/core/newwizards/NewComponentTypeWizardPage.java?rev=579074&r1=579073&r2=579074&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/plugin-core/src/main/java/org/apache/tuscany/sca/core/newwizards/NewComponentTypeWizardPage.java
(original)
+++ incubator/tuscany/java/sca/tools/plugin-core/src/main/java/org/apache/tuscany/sca/core/newwizards/NewComponentTypeWizardPage.java
Mon Sep 24 22:23:06 2007
@@ -54,7 +54,7 @@
 		setDescription("Create a new SCA ComponentType.");
 		
 		try {
-			String location = FileLocator.toFileURL(Platform.getBundle("tuscany.eclipse").getEntry("/")).getFile().toString();
+			String location = FileLocator.toFileURL(Platform.getBundle("org.apache.tuscany.sca.core").getEntry("/")).getFile().toString();
 			setImageDescriptor(ImageDescriptor.createFromImageData((new ImageLoader()).load(location
+ "/icons/tuscany.gif")[0]));
 		} catch (Exception e) {
 			System.err.println(e.getMessage());
@@ -87,7 +87,6 @@
 		printWriter.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
 		printWriter.println("<componentType	xmlns=\"http://www.osoa.org/xmlns/sca/1.0\"");
 		printWriter.println("				xmlns:t=\"http://tuscany.apache.org/xmlns/sca/1.0\">");	
-		printWriter.println();
 		printWriter.println();
 		printWriter.println();
 		printWriter.println("</componentType>");

Modified: incubator/tuscany/java/sca/tools/plugin-core/src/main/java/org/apache/tuscany/sca/core/newwizards/NewCompositeWizardPage.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/plugin-core/src/main/java/org/apache/tuscany/sca/core/newwizards/NewCompositeWizardPage.java?rev=579074&r1=579073&r2=579074&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/plugin-core/src/main/java/org/apache/tuscany/sca/core/newwizards/NewCompositeWizardPage.java
(original)
+++ incubator/tuscany/java/sca/tools/plugin-core/src/main/java/org/apache/tuscany/sca/core/newwizards/NewCompositeWizardPage.java
Mon Sep 24 22:23:06 2007
@@ -26,6 +26,8 @@
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.viewers.IStructuredSelection;
@@ -54,7 +56,7 @@
 		setDescription("Create a new SCA Composite.");
 		
 		try {
-			String location = FileLocator.toFileURL(Platform.getBundle("tuscany.eclipse").getEntry("/")).getFile().toString();
+			String location = FileLocator.toFileURL(Platform.getBundle("org.apache.tuscany.sca.core").getEntry("/")).getFile().toString();
 			setImageDescriptor(ImageDescriptor.createFromImageData((new ImageLoader()).load(location
+ "/icons/tuscany.gif")[0]));
 		} catch (Exception e) {
 			System.err.println(e.getMessage());
@@ -81,17 +83,18 @@
 
 	@Override
 	protected InputStream getInitialContents() {
-		
+
+	        IPath path = new Path(getFileName());
+	        String name = path.removeFileExtension().toString();
 		ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
 		PrintWriter printWriter = new PrintWriter(outputStream);
 		printWriter.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");		
 		printWriter.println("<composite	xmlns=\"http://www.osoa.org/xmlns/sca/1.0\"");
 		printWriter.println("			xmlns:t=\"http://tuscany.apache.org/xmlns/sca/1.0\"");
-		printWriter.println("			xmlns:c=\"http://" + getFileName() + "\"");	
-		printWriter.println("			name=\"" + getFileName() + "\">");
-		printWriter.println();
-		printWriter.println();
+		printWriter.println("			xmlns:c=\"http://" + name + "\"");	
+		printWriter.println("			name=\"" + name + "\">");
 		printWriter.println();
+                printWriter.println();
 		printWriter.println("</composite>");
 		printWriter.close();
 		



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message