geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcco...@apache.org
Subject svn commit: r797732 - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/ org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/ org.apache.geronimo.st.ui/src/m...
Date Sat, 25 Jul 2009 09:42:05 GMT
Author: mcconne
Date: Sat Jul 25 09:42:04 2009
New Revision: 797732

URL: http://svn.apache.org/viewvc?rev=797732&view=rev
Log:
GERONIMODEVTOOLS-580 No redeployment required when only JSP files are modified -- Thanks to
Delos Dai for this patch !!

Added:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/SetNotRedeployJSPFilesCommand.java
  (with props)
Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/DeploymentUtils.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoServerDelegate.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/IGeronimoServer.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorTestEnvSection.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoServer.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/DeploymentUtils.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/DeploymentUtils.java?rev=797732&r1=797731&r2=797732&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/DeploymentUtils.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/DeploymentUtils.java
Sat Jul 25 09:42:04 2009
@@ -17,6 +17,8 @@
 package org.apache.geronimo.st.core;
 
 import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.enterprise.deploy.spi.DeploymentManager;
 import javax.enterprise.deploy.spi.TargetModuleID;
@@ -47,6 +49,9 @@
 import org.eclipse.wst.server.core.IServer;
 import org.eclipse.wst.server.core.model.IModuleResource;
 import org.eclipse.wst.server.core.util.ProjectModule;
+import org.eclipse.wst.server.core.model.IModuleResourceDelta;
+import org.eclipse.wst.server.core.model.IModuleFile;
+import org.eclipse.wst.server.core.model.IModuleFolder;
 
 /**
  * @version $Rev$ $Date$
@@ -225,5 +230,28 @@
 		
 		return null;
 	}
+    
+    
+    public static List<IModuleResourceDelta> getAffectedJSPFiles(IModuleResourceDelta
delta) {
+        if (delta == null) return null;
+
+        IModuleResource resource = delta.getModuleResource();
+        List<IModuleResourceDelta> fileList = new ArrayList<IModuleResourceDelta>();
+
+        if (resource instanceof IModuleFile) {
+            IModuleFile moduleFile = (IModuleFile)resource;
+            if (moduleFile.getName().endsWith(".jsp")) {
+                fileList.add(delta);
+            }
+            else return null;   //not only jsp changed
+        }
+        else if (resource instanceof IModuleFolder) {
+            IModuleResourceDelta[] deltaArray = delta.getAffectedChildren();
+            for (IModuleResourceDelta childDelta: deltaArray) {
+                fileList.addAll(getAffectedJSPFiles(childDelta));
+            }
+        }
 
+        return fileList;
+    }
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java?rev=797732&r1=797731&r2=797732&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java
Sat Jul 25 09:42:04 2009
@@ -16,8 +16,16 @@
  */
 package org.apache.geronimo.st.core;
 
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.nio.MappedByteBuffer;
+import java.nio.channels.FileChannel;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -72,6 +80,8 @@
 import org.eclipse.wst.server.core.ServerEvent;
 import org.eclipse.wst.server.core.ServerPort;
 import org.eclipse.wst.server.core.internal.ProgressUtil;
+import org.eclipse.wst.server.core.model.IModuleFile;
+import org.eclipse.wst.server.core.model.IModuleResourceDelta;
 import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
 import org.eclipse.wst.server.core.util.SocketUtil;
 
@@ -499,6 +509,14 @@
 		if(configId != null) {
 			String moduleConfigId = getConfigId(module);
 			if(moduleConfigId.equals(configId)) {
+				
+				if (this.getServerDelegate().isNotRedeployJSPFiles()&&!this.isRemote() &&
GeronimoUtils.isWebModule(module)
+						&& !module.isExternal()) {
+					// if only jsp files changed, no redeploy needed
+					if (findAndReplaceJspFiles(module, configId))
+						return;
+				}
+				
 				IStatus status = reDeploy(module);
 				if (!status.isOK()) {
 					doFail(status, Messages.REDEPLOY_FAIL);
@@ -516,6 +534,119 @@
         Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.doChanged");
 	}
 
+    
+    
+    /*
+     * This method is used to replace updated JSP files without deploy it. 
+     */
+    private boolean findAndReplaceJspFiles(IModule module, String configId)
+            throws CoreException {
+        IModule[] modules = { module };
+        IModuleResourceDelta[] deltaArray = this
+                .getPublishedResourceDelta(modules);
+
+        // get repository position
+        String ch = File.separator;
+        String repositoryLocation = this.getRuntimeDelegate().getRuntime()
+                .getLocation().toOSString()
+                + ch + "repository" + ch;
+        // Suppose directory structure of deployed module is
+        // "repository/[groupID]/[artifactId]/[version]/[artifactId]-[version].[artifactType]"
+        // configId contains the groupID,artifactId,version,artifactType
+        String[] segments = configId.split("/");
+        // groupId may contains "." as separator
+        String groupId = null;
+        if (segments[0]!=null)
+            groupId=segments[0].replace(".", "/");
+        String moduleTargetPath = repositoryLocation.concat(groupId)
+                        .concat(ch).concat(segments[1]).concat(ch).concat(segments[2])
+                        .concat(ch).concat(segments[1]).concat("-").concat(segments[2])
+                        .concat(".").concat(segments[3]);
+
+        List<IModuleResourceDelta> jspFiles = new ArrayList<IModuleResourceDelta>();
+        for (IModuleResourceDelta delta : deltaArray) {
+            List<IModuleResourceDelta> partJspFiles= DeploymentUtils
+                    .getAffectedJSPFiles(delta);
+            //if not only Jsp files found, need to redeploy the module, so return false;
+            if (partJspFiles == null) return false;
+            else jspFiles.addAll(partJspFiles);
+        }
+            for (IModuleResourceDelta deltaModule : jspFiles) {
+                IModuleFile moduleFile = (IModuleFile) deltaModule
+                        .getModuleResource();
+
+                String target;
+                String relativePath = moduleFile.getModuleRelativePath()
+                        .toOSString();
+                if (relativePath != null && relativePath.length() != 0) {
+                    target = moduleTargetPath.concat(ch).concat(relativePath)
+                            .concat(ch).concat(moduleFile.getName());
+                } else
+                    target = moduleTargetPath.concat(ch).concat(
+                            moduleFile.getName());
+
+                File file = new File(target);
+                switch (deltaModule.getKind()) {
+                case IModuleResourceDelta.REMOVED:
+                    if (file.exists())
+                        file.delete();
+                    break;
+                case IModuleResourceDelta.ADDED:
+                case IModuleResourceDelta.CHANGED:
+                    if (!file.exists())
+                        try {
+                            file.createNewFile();
+                        } catch (IOException e) {
+                            Trace.trace(Trace.SEVERE, "can't create file "
+                                    + file, e);
+                            throw new CoreException(new Status(IStatus.ERROR,
+                                    Activator.PLUGIN_ID, "can't create file "
+                                            + file, e));
+                        }
+
+                    String rootFolder = GeronimoUtils.getVirtualComponent(
+                            module).getRootFolder().getProjectRelativePath()
+                            .toOSString();
+                    String sourceFile = module.getProject().getFile(
+                            rootFolder + ch
+                                    + moduleFile.getModuleRelativePath() + ch
+                                    + moduleFile.getName()).getLocation()
+                            .toString();
+                    try {
+
+                        FileInputStream in = new FileInputStream(sourceFile);
+                        FileOutputStream out = new FileOutputStream(file);
+                        FileChannel inChannel = in.getChannel();
+                        FileChannel outChannel = out.getChannel();
+                        MappedByteBuffer mappedBuffer = inChannel.map(
+                                FileChannel.MapMode.READ_ONLY, 0, inChannel
+                                        .size());
+                        outChannel.write(mappedBuffer);
+
+                        inChannel.close();
+                        outChannel.close();
+                    } catch (FileNotFoundException e) {
+                        Trace.trace(Trace.SEVERE, "can't find file "
+                                + sourceFile, e);
+                        throw new CoreException(new Status(IStatus.ERROR,
+                                Activator.PLUGIN_ID, "can't find file "
+                                        + sourceFile, e));
+                    } catch (IOException e) {
+                        Trace.trace(Trace.SEVERE, "can't copy file "
+                                + sourceFile, e);
+                        throw new CoreException(new Status(IStatus.ERROR,
+                                Activator.PLUGIN_ID, "can't copy file "
+                                        + sourceFile, e));
+                    }
+                    break;
+                }
+            }
+
+        return true;
+
+    }
+
+
 	private String getLastKnowConfigurationId(IModule module, String configId) throws CoreException
{
         Trace.tracePoint("Entry ", "GeronimoServerBehaviourDelegate.getLastKnowConfigurationId",
module.getName(), configId);
 

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoServerDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoServerDelegate.java?rev=797732&r1=797731&r2=797732&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoServerDelegate.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoServerDelegate.java
Sat Jul 25 09:42:04 2009
@@ -70,7 +70,9 @@
 	public static final String PROPERTY_PUBLISH_TIMEOUT = "publishTimeout";
 	
 	public static final String PROPERTY_IN_PLACE_SHARED_LIB = "inPlaceSharedLib";
-	
+    
+    public static final String PROPERTY_NOT_REDEPLOY_JSP_FILES = "notRedeployJSPFiles";
+    
 	public static final String PROPERTY_RUN_FROM_WORKSPACE = "runFromWorkspace";
 
 	public static final String PROPERTY_SELECT_CLASSPATH_CONTAINERS = "selectClasspathContainers";
@@ -81,7 +83,7 @@
 
 	public static final String CONSOLE_DEBUG = "-vv";
 
-	public abstract String getContextRoot(IModule module);
+    public abstract String getContextRoot(IModule module) throws Exception ;
 
 	/*
 	 * (non-Javadoc)
@@ -365,7 +367,11 @@
 	public void setInPlaceSharedLib(boolean enable) {
 		setAttribute(PROPERTY_IN_PLACE_SHARED_LIB, enable);
 	}
-	
+
+    public void setNotRedeployJSPFiles(boolean enable){
+        setAttribute(PROPERTY_NOT_REDEPLOY_JSP_FILES,enable);
+    }
+
 	public void setRunFromWorkspace(boolean enable) {
 		setAttribute(PROPERTY_RUN_FROM_WORKSPACE, enable);
 	}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/IGeronimoServer.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/IGeronimoServer.java?rev=797732&r1=797731&r2=797732&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/IGeronimoServer.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/IGeronimoServer.java
Sat Jul 25 09:42:04 2009
@@ -47,6 +47,8 @@
 
 	public IGeronimoVersionHandler getVersionHandler();
 	
+	public boolean isNotRedeployJSPFiles();	
+	
 	public boolean isInPlaceSharedLib();
 	
 	public boolean isRunFromWorkspace();

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/SetNotRedeployJSPFilesCommand.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/SetNotRedeployJSPFilesCommand.java?rev=797732&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/SetNotRedeployJSPFilesCommand.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/SetNotRedeployJSPFilesCommand.java
Sat Jul 25 09:42:04 2009
@@ -0,0 +1,61 @@
+/*
+ * 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.st.ui.commands;
+
+import org.apache.geronimo.st.core.GeronimoServerDelegate;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class SetNotRedeployJSPFilesCommand extends ServerCommand {
+
+    boolean value;
+
+    boolean oldValue;
+
+    /**
+     * @param server
+     * @param name
+     */
+    public SetNotRedeployJSPFilesCommand(IServerWorkingCopy server, boolean value) {
+        super(server, "SetRunFromWorkspaceCommand");
+        this.value = value;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.st.ui.commands.ServerCommand#execute()
+     */
+    public void execute() {
+        GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class);
+        oldValue = gs.isNotRedeployJSPFiles();
+        gs.setNotRedeployJSPFiles(value);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.st.ui.commands.ServerCommand#undo()
+     */
+    public void undo() {
+        GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class);
+        gs.setNotRedeployJSPFiles(oldValue);
+    }
+
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/SetNotRedeployJSPFilesCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java?rev=797732&r1=797731&r2=797732&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java
Sat Jul 25 09:42:04 2009
@@ -45,11 +45,14 @@
 
     public static String editorSectionTestEnvTitle;
     public static String editorSectionTestEnvDescription;
+    public static String editorSectionNotRedeployJSPFiles;
     public static String editorSectionRunFromWorkspace;
     public static String editorSectionSharedLibrariesInPlace;
     public static String editorSectionSelectClasspathContainers;
     public static String editorSectionPublishAdvancedTitle;
     public static String editorSectionPublishAdvancedDescription;
+    public static String notRedeployJSPFilesReminder;
+    public static String notRedeployJSPFilesInformation;
 
     public static String publishingTimeout;
     public static String info;

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties?rev=797732&r1=797731&r2=797732&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties
Sat Jul 25 09:42:04 2009
@@ -374,10 +374,13 @@
 editorSectionTestEnvTitle=Test Environment
 editorSectionTestEnvDescription=Configure local test environment options.
 editorSectionSharedLibrariesInPlace=Enable in-place shared library support.
+editorSectionNotRedeployJSPFiles=No re-deployment when only JSP files are updated
 editorSectionRunFromWorkspace=Run modules directly from workspace.
 editorSectionSelectClasspathContainers=Select the workspace classpath containers to be provided
to the server.
 editorSectionPublishAdvancedTitle=Publish Advanced
 editorSectionPublishAdvancedDescription=Additional options for publishing.
+notRedeployJSPFilesReminder = Important 
+notRedeployJSPFilesInformation = You must enable \"Development Mode\" of your server's JSP
compiler for this to function properly. 
 
 publishingTimeout=Publishing Timeout (ms):
 artifactType=Artifact Type:

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorTestEnvSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorTestEnvSection.java?rev=797732&r1=797731&r2=797732&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorTestEnvSection.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorTestEnvSection.java
Sat Jul 25 09:42:04 2009
@@ -19,15 +19,18 @@
 import java.util.List;
 
 import org.apache.geronimo.st.core.ClasspathContainersHelper;
+import org.apache.geronimo.st.core.GeronimoServerBehaviourDelegate;
+import org.apache.geronimo.st.ui.commands.SetClasspathContainersCommand;
 import org.apache.geronimo.st.ui.commands.SetInPlaceSharedLibCommand;
+import org.apache.geronimo.st.ui.commands.SetNotRedeployJSPFilesCommand;
 import org.apache.geronimo.st.ui.commands.SetRunFromWorkspaceCommand;
-import org.apache.geronimo.st.ui.commands.SetClasspathContainersCommand;
 import org.apache.geronimo.st.ui.commands.SetSelectClasspathContainersCommand;
 import org.apache.geronimo.st.ui.internal.Messages;
 import org.apache.geronimo.st.ui.internal.Trace;
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
 import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
 import org.eclipse.jface.viewers.ICheckStateListener;
 import org.eclipse.jface.viewers.LabelProvider;
 import org.eclipse.swt.SWT;
@@ -37,9 +40,12 @@
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.forms.widgets.ExpandableComposite;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.util.SocketUtil;
 
 /**
  * @version $Rev$ $Date$
@@ -48,6 +54,7 @@
 
     // SWT widget(s)
     private Button runFromWorkspace;
+    private Button noRedeployJSPFiles;
     private Button inPlaceSharedLib;
     private Button selectClasspathContainers = null;
     private Composite composite = null;
@@ -105,6 +112,30 @@
             }
 
         });
+        
+        //
+        // Don't redeploy JSP files Button
+        //
+        noRedeployJSPFiles = toolkit.createButton(composite, Messages.editorSectionNotRedeployJSPFiles,
SWT.CHECK);
+        noRedeployJSPFiles.setSelection(gs.isNotRedeployJSPFiles());
+        
+        noRedeployJSPFiles.setEnabled(!(server.getServerType().supportsRemoteHosts()
+                && !SocketUtil.isLocalhost(server.getHost()))&&gs.getServer().getServerState()==IServer.STATE_STOPPED);

+        noRedeployJSPFiles.addSelectionListener(new SelectionListener() {
+
+            public void widgetSelected(SelectionEvent e) {
+                execute(new SetNotRedeployJSPFilesCommand(server, noRedeployJSPFiles.getSelection()));
+                
+                if (noRedeployJSPFiles.getSelection()) {
+                    MessageDialog.openInformation(Display.getCurrent().getActiveShell(),

+                        Messages.notRedeployJSPFilesReminder, Messages.notRedeployJSPFilesInformation);
+                }
+            }
+
+            public void widgetDefaultSelected(SelectionEvent e) {
+            }
+
+        });
 
         //
         // runFromWorkspace Button
@@ -189,7 +220,7 @@
     //
     // CheckboxTableViewer: checkbox
     //
-	public void createCheckbox() {
+    public void createCheckbox() {
         Trace.tracePoint("ENTRY", "ServerEditorTestEnvSection.createCheckbox");
     
         if ( checkbox == null ) {
@@ -216,5 +247,5 @@
         }
 
         Trace.tracePoint("EXIT", "ServerEditorTestEnvSection.createCheckbox");
-	}
+    }
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoServer.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoServer.java?rev=797732&r1=797731&r2=797732&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoServer.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoServer.java
Sat Jul 25 09:42:04 2009
@@ -200,4 +200,7 @@
         setRunFromWorkspace(false);
     }
 
+    public boolean isNotRedeployJSPFiles() {
+        return getAttribute(PROPERTY_NOT_REDEPLOY_JSP_FILES,false);
+    }
 }
\ No newline at end of file



Mime
View raw message