geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hanhongf...@apache.org
Subject svn commit: r1074054 - in /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui: META-INF/MANIFEST.MF src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoRuntimeWizardFragment.java
Date Thu, 24 Feb 2011 07:02:50 GMT
Author: hanhongfang
Date: Thu Feb 24 07:02:49 2011
New Revision: 1074054

URL: http://svn.apache.org/viewvc?rev=1074054&view=rev
Log:
GERONIMODEVTOOLS-716 Automatically switch "target platform" to Geronimo

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/META-INF/MANIFEST.MF
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoRuntimeWizardFragment.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/META-INF/MANIFEST.MF?rev=1074054&r1=1074053&r2=1074054&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/META-INF/MANIFEST.MF
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/META-INF/MANIFEST.MF
Thu Feb 24 07:02:49 2011
@@ -34,6 +34,7 @@ Require-Bundle: 
  org.eclipse.wst.server.ui,
  org.eclipse.wst.sse.ui,
  org.eclipse.wst.xml.ui,
- org.eclipse.core.variables
+ org.eclipse.core.variables,
+ org.eclipse.pde.core
 Bundle-ActivationPolicy: lazy
 Bundle-Vendor: Apache Software Foundation

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoRuntimeWizardFragment.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoRuntimeWizardFragment.java?rev=1074054&r1=1074053&r2=1074054&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoRuntimeWizardFragment.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoRuntimeWizardFragment.java
Thu Feb 24 07:02:49 2011
@@ -53,6 +53,11 @@ import org.eclipse.jface.preference.IPre
 import org.eclipse.jface.preference.PreferenceDialog;
 import org.eclipse.jface.preference.PreferenceManager;
 import org.eclipse.jface.window.Window;
+import org.eclipse.pde.internal.core.PDECore;
+import org.eclipse.pde.internal.core.target.provisional.ITargetDefinition;
+import org.eclipse.pde.internal.core.target.provisional.ITargetHandle;
+import org.eclipse.pde.internal.core.target.provisional.ITargetPlatformService;
+import org.eclipse.pde.internal.core.target.provisional.LoadTargetDefinitionJob;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.BusyIndicator;
 import org.eclipse.swt.events.ModifyEvent;
@@ -447,6 +452,29 @@ public class GeronimoRuntimeWizardFragme
             
             copyFile(template, destination, getLocationEntryLists(geronimoServerLocation));
         }
+        
+        ITargetPlatformService service = (ITargetPlatformService)PDECore.getDefault().acquireService(
+                ITargetPlatformService.class.getName());
+        ITargetHandle activeTargetHandle = service.getWorkspaceTargetHandle();
+        ITargetHandle[] targetHandles = service.getTargets(null);
+        ITargetHandle geronimoTargetHandle = null;
+        for (ITargetHandle cur : targetHandles) {
+            if (cur.getTargetDefinition().getName().equals("Apache Geronimo 3.0")) {
+                geronimoTargetHandle = cur;
+            }
+        }
+        if (geronimoTargetHandle != null) {
+            boolean resetFlag = false;
+            if (activeTargetHandle == null ) {
+                resetFlag = true;
+            } else if (!activeTargetHandle.equals(geronimoTargetHandle)) {
+                resetFlag = true;
+            }                
+            if (resetFlag) {
+                ITargetDefinition geronimoTarget = geronimoTargetHandle.getTargetDefinition();
+                LoadTargetDefinitionJob.load(geronimoTarget);
+            }            
+        }
     }
     
     protected void copyFile(URL source, IPath dest, String replacement) throws CoreException
{



Mime
View raw message