[367460] ServerEditorSection has no ability to take alternative action on doSave(etc)
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorPart.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorPart.java
index c43804e..3229a1f 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorPart.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorPart.java
@@ -15,6 +15,7 @@
import org.eclipse.core.commands.operations.IUndoableOperation;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorInput;
@@ -23,6 +24,7 @@
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.part.EditorPart;
import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.ui.internal.Messages;
import org.eclipse.wst.server.ui.internal.Trace;
import org.eclipse.wst.server.ui.internal.editor.*;
/**
@@ -69,14 +71,21 @@
* @see org.eclipse.ui.IEditorPart#doSave(IProgressMonitor)
*/
public void doSave(IProgressMonitor monitor) {
- // do nothing
+ List<ServerEditorSection> curSections = getSections();
+ int ticks = 100;
+ monitor.beginTask(Messages.savingTask, curSections.size() * ticks);
+ for (ServerEditorSection section: curSections) {
+ section.doSave(new SubProgressMonitor(monitor, ticks));
+ }
}
/**
* @see org.eclipse.ui.IEditorPart#doSaveAs()
*/
public void doSaveAs() {
- // do nothing
+ for (ServerEditorSection section: getSections()) {
+ section.doSaveAs();
+ }
}
/**
@@ -193,7 +202,7 @@
return status;
}
- private List getSections() {
+ private List<ServerEditorSection> getSections() {
if (sections == null) {
sections = new ArrayList<ServerEditorSection>();
sectionToInsertionId = new HashMap<String, List<ServerEditorSection>>();
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorSection.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorSection.java
index 0b70aad..007753c 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorSection.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorSection.java
@@ -11,6 +11,7 @@
package org.eclipse.wst.server.ui.editor;
import org.eclipse.core.commands.operations.IUndoableOperation;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.swt.widgets.Composite;
@@ -168,6 +169,21 @@
}
/**
+ * Allow a section an opportunity to respond to a doSave request on the editor.
+ * @param monitor the progress monitor for the save operation.
+ */
+ public void doSave(IProgressMonitor monitor) {
+ monitor.worked(100);
+ }
+
+ /**
+ * Allow a section an opportunity to respond to a doSaveAs request on the editor.
+ */
+ public void doSaveAs() {
+ // do nothing
+ }
+
+ /**
* Disposes of the section.
*/
public void dispose() {
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.java
index 2038cba..b7350a3 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.java
@@ -302,6 +302,7 @@
public static String serverEditorOverviewServerNameCommand;
public static String serverEditorOverviewRuntimeCommand;
public static String serverEditorOverviewOpenLaunchConfiguration;
+ public static String serverEditorSaving;
public static String errorMissingConfiguration;
public static String errorConfigurationNotAccessible;
public static String viewStatusStarting4;
@@ -361,7 +362,7 @@
public static String audioUnknown;
public static String audioNone;
public static String audioDefault;
-
+
public static String internalWebBrowserName;
static {
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.properties b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.properties
index d001a26..0f89150 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.properties
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.properties
@@ -461,6 +461,8 @@
serverEditorOverviewTimeoutCommand=modify timeout settings
serverEditorOverviewOpenLaunchConfiguration=Open launch configuration
+serverEditorSaving=Performing server save operation.
+
# Menu items. {0} will be replaced by one of the xxxEditorActionXxx fields
# from below. @Ctrl+Z is the menu mnemonic
editorUndoEnabled=Undo {0}@Ctrl+Z
@@ -493,7 +495,6 @@
editorResourceWarnTitle=Server Modification Warning
editorResourceWarnMessage=The server you are modifying is read-only. All changes will be lost because the server cannot be saved.
-
audioPrefSelectFile=Select Audio File
audioPrefEnable=&Enable sounds
audioPrefVolume=&Volume: