geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tki...@apache.org
Subject svn commit: r1068943 - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/ org.apache.geronimo.st...
Date Wed, 09 Feb 2011 15:48:04 GMT
Author: tkirby
Date: Wed Feb  9 15:48:03 2011
New Revision: 1068943

URL: http://svn.apache.org/viewvc?rev=1068943&view=rev
Log:
GERONIMODEVTOOLS-704 Provide a check box to clean server cache when start server from GEP.
Add --clean parameter when checked to clean the OSGi bundle cache.

Added:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetCleanOSGiBundleCacheCommand.java
  (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorCleanOSGiBundleCacheSection.java
  (with props)
Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorLogLevelSection.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorPublishAdvancedSection.java
    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.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/plugin.xml
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.properties
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Trace.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorLogLevelSection.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/ServerEditorLogLevelSection.java?rev=1068943&r1=1068942&r2=1068943&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorLogLevelSection.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorLogLevelSection.java
Wed Feb  9 15:48:03 2011
@@ -29,7 +29,6 @@ import org.eclipse.swt.widgets.Composite
 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.ui.editor.ServerEditorSection;
 
 /**
  * @version $Rev$ $Date$

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorPublishAdvancedSection.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/ServerEditorPublishAdvancedSection.java?rev=1068943&r1=1068942&r2=1068943&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorPublishAdvancedSection.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorPublishAdvancedSection.java
Wed Feb  9 15:48:03 2011
@@ -16,7 +16,6 @@
  */
 package org.apache.geronimo.st.ui.sections;
 
-import org.apache.geronimo.st.core.GeronimoServerDelegate;
 import org.apache.geronimo.st.ui.commands.SetPublishTimeoutCommand;
 import org.apache.geronimo.st.ui.internal.Messages;
 import org.eclipse.swt.SWT;

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=1068943&r1=1068942&r2=1068943&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
Wed Feb  9 15:48:03 2011
@@ -19,7 +19,6 @@ package org.apache.geronimo.st.ui.sectio
 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;

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java?rev=1068943&r1=1068942&r2=1068943&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java
Wed Feb  9 15:48:03 2011
@@ -28,9 +28,12 @@ import java.nio.channels.FileChannel;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.ListIterator;
 import java.util.Map;
+import java.util.Set;
 import java.util.Timer;
 
 import javax.enterprise.deploy.spi.Target;
@@ -140,12 +143,55 @@ abstract public class GeronimoServerBeha
             // exactly what we want the GEP user to see.
             wc.setAttribute(ERROR_SETUP_LAUNCH_CONFIGURATION, e.getMessage());
         }
-        String serverProgArgs = getServerDelegate().getConsoleLogLevel();
-        if (existingProgArgs == null || existingProgArgs.indexOf(serverProgArgs) < 0)
{
-            wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, serverProgArgs);
+        String serverProgramArgs = getServerProgramArgs(existingProgArgs, getServerDelegate());
+        Trace.tracePoint("GeronimoServerBehaviourDelegate.v30", "setupLaunchConfiguration
serverProgramArgs",
+                serverProgramArgs);
+        wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, serverProgramArgs);
+
+        String vmArgs = getServerDelegate().getVMArgs();
+        Trace.tracePoint("GeronimoServerBehaviourDelegate.v30", "setupLaunchConfiguration
serverVMArgs", vmArgs);
+        wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, vmArgs);
+    }
+
+    /**
+     * remove args no longer specified, add newly specified args, and only specify them once.
+     * @param existingProgArgs
+     * @param serverDelegate
+     * @return
+     */
+    private String getServerProgramArgs(String existingProgArgs, GeronimoServerDelegate serverDelegate)
{
+        List<String> parms = new ArrayList<String>(Arrays.asList(existingProgArgs.split("\\s+")));
+        Set<String> parmsSet = serverDelegate.getProgramArgs();
+        Set<String> parmsNotSet = serverDelegate.getProgramArgsNotSet();
+        Set<String> parmsSeen = new HashSet<String>(parmsSet.size());
+        // remove notSet and duplicate set paramaters from the list
+        for(ListIterator<String> iterator = parms.listIterator(); iterator.hasNext();)
{
+            String parm = iterator.next();
+            if (parmsNotSet.contains(parm) || parmsSeen.contains(parm)) {
+                iterator.remove();
+                continue;
+            }
+            if (parmsSet.contains(parm)) {
+                parmsSet.remove(parm);
+                parmsSeen.add(parm);
+            }
+        }
+        StringBuffer sb = new StringBuffer();
+        // add new parms to front
+        for (String parm : parmsSet) {
+            if (sb.length() > 0) {
+                sb.append(" ");
+            }
+            sb.append(parm);
+        }
+        // valid existing parms
+        for (String parm : parms) {
+            if (sb.length() > 0) {
+                sb.append(" ");
+            }
+            sb.append(parm);
         }
-        
-        wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, getServerDelegate().getVMArgs());
+        return sb.toString();
     }
 
 

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java?rev=1068943&r1=1068942&r2=1068943&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java
Wed Feb  9 15:48:03 2011
@@ -20,8 +20,10 @@ import java.io.IOException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.jar.Attributes;
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
@@ -68,6 +70,8 @@ abstract public class GeronimoServerDele
 
     public static final String PROPERTY_HTTP_PORT = "WebConnector";
 
+    public static final String PROPERTY_CLEAN_OSGI_BUNDLE_CACHE = "cleanOSGiBundleCache";
+
     public static final String PROPERTY_LOG_LEVEL = "logLevel";
     
     public static final String PROPERTY_VM_ARGS = "VMArgs";
@@ -93,6 +97,8 @@ abstract public class GeronimoServerDele
     public static final String CONSOLE_INFO = "--long";
 
     public static final String CONSOLE_DEBUG = "-vv";
+    
+    public static final String CLEAN_OSGI_BUNDLE_CACHE = "--clean";
 
     public abstract String getContextRoot(IModule module) throws Exception ;
 
@@ -298,6 +304,7 @@ abstract public class GeronimoServerDele
         setHTTPPort("8080");
         setRMINamingPort("1099");
         setConsoleLogLevel(CONSOLE_INFO);
+        setCleanOSGiBundleCache("");
         setPingDelay(new Integer(10000));
         setMaxPings(new Integer(40));
         setPingInterval(new Integer(5000));
@@ -363,6 +370,39 @@ abstract public class GeronimoServerDele
     }
     
     
+    public String getCleanOSGiBundleCache() {
+        return getInstanceProperty(PROPERTY_CLEAN_OSGI_BUNDLE_CACHE);
+    }
+
+    public void setCleanOSGiBundleCache(String value) {
+        setInstanceProperty(PROPERTY_CLEAN_OSGI_BUNDLE_CACHE, value);
+    }
+
+    public Set<String> getProgramArgs() {
+        Set<String> parms = new HashSet<String>(2);
+        parms.add(getConsoleLogLevel());
+        String clean = getCleanOSGiBundleCache();
+        if (clean.length() > 0) {
+            parms.add(clean);
+        }
+        return parms;
+    }
+
+    public Set<String> getProgramArgsNotSet() {
+        Set<String> notParms = new HashSet<String>(2);
+        String logLevel = getConsoleLogLevel();
+        if (logLevel.equals(CONSOLE_INFO)) {
+            notParms.add(CONSOLE_DEBUG);
+        } else {
+            notParms.add(CONSOLE_INFO);
+        }
+        String clean = getCleanOSGiBundleCache();
+        if (clean.equals("")) {
+            notParms.add(CLEAN_OSGI_BUNDLE_CACHE);
+        }
+        return notParms;
+    }
+
     // 
     // PROPERTY_VM_ARGS
     // 

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/plugin.xml?rev=1068943&r1=1068942&r2=1068943&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/plugin.xml
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/plugin.xml
Wed Feb  9 15:48:03 2011
@@ -142,6 +142,14 @@
     </extension>
     
     <extension point="org.eclipse.wst.server.ui.editorPageSections">
+        <section id="org.apache.server.geronimo.cleanOSGiBundleCache" order="20"
+            insertionId="org.eclipse.wst.server.editor.overview.right"
+            typeIds="org.apache.geronimo.server.30"
+            class="org.apache.geronimo.st.v30.ui.sections.ServerEditorCleanOSGiBundleCacheSection">
+        </section>
+    </extension>
+    
+    <extension point="org.eclipse.wst.server.ui.editorPageSections">
         <section id="org.apache.server.geronimo.loglevel" order="20"
             insertionId="org.eclipse.wst.server.editor.overview.right"
             typeIds="org.apache.geronimo.server.30"

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetCleanOSGiBundleCacheCommand.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/commands/SetCleanOSGiBundleCacheCommand.java?rev=1068943&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetCleanOSGiBundleCacheCommand.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetCleanOSGiBundleCacheCommand.java
Wed Feb  9 15:48:03 2011
@@ -0,0 +1,68 @@
+/*
+ * 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.v30.ui.commands;
+
+import org.apache.geronimo.st.v30.core.GeronimoServerDelegate;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class SetCleanOSGiBundleCacheCommand extends ServerCommand {
+
+    String value;
+
+    String oldValue;
+
+    /**
+     * @param server
+     * @param name
+     */
+    public SetCleanOSGiBundleCacheCommand(IServerWorkingCopy server, String value) {
+        super(server, "SetCleanOSGiBundleCacheCommand");
+        this.value = value;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.st.v30.ui.commands.ServerCommand#execute()
+     */
+    public void execute() {
+        GeronimoServerDelegate gs = getGeronimoServer();
+        oldValue = gs.getCleanOSGiBundleCache();
+        gs.setCleanOSGiBundleCache(value);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.st.v30.ui.commands.ServerCommand#undo()
+     */
+    public void undo() {
+        getGeronimoServer().setCleanOSGiBundleCache(oldValue);
+    }
+
+    private GeronimoServerDelegate getGeronimoServer() {
+        GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class);
+        if (gs == null) {
+            gs = (GeronimoServerDelegate) server.loadAdapter(GeronimoServerDelegate.class,
new NullProgressMonitor());
+        }
+        return gs;
+    }
+}

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

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetCleanOSGiBundleCacheCommand.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.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/Messages.java?rev=1068943&r1=1068942&r2=1068943&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.java
Wed Feb  9 15:48:03 2011
@@ -42,6 +42,10 @@ public class Messages extends NLS {
     public static String editorSectionVMArgsDescription;
     public static String editorSectionStartupTitle;
     public static String editorSectionStartupDescription;
+    
+    public static String editorSectionCleanOSGiBundleCacheTitle;
+    public static String editorSectionCleanOSGiBundleCacheDescription;
+    public static String cleanOSGiBundleCache;
 
     public static String editorSectionTestEnvTitle;
     public static String editorSectionTestEnvDescription;

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.properties
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/Messages.properties?rev=1068943&r1=1068942&r2=1068943&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.properties
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.properties
Wed Feb  9 15:48:03 2011
@@ -90,6 +90,10 @@ editorSectionLogLevelDescription=Select 
 info=INFO
 debug=DEBUG
 
+editorSectionCleanOSGiBundleCacheTitle=Clean OSGi bundle cache
+editorSectionCleanOSGiBundleCacheDescription=Select whether to clean the OSGi bundle cache.
+cleanOSGiBundleCache=Clean OSGi bundle cache.
+
 editorSectionVMArgsTitle=Server VM Arguments
 editorSectionVMArgsDescription=Specify the Java VM Arguments to be provided on server startup.
 
@@ -432,7 +436,7 @@ browseSrcDialog=Select the Geronimo Sour
 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
+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

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Trace.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/Trace.java?rev=1068943&r1=1068942&r2=1068943&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Trace.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Trace.java
Wed Feb  9 15:48:03 2011
@@ -17,7 +17,6 @@
 package org.apache.geronimo.st.v30.ui.internal;
 
 import org.apache.geronimo.st.v30.ui.Activator;
-import org.eclipse.core.runtime.IStatus;
 
 /**
  * Helper class to route trace output.

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorCleanOSGiBundleCacheSection.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/sections/ServerEditorCleanOSGiBundleCacheSection.java?rev=1068943&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorCleanOSGiBundleCacheSection.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorCleanOSGiBundleCacheSection.java
Wed Feb  9 15:48:03 2011
@@ -0,0 +1,88 @@
+/*
+ * 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.v30.ui.sections;
+
+import org.apache.geronimo.st.v30.core.GeronimoServerDelegate;
+import org.apache.geronimo.st.v30.ui.commands.SetCleanOSGiBundleCacheCommand;
+import org.apache.geronimo.st.v30.ui.internal.Messages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ServerEditorCleanOSGiBundleCacheSection extends AbstractServerEditorSection
{
+
+    Button cleanOGSiBundelCache;
+
+    public ServerEditorCleanOSGiBundleCacheSection() {
+        super();
+    }
+
+    public void createSection(Composite parent) {
+        super.createSection(parent);
+
+        FormToolkit toolkit = getFormToolkit(parent.getDisplay());
+
+        Section section = toolkit.createSection(parent, ExpandableComposite.TWISTIE
+                | ExpandableComposite.EXPANDED
+                | ExpandableComposite.TITLE_BAR
+                | Section.DESCRIPTION | ExpandableComposite.FOCUS_TITLE);
+
+        section.setText(Messages.editorSectionCleanOSGiBundleCacheTitle);
+        section.setDescription(Messages.editorSectionCleanOSGiBundleCacheDescription);
+        section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+
+        Composite composite = toolkit.createComposite(section);
+        GridLayout layout = new GridLayout();
+        layout.numColumns = 1;
+        layout.marginHeight = 5;
+        layout.marginWidth = 10;
+        layout.verticalSpacing = 5;
+        layout.horizontalSpacing = 15;
+        composite.setLayout(layout);
+        composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+        section.setClient(composite);
+
+        cleanOGSiBundelCache = toolkit.createButton(composite, Messages.cleanOSGiBundleCache,
SWT.CHECK);
+
+        String currentValue = ((GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class))
+                .getCleanOSGiBundleCache();
+        cleanOGSiBundelCache.setSelection(GeronimoServerDelegate.CLEAN_OSGI_BUNDLE_CACHE.equals(currentValue));
+
+        cleanOGSiBundelCache.addSelectionListener(new SelectionListener() {
+
+            public void widgetSelected(SelectionEvent e) {
+                String value = cleanOGSiBundelCache.getSelection() ? GeronimoServerDelegate.CLEAN_OSGI_BUNDLE_CACHE
+                        : "";
+                execute(new SetCleanOSGiBundleCacheCommand(server, value));
+            }
+
+            public void widgetDefaultSelected(SelectionEvent e) {
+            }
+
+        });
+    }
+}

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

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorCleanOSGiBundleCacheSection.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision



Mime
View raw message