geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bjr...@apache.org
Subject svn commit: r732383 - in /geronimo/devtools/eclipse-plugin: branches/2.1.4/plugins/org.apache.geronimo.st.ui/ branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/ branches/2.1.4/plugins/org.apache.geronimo....
Date Wed, 07 Jan 2009 16:27:33 GMT
Author: bjreed
Date: Wed Jan  7 08:27:32 2009
New Revision: 732383

URL: http://svn.apache.org/viewvc?rev=732383&view=rev
Log:
GERONIMODEVTOOLS-532.  Add way to change the publish tiemout to the overview page.  Thanks
to Delos Dai for the patch.

Added:
    geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/SetPublishTimeoutCommand.java
  (with props)
    geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorPublishAdvancedSection.java
  (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/SetPublishTimeoutCommand.java
  (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorPublishAdvancedSection.java
  (with props)
Modified:
    geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/plugin.xml
    geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java
    geronimo/devtools/eclipse-plugin/branches/2.1.4/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/plugin.xml
    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

Modified: geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/plugin.xml?rev=732383&r1=732382&r2=732383&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/plugin.xml
(original)
+++ geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/plugin.xml
Wed Jan  7 08:27:32 2009
@@ -123,6 +123,14 @@
     </extension>
     
     <extension point="org.eclipse.wst.server.ui.editorPageSections">
+        <section id="org.apache.server.geronimo.publishAdvanced" order="10"
+            insertionId="org.eclipse.wst.server.editor.overview.right"
+            typeIds="org.apache.geronimo.server.*"
+            class="org.apache.geronimo.st.ui.sections.ServerEditorPublishAdvancedSection">
+        </section>
+    </extension>
+    
+    <extension point="org.eclipse.wst.server.ui.editorPageSections">
         <section id="org.apache.server.geronimo.port" order="10"
             insertionId="org.eclipse.wst.server.editor.overview.right"
             typeIds="org.apache.geronimo.server.*"
@@ -201,12 +209,11 @@
     </extension>
     
     
-   <extension
-         point="org.apache.geronimo.st.ui.actionURLs">
-         <server_prefix>org.apache.geronimo.</server_prefix>
-         <action_URL class="org.apache.geronimo.st.ui.actions.LaunchGeronimoSupportAction"
-                     URL="http://geronimo.apache.org/" />
-   </extension>
+    <extension point="org.apache.geronimo.st.ui.actionURLs">
+        <server_prefix>org.apache.geronimo.</server_prefix>
+        <action_URL class="org.apache.geronimo.st.ui.actions.LaunchGeronimoSupportAction"
+                    URL="http://geronimo.apache.org/" />
+    </extension>
    
     
 </plugin>

Added: geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/SetPublishTimeoutCommand.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/SetPublishTimeoutCommand.java?rev=732383&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/SetPublishTimeoutCommand.java
(added)
+++ geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/SetPublishTimeoutCommand.java
Wed Jan  7 08:27:32 2009
@@ -0,0 +1,57 @@
+/*
+ * 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$
+ *
+ * Command to change the server's auto-publish setting.
+ */
+public class SetPublishTimeoutCommand extends ServerCommand {
+    protected long timeOut;
+    protected long oldTimeOut;
+
+    /**
+     * SetServerAutoPublishDefaultCommand constructor.
+     *
+     * @param server a server
+     * @param time a publish time
+     */
+    public SetPublishTimeoutCommand(IServerWorkingCopy server, long timeOut) {
+        super(server, "SetServerAutoPublishTimeOutCommand");
+        this.timeOut = timeOut;
+    }
+
+    /**
+     * Execute the command.
+     */
+    public void execute() {
+        GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class);
+        oldTimeOut = gs.getPublishTimeout();
+        gs.setPublishTimeout(timeOut);
+    }
+
+    /**
+     * Undo the command.
+     */
+    public void undo() {
+        GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class);
+        gs.setPublishTimeout(oldTimeOut);
+    }
+}

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

Propchange: geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/SetPublishTimeoutCommand.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/SetPublishTimeoutCommand.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/devtools/eclipse-plugin/branches/2.1.4/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/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java?rev=732383&r1=732382&r2=732383&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java
(original)
+++ geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java
Wed Jan  7 08:27:32 2009
@@ -48,7 +48,10 @@
     public static String editorSectionRunFromWorkspace;
     public static String editorSectionSharedLibrariesInPlace;
     public static String editorSectionSelectClasspathContainers;
+    public static String editorSectionPublishAdvancedTitle;
+    public static String editorSectionPublishAdvancedDescription;
 
+    public static String publishingTimeout;
     public static String info;
     public static String debug;
     public static String httpPort;

Modified: geronimo/devtools/eclipse-plugin/branches/2.1.4/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/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties?rev=732383&r1=732382&r2=732383&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties
(original)
+++ geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties
Wed Jan  7 08:27:32 2009
@@ -374,7 +374,10 @@
 editorSectionSharedLibrariesInPlace=Enable in-place shared library support.
 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.
 
+publishingTimeout=Publishing Timeout (ms):
 artifactType=Artifact Type:
 inverseClassloading=Inverse classloading
 supressDefaultEnv=Suppress default environment

Added: geronimo/devtools/eclipse-plugin/branches/2.1.4/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/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorPublishAdvancedSection.java?rev=732383&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorPublishAdvancedSection.java
(added)
+++ geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorPublishAdvancedSection.java
Wed Jan  7 08:27:32 2009
@@ -0,0 +1,122 @@
+/*
+ * 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.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.core.runtime.NullProgressMonitor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Spinner;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.forms.IFormColors;
+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$
+ */
+public class ServerEditorPublishAdvancedSection extends ServerEditorSection {
+
+    protected Spinner publishTimeout;
+
+    GeronimoServerDelegate gs;
+
+    public ServerEditorPublishAdvancedSection() {
+        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.editorSectionPublishAdvancedTitle);
+        section.setDescription(Messages.editorSectionPublishAdvancedDescription);
+        section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+
+        Composite composite = toolkit.createComposite(section);
+        GridLayout layout = new GridLayout();
+        layout.numColumns = 2;
+        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);
+
+        // ------- Label and text field for the http port -------
+        createLabel(composite, Messages.publishingTimeout, toolkit);
+
+        publishTimeout = new Spinner(composite, SWT.BORDER);
+        publishTimeout.setMinimum(0);
+        publishTimeout.setIncrement(5);
+        publishTimeout.setMaximum(900000);
+        publishTimeout.setSelection(getPublishTimeout());
+
+        publishTimeout.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                execute(new SetPublishTimeoutCommand(server, publishTimeout.getSelection()));
+            }
+        });
+    }
+
+    protected Label createLabel(Composite parent, String text,
+            FormToolkit toolkit) {
+        Label label = toolkit.createLabel(parent, text);
+        label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+        label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+        return label;
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.eclipse.wst.server.ui.editor.ServerEditorSection#init(org.eclipse.ui.IEditorSite,
+     *      org.eclipse.ui.IEditorInput)
+     */
+    public void init(IEditorSite site, IEditorInput input) {
+        super.init(site, input);
+        gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class);
+        if (gs == null) {
+            gs = (GeronimoServerDelegate) server.loadAdapter(GeronimoServerDelegate.class,
+                    new NullProgressMonitor());
+        }
+    }
+
+    private int getPublishTimeout() {
+        if (gs != null) {
+            return (int)gs.getPublishTimeout();
+        }
+        return 0;
+    }
+}

Propchange: geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorPublishAdvancedSection.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorPublishAdvancedSection.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorPublishAdvancedSection.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml?rev=732383&r1=732382&r2=732383&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml Wed
Jan  7 08:27:32 2009
@@ -127,6 +127,14 @@
     </extension>
     
     <extension point="org.eclipse.wst.server.ui.editorPageSections">
+        <section id="org.apache.server.geronimo.publishAdvanced" order="10"
+            insertionId="org.eclipse.wst.server.editor.overview.right"
+            typeIds="org.apache.geronimo.server.*"
+            class="org.apache.geronimo.st.ui.sections.ServerEditorPublishAdvancedSection">
+        </section>
+    </extension>
+    
+    <extension point="org.eclipse.wst.server.ui.editorPageSections">
         <section id="org.apache.server.geronimo.port" order="10"
             insertionId="org.eclipse.wst.server.editor.overview.right"
             typeIds="org.apache.geronimo.server.*"
@@ -203,16 +211,11 @@
             class="org.apache.geronimo.st.ui.internal.GeronimoLaunchConfigurationTabGroup">
         </launchConfigurationTabGroup>
     </extension>
-    
-    
-   <extension
-         point="org.apache.geronimo.st.ui.actionURLs">
-         <server_prefix>org.apache.geronimo.</server_prefix>
-         <action_URL class="org.apache.geronimo.st.ui.actions.LaunchGeronimoSupportAction"
-                     URL="http://geronimo.apache.org/" />
-   </extension>
-   
-    
-</plugin>
 
- 
\ No newline at end of file
+    <extension point="org.apache.geronimo.st.ui.actionURLs">
+        <server_prefix>org.apache.geronimo.</server_prefix>
+        <action_URL class="org.apache.geronimo.st.ui.actions.LaunchGeronimoSupportAction"
+                    URL="http://geronimo.apache.org/" />
+    </extension>
+ 
+</plugin>

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/SetPublishTimeoutCommand.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/SetPublishTimeoutCommand.java?rev=732383&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/SetPublishTimeoutCommand.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/SetPublishTimeoutCommand.java
Wed Jan  7 08:27:32 2009
@@ -0,0 +1,57 @@
+/*
+ * 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$
+ *
+ * Command to change the server's auto-publish setting.
+ */
+public class SetPublishTimeoutCommand extends ServerCommand {
+    protected long timeOut;
+    protected long oldTimeOut;
+
+    /**
+     * SetServerAutoPublishDefaultCommand constructor.
+     *
+     * @param server a server
+     * @param time a publish time
+     */
+    public SetPublishTimeoutCommand(IServerWorkingCopy server, long timeOut) {
+        super(server, "SetServerAutoPublishTimeOutCommand");
+        this.timeOut = timeOut;
+    }
+
+    /**
+     * Execute the command.
+     */
+    public void execute() {
+        GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class);
+        oldTimeOut = gs.getPublishTimeout();
+        gs.setPublishTimeout(timeOut);
+    }
+
+    /**
+     * Undo the command.
+     */
+    public void undo() {
+        GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class);
+        gs.setPublishTimeout(oldTimeOut);
+    }
+}

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

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

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/SetPublishTimeoutCommand.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

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=732383&r1=732382&r2=732383&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
Wed Jan  7 08:27:32 2009
@@ -48,7 +48,10 @@
     public static String editorSectionRunFromWorkspace;
     public static String editorSectionSharedLibrariesInPlace;
     public static String editorSectionSelectClasspathContainers;
+    public static String editorSectionPublishAdvancedTitle;
+    public static String editorSectionPublishAdvancedDescription;
 
+    public static String publishingTimeout;
     public static String info;
     public static String debug;
     public static String httpPort;

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=732383&r1=732382&r2=732383&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
Wed Jan  7 08:27:32 2009
@@ -374,7 +374,10 @@
 editorSectionSharedLibrariesInPlace=Enable in-place shared library support.
 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.
 
+publishingTimeout=Publishing Timeout (ms):
 artifactType=Artifact Type:
 inverseClassloading=Inverse classloading
 supressDefaultEnv=Suppress default environment

Added: 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=732383&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorPublishAdvancedSection.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorPublishAdvancedSection.java
Wed Jan  7 08:27:32 2009
@@ -0,0 +1,122 @@
+/*
+ * 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.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.core.runtime.NullProgressMonitor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Spinner;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.forms.IFormColors;
+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$
+ */
+public class ServerEditorPublishAdvancedSection extends ServerEditorSection {
+
+    protected Spinner publishTimeout;
+
+    GeronimoServerDelegate gs;
+
+    public ServerEditorPublishAdvancedSection() {
+        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.editorSectionPublishAdvancedTitle);
+        section.setDescription(Messages.editorSectionPublishAdvancedDescription);
+        section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+
+        Composite composite = toolkit.createComposite(section);
+        GridLayout layout = new GridLayout();
+        layout.numColumns = 2;
+        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);
+
+        // ------- Label and text field for the http port -------
+        createLabel(composite, Messages.publishingTimeout, toolkit);
+
+        publishTimeout = new Spinner(composite, SWT.BORDER);
+        publishTimeout.setMinimum(0);
+        publishTimeout.setIncrement(5);
+        publishTimeout.setMaximum(900000);
+        publishTimeout.setSelection(getPublishTimeout());
+
+        publishTimeout.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                execute(new SetPublishTimeoutCommand(server, publishTimeout.getSelection()));
+            }
+        });
+    }
+
+    protected Label createLabel(Composite parent, String text,
+            FormToolkit toolkit) {
+        Label label = toolkit.createLabel(parent, text);
+        label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+        label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+        return label;
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.eclipse.wst.server.ui.editor.ServerEditorSection#init(org.eclipse.ui.IEditorSite,
+     *      org.eclipse.ui.IEditorInput)
+     */
+    public void init(IEditorSite site, IEditorInput input) {
+        super.init(site, input);
+        gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class);
+        if (gs == null) {
+            gs = (GeronimoServerDelegate) server.loadAdapter(GeronimoServerDelegate.class,
+                    new NullProgressMonitor());
+        }
+    }
+
+    private int getPublishTimeout() {
+        if (gs != null) {
+            return (int)gs.getPublishTimeout();
+        }
+        return 0;
+    }
+}

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

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

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorPublishAdvancedSection.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message