diff options
author | pmoogk | 2007-03-15 20:16:25 +0000 |
---|---|---|
committer | pmoogk | 2007-03-15 20:16:25 +0000 |
commit | 77505e926effa5aacf49774ff9a00f687f0ac8f6 (patch) | |
tree | eb2a1edd180fc3e96ef02cfcc32db39a973dcac8 /bundles | |
parent | 39b54b0d514a34899933eb260eefe5e52c7d85c1 (diff) | |
download | webtools.webservices-77505e926effa5aacf49774ff9a00f687f0ac8f6.tar.gz webtools.webservices-77505e926effa5aacf49774ff9a00f687f0ac8f6.tar.xz webtools.webservices-77505e926effa5aacf49774ff9a00f687f0ac8f6.zip |
[176886] Updated framework to use the new BaseStatusHandler
Diffstat (limited to 'bundles')
10 files changed, 169 insertions, 73 deletions
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/server/StartServerWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/server/StartServerWidget.java index 47459296c..5e62fef92 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/server/StartServerWidget.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/server/StartServerWidget.java @@ -1,12 +1,15 @@ /******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. + * Copyright (c) 2005, 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: - * IBM Corporation - initial API and implementation + * IBM Corporation - initial API and implementation + * yyyymmdd bug Email and other contact information + * -------- -------- ----------------------------------------------------------- + * 20070314 176886 pmoogk@ca.ibm.com - Peter Moogk *******************************************************************************/ package org.eclipse.jst.ws.internal.consumption.ui.server; @@ -39,11 +42,11 @@ import org.eclipse.swt.widgets.Text; import org.eclipse.ui.PlatformUI; import org.eclipse.wst.command.internal.env.core.common.StatusUtils; import org.eclipse.wst.command.internal.env.core.context.TransientResourceContext; +import org.eclipse.wst.command.internal.env.eclipse.BaseStatusHandler; import org.eclipse.wst.command.internal.env.eclipse.EclipseEnvironment; import org.eclipse.wst.command.internal.env.ui.eclipse.EclipseStatusHandler; import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor; import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents; -import org.eclipse.wst.common.environment.NullStatusHandler; import org.eclipse.wst.server.core.IServer; public class StartServerWidget extends SimpleWidgetDataContributor @@ -292,7 +295,7 @@ public class StartServerWidget extends SimpleWidgetDataContributor protected IStatus run(IProgressMonitor monitor) { - NullStatusHandler handler = new NullStatusHandler(); + BaseStatusHandler handler = new BaseStatusHandler(); TransientResourceContext resourceContext = new TransientResourceContext(); EclipseEnvironment environment = new EclipseEnvironment( null,resourceContext, handler ); StartServerCommand serverCommand = new StartServerCommand( false ); diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/eclipse/EclipseStatusHandler.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/eclipse/EclipseStatusHandler.java index 1c133103c..db012e86b 100644 --- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/eclipse/EclipseStatusHandler.java +++ b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/eclipse/EclipseStatusHandler.java @@ -1,12 +1,15 @@ /******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. + * Copyright (c) 2001, 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: - * IBM Corporation - initial API and implementation + * IBM Corporation - initial API and implementation + * yyyymmdd bug Email and other contact information + * -------- -------- ----------------------------------------------------------- + * 20070314 176886 pmoogk@ca.ibm.com - Peter Moogk *******************************************************************************/ package org.eclipse.wst.command.internal.env.ui.eclipse; @@ -15,19 +18,18 @@ import org.eclipse.core.runtime.Status; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.wst.command.internal.env.core.EnvironmentCoreMessages; +import org.eclipse.wst.command.internal.env.eclipse.BaseStatusHandler; import org.eclipse.wst.command.internal.env.ui.dialog.MessageDialog; import org.eclipse.wst.command.internal.env.ui.dialog.StatusDialogConstants; import org.eclipse.wst.common.environment.Choice; -import org.eclipse.wst.common.environment.IStatusHandler; import org.eclipse.wst.common.environment.StatusException; /** * This is the Eclipse UI version of the IStatusHandler */ -public class EclipseStatusHandler implements IStatusHandler +public class EclipseStatusHandler extends BaseStatusHandler { - private IStatus worstStatus = Status.OK_STATUS; private Shell shell = null; public EclipseStatusHandler() @@ -38,17 +40,7 @@ public class EclipseStatusHandler implements IStatusHandler { shell = theShell; } - - public IStatus getStatus() - { - return worstStatus; - } - - public void resetStatus() - { - worstStatus = Status.OK_STATUS; - } - + /** * @see org.eclipse.env.common.IStatusHandler#report(org.eclipse.env.common.Status, org.eclipse.env.common.Choice[]) */ @@ -154,15 +146,7 @@ public class EclipseStatusHandler implements IStatusHandler return false; } - - private void checkStatus( IStatus status ) - { - if( status.getSeverity() > worstStatus.getSeverity() ) - { - worstStatus = status; - } - } - + /** * @see org.eclipse.wst.command.internal.env.core.common.IStatusHandler#reportError(org.eclipse.wst.command.internal.env.core.common.Status) */ diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/SimpleCommandEngineManager.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/SimpleCommandEngineManager.java index 243175fbf..7b302885a 100644 --- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/SimpleCommandEngineManager.java +++ b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/SimpleCommandEngineManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2006 IBM Corporation and others. + * Copyright (c) 2004, 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -10,10 +10,12 @@ * yyyymmdd bug Email and other contact information * -------- -------- ----------------------------------------------------------- * 20060223 129232 pmoogk@ca.ibm.com - Peter Moogk + * 20070314 176886 pmoogk@ca.ibm.com - Peter Moogk *******************************************************************************/ package org.eclipse.wst.command.internal.env.ui.widgets; import java.lang.reflect.InvocationTargetException; + import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.jface.operation.IRunnableContext; @@ -22,8 +24,8 @@ import org.eclipse.wst.command.internal.env.core.data.DataFlowManager; import org.eclipse.wst.command.internal.env.core.fragment.CommandFragment; import org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine; import org.eclipse.wst.command.internal.env.core.fragment.FragmentListener; +import org.eclipse.wst.command.internal.env.eclipse.BaseStatusHandler; import org.eclipse.wst.command.internal.env.eclipse.EclipseEnvironment; -import org.eclipse.wst.command.internal.env.ui.eclipse.EclipseStatusHandler; import org.eclipse.wst.common.environment.ILog; @@ -103,10 +105,10 @@ public class SimpleCommandEngineManager protected boolean afterExecuteNextFragment( CommandFragment fragment ) { - boolean continueExecute = true; - EclipseStatusHandler statusHandler = (EclipseStatusHandler)environment_.getStatusHandler(); - IStatus commandStatus = engine_.getLastStatus(); - IStatus handlerStatus = statusHandler.getStatus(); + boolean continueExecute = true; + BaseStatusHandler statusHandler = (BaseStatusHandler)environment_.getStatusHandler(); + IStatus commandStatus = engine_.getLastStatus(); + IStatus handlerStatus = statusHandler.getStatus(); if( commandStatus.getSeverity() == IStatus.ERROR && handlerStatus.getSeverity() != IStatus.ERROR ) @@ -244,7 +246,7 @@ public class SimpleCommandEngineManager { environment_.getLog().log(ILog.INFO, "command", 5002, this, "getTransactionOperation", "Start of transaction"); - EclipseStatusHandler statusHandler = (EclipseStatusHandler)environment_.getStatusHandler(); + BaseStatusHandler statusHandler = (BaseStatusHandler)environment_.getStatusHandler(); statusHandler.resetStatus(); engine_.moveForwardToNextStop( monitor ); @@ -265,7 +267,7 @@ public class SimpleCommandEngineManager { environment_.getLog().log(ILog.INFO, "command", 5085, this, "getNoTransactionOperation", "Start of NON transaction"); - EclipseStatusHandler statusHandler = (EclipseStatusHandler)environment_.getStatusHandler(); + BaseStatusHandler statusHandler = (BaseStatusHandler)environment_.getStatusHandler(); statusHandler.resetStatus(); engine_.moveForwardToNextStop( monitor ); diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/WizardPageManager.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/WizardPageManager.java index 0c795ce7c..320bac6fb 100644 --- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/WizardPageManager.java +++ b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/WizardPageManager.java @@ -254,10 +254,6 @@ public class WizardPageManager extends SimpleCommandEngineManager // An error occured in one of the commands. doneOk = false; } - else - { - currentPage_ = nextPage_; - } } while( nextPage_ != null && doneOk); @@ -272,10 +268,15 @@ public class WizardPageManager extends SimpleCommandEngineManager { done = engine_.undoToLastStop(); page = getPage( lastUndoFragment_ ); + + if( page == null && lastUndoFragment_ != null && getWidgetFactory( lastUndoFragment_.getId() ) == widgetFactory_ ) + { + // The current widget factory is associated with the last fragment that was undone. + // Therefore, we are back to where we started. + done = true; + } } while( page != startPage && !done ); - - currentPage_ = page; } return doneOk; diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/ant/AntEnvironment.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/ant/AntEnvironment.java index b0c7666e2..ab125ea55 100644 --- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/ant/AntEnvironment.java +++ b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/ant/AntEnvironment.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. + * Copyright (c) 2005, 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -11,6 +11,7 @@ * -------- -------- ----------------------------------------------------------- * 20060523 133714 joan@ca.ibm.com - Joan Haggarty * 20060726 151614 pmoogk@ca.ibm.com - Peter Moogk + * 20070314 176886 pmoogk@ca.ibm.com - Peter Moogk *******************************************************************************/ package org.eclipse.wst.command.internal.env.ant; @@ -38,9 +39,9 @@ import org.eclipse.wst.command.internal.env.core.data.ClassEntry; import org.eclipse.wst.command.internal.env.core.data.Transformer; import org.eclipse.wst.command.internal.env.core.fragment.CommandFragment; import org.eclipse.wst.command.internal.env.eclipse.EclipseEnvironment; +import org.eclipse.wst.command.internal.env.eclipse.IEclipseStatusHandler; import org.eclipse.wst.command.internal.env.plugin.EnvPlugin; import org.eclipse.wst.common.environment.ILog; -import org.eclipse.wst.common.environment.IStatusHandler; import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; /** @@ -84,7 +85,7 @@ public class AntEnvironment extends EclipseEnvironment{ private AntController controller_; - public AntEnvironment(AntController controller, TransientResourceContext context, IStatusHandler handler, Hashtable properties) + public AntEnvironment(AntController controller, TransientResourceContext context, IEclipseStatusHandler handler, Hashtable properties) { super(controller.getOperationManager(), context, handler); antProperties_ = properties; diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/ant/AntStatusHandler.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/ant/AntStatusHandler.java index aa4c6c884..03b4649ba 100644 --- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/ant/AntStatusHandler.java +++ b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/ant/AntStatusHandler.java @@ -1,21 +1,25 @@ /******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. + * Copyright (c) 2005, 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: - * IBM Corporation - initial API and implementation + * IBM Corporation - initial API and implementation + * yyyymmdd bug Email and other contact information + * -------- -------- ----------------------------------------------------------- + * 20070314 176886 pmoogk@ca.ibm.com - Peter Moogk *******************************************************************************/ package org.eclipse.wst.command.internal.env.ant; import org.eclipse.core.runtime.IStatus; +import org.eclipse.wst.command.internal.env.eclipse.BaseStatusHandler; import org.eclipse.wst.common.environment.Choice; -import org.eclipse.wst.common.environment.IStatusHandler; import org.eclipse.wst.common.environment.StatusException; -public class AntStatusHandler implements IStatusHandler { +public class AntStatusHandler extends BaseStatusHandler +{ public Choice report(IStatus status, Choice[] choices) { // TODO diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/eclipse/BaseStatusHandler.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/eclipse/BaseStatusHandler.java new file mode 100644 index 000000000..7959c4e49 --- /dev/null +++ b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/eclipse/BaseStatusHandler.java @@ -0,0 +1,63 @@ +/******************************************************************************* + * Copyright (c) 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * yyyymmdd bug Email and other contact information + * -------- -------- ----------------------------------------------------------- + * 20070314 176886 pmoogk@ca.ibm.com - Peter Moogk + *******************************************************************************/ +package org.eclipse.wst.command.internal.env.eclipse; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.wst.common.environment.Choice; +import org.eclipse.wst.common.environment.StatusException; + +public class BaseStatusHandler implements IEclipseStatusHandler +{ + private IStatus worstStatus = Status.OK_STATUS; + + public IStatus getStatus() + { + return worstStatus; + } + + public void resetStatus() + { + worstStatus = Status.OK_STATUS; + } + + public void report(IStatus status) throws StatusException + { + checkStatus(status); + } + + public Choice report(IStatus status, Choice[] choices) + { + checkStatus(status); + return choices == null || choices.length == 0? null : choices[0]; + } + + public void reportError(IStatus status) + { + checkStatus(status); + } + + public void reportInfo(IStatus status) + { + checkStatus(status); + } + + protected void checkStatus( IStatus status ) + { + if( status.getSeverity() > worstStatus.getSeverity() ) + { + worstStatus = status; + } + } +} diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/eclipse/EclipseEnvironment.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/eclipse/EclipseEnvironment.java index 20766b93c..4170a0b02 100644 --- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/eclipse/EclipseEnvironment.java +++ b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/eclipse/EclipseEnvironment.java @@ -1,12 +1,15 @@ /******************************************************************************* - * Copyright (c) 2004 IBM Corporation and others. + * Copyright (c) 2004, 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: - * IBM Corporation - initial API and implementation + * IBM Corporation - initial API and implementation + * yyyymmdd bug Email and other contact information + * -------- -------- ----------------------------------------------------------- + * 20070314 176886 pmoogk@ca.ibm.com - Peter Moogk *******************************************************************************/ package org.eclipse.wst.command.internal.env.eclipse; @@ -28,15 +31,15 @@ import org.eclipse.wst.common.environment.uri.IURIScheme; */ public class EclipseEnvironment implements BaseEclipseEnvironment { - private CommandManager commandManager_ = null; - private SimpleURIFactory uriFactory_ = null; - private ResourceContext resourceContext_ = null; - private IStatusHandler statusHandler_ = null; - private ILog logger_ = null; + private CommandManager commandManager_ = null; + private SimpleURIFactory uriFactory_ = null; + private ResourceContext resourceContext_ = null; + private IEclipseStatusHandler statusHandler_ = null; + private ILog logger_ = null; - public EclipseEnvironment( CommandManager commandManager, - ResourceContext resourceContext, - IStatusHandler statusHandler ) + public EclipseEnvironment( CommandManager commandManager, + ResourceContext resourceContext, + IEclipseStatusHandler statusHandler ) { IURIScheme eclipseScheme = EnvironmentService.getEclipseScheme(); IURIScheme fileScheme = EnvironmentService.getFileScheme(); diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/eclipse/EnvironmentManager.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/eclipse/EnvironmentManager.java index ed691d68a..354216577 100644 --- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/eclipse/EnvironmentManager.java +++ b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/eclipse/EnvironmentManager.java @@ -1,16 +1,19 @@ -/*************************************************************************************************** - * Copyright (c) 2005 IBM Corporation and others. All rights reserved. This program and the - * accompanying materials are made available under the terms of the Eclipse Public License v1.0 +/******************************************************************************* + * Copyright (c) 2005, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation - **************************************************************************************************/ + * + * Contributors: + * IBM Corporation - initial API and implementation + * yyyymmdd bug Email and other contact information + * -------- -------- ----------------------------------------------------------- + * 20070314 176886 pmoogk@ca.ibm.com - Peter Moogk + *******************************************************************************/ package org.eclipse.wst.command.internal.env.eclipse; import org.eclipse.wst.command.internal.env.context.PersistentResourceContext; -import org.eclipse.wst.common.environment.IStatusHandler; -import org.eclipse.wst.common.environment.NullStatusHandler; public class EnvironmentManager { @@ -20,7 +23,7 @@ public class EnvironmentManager public static BaseEclipseEnvironment getNewEnvironment() { PersistentResourceContext context = PersistentResourceContext.getInstance(); - IStatusHandler handler = new NullStatusHandler(); + IEclipseStatusHandler handler = new BaseStatusHandler(); EclipseEnvironment environment = new EclipseEnvironment( null, context, handler ); return environment; diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/eclipse/IEclipseStatusHandler.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/eclipse/IEclipseStatusHandler.java new file mode 100644 index 000000000..4d8098708 --- /dev/null +++ b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/eclipse/IEclipseStatusHandler.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright (c) 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * yyyymmdd bug Email and other contact information + * -------- -------- ----------------------------------------------------------- + * 20070314 176886 pmoogk@ca.ibm.com - Peter Moogk + *******************************************************************************/ +package org.eclipse.wst.command.internal.env.eclipse; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.wst.common.environment.IStatusHandler; + +public interface IEclipseStatusHandler extends IStatusHandler +{ + /** + * + * @return returns the worst status that has been reported. + */ + public IStatus getStatus(); + + /** + * Resets the worst status reported to be OK. + * + */ + public void resetStatus(); +} |