You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by sp...@apache.org on 2006/01/20 15:44:01 UTC

svn commit: r370822 - in /geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui: icons/ src/org/apache/geronimo/ui/internal/

Author: sppatel
Date: Fri Jan 20 06:43:57 2006
New Revision: 370822

URL: http://svn.apache.org/viewcvs?rev=370822&view=rev
Log:
gwiz image

Added:
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/icons/g_server.gif   (with props)
Modified:
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoServerRuntimeWizardFragment.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoUIPlugin.java

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/icons/g_server.gif
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/icons/g_server.gif?rev=370822&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/icons/g_server.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoServerRuntimeWizardFragment.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoServerRuntimeWizardFragment.java?rev=370822&r1=370821&r2=370822&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoServerRuntimeWizardFragment.java (original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoServerRuntimeWizardFragment.java Fri Jan 20 06:43:57 2006
@@ -24,6 +24,7 @@
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jst.server.generic.core.internal.GenericServerRuntime;
 import org.eclipse.jst.server.generic.servertype.definition.Property;
 import org.eclipse.jst.server.generic.servertype.definition.ServerRuntime;
@@ -102,6 +103,8 @@
 	 */
 	public void createContent(Composite parent, IWizardHandle handle) {
 
+		getWizard().setImageDescriptor(GeronimoUIPlugin.getImageDescriptor(GeronimoUIPlugin.IMG_WIZ_GERONIMO));
+
 		fDecorators = new GenericServerCompositeDecorator[1];
 		fDecorators[0] = new GeronimoJRESelectDecorator(getRuntimeDelegate());
 		GenericServerComposite composite = new GenericServerComposite(parent,
@@ -183,13 +186,18 @@
 				public void widgetSelected(SelectionEvent se) {
 					if (installDir != null && isValidLocation()) {
 						Shell shell = installDir.getShell();
-						MessageBox mb = new MessageBox(shell,SWT.OK|SWT.CANCEL|SWT.ICON_QUESTION);
+						MessageBox mb = new MessageBox(shell, SWT.OK
+								| SWT.CANCEL | SWT.ICON_QUESTION);
 						mb.setText(Messages.installTitle);
-						mb.setMessage(Messages.installMessage + "\n" + installDir.getText());
-						if(mb.open() == SWT.OK) {
+						mb.setMessage(Messages.installMessage + "\n"
+								+ installDir.getText());
+						if (mb.open() == SWT.OK) {
 							try {
-								IInstallableRuntime installable = tomcat.getSelection() ? gWithTomcat : gWithJetty;
-								Path installPath = new Path(installDir.getText());
+								IInstallableRuntime installable = tomcat
+										.getSelection() ? gWithTomcat
+										: gWithJetty;
+								Path installPath = new Path(installDir
+										.getText());
 								installable.install(installPath,
 										new NullProgressMonitor());
 								updateInstallDir(installPath);
@@ -197,7 +205,7 @@
 								Trace.trace(Trace.SEVERE,
 										"Error installing runtime", e);
 							}
-						}	
+						}
 					}
 				}
 
@@ -236,23 +244,23 @@
 		} else {
 			getWizard().setMessage(status.getMessage(), IMessageProvider.ERROR);
 			Path installPath = new Path(installDir.getText());
-			if(installPath.toFile().exists()) {
+			if (installPath.toFile().exists()) {
 				group.setEnabled(true);
 			}
 			return;
 		}
-		
+
 		if (!isValidVM()) {
 			getWizard().setMessage(Messages.jvmWarning,
 					IMessageProvider.WARNING);
 			return;
 		}
-		
+
 		getWizard().setMessage(null, IMessageProvider.NONE);
-	
-		//validateDecorators();
+
+		// validateDecorators();
 	}
-	
+
 	private boolean isValidVM() {
 		String vmId = getRuntimeDelegate().getVMInstallId();
 		return vmId != null && vmId.startsWith("1.4");

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoUIPlugin.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoUIPlugin.java?rev=370822&r1=370821&r2=370822&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoUIPlugin.java (original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoUIPlugin.java Fri Jan 20 06:43:57 2006
@@ -16,6 +16,7 @@
 package org.apache.geronimo.ui.internal;
 
 import java.io.IOException;
+import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -36,9 +37,11 @@
 	private static String iconLocation;
 
 	private static GeronimoUIPlugin singleton;
-	
+
 	protected Map imageDescriptors = new HashMap();
 
+	public static final String IMG_WIZ_GERONIMO = "gServer";
+
 	/**
 	 * The constructor.
 	 */
@@ -69,10 +72,12 @@
 		}
 		return iconLocation;
 	}
-	
+
 	/**
 	 * Return the image with the given key from the image registry.
-	 * @param key java.lang.String
+	 * 
+	 * @param key
+	 *            java.lang.String
 	 * @return org.eclipse.jface.parts.IImage
 	 */
 	public static Image getImage(String key) {
@@ -81,7 +86,9 @@
 
 	/**
 	 * Return the image with the given key from the image registry.
-	 * @param key java.lang.String
+	 * 
+	 * @param key
+	 *            java.lang.String
 	 * @return org.eclipse.jface.parts.IImage
 	 */
 	public static ImageDescriptor getImageDescriptor(String key) {
@@ -92,11 +99,28 @@
 			return null;
 		}
 	}
-	
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry)
-     */
-    protected void initializeImageRegistry(ImageRegistry reg) {
-       
-    }
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry)
+	 */
+	protected void initializeImageRegistry(ImageRegistry reg) {
+		registerImage(reg, IMG_WIZ_GERONIMO, "g_server.gif");
+	}
+
+	private void registerImage(ImageRegistry registry, String key,
+			String partialURL) {
+
+		URL iconsURL = singleton.getBundle().getEntry(ICONS_DIRECTORY);
+
+		try {
+			ImageDescriptor id = ImageDescriptor.createFromURL(new URL(
+					iconsURL, partialURL));
+			registry.put(key, id);
+			imageDescriptors.put(key, id);
+		} catch (Exception e) {
+			Trace.trace(Trace.WARNING, "Error registering image", e);
+		}
+	}
 }