diff options
author | kchan | 2005-09-29 17:02:44 +0000 |
---|---|---|
committer | kchan | 2005-09-29 17:02:44 +0000 |
commit | a6614f0d4d9eed2727258f34e6679c55b7ece877 (patch) | |
tree | 8845c0901a56d939905c1851cdb572fe4908a5f3 /bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws | |
parent | 79f089747e5022e482fe5bcfc012f73625eb07cd (diff) | |
download | webtools.webservices-a6614f0d4d9eed2727258f34e6679c55b7ece877.tar.gz webtools.webservices-a6614f0d4d9eed2727258f34e6679c55b7ece877.tar.xz webtools.webservices-a6614f0d4d9eed2727258f34e6679c55b7ece877.zip |
[110847] Change commands to use IStatus and IProgressMonitor.
Diffstat (limited to 'bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws')
64 files changed, 449 insertions, 656 deletions
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/action/LaunchWSEAction.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/action/LaunchWSEAction.java index e7b335718..b34dc7e66 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/action/LaunchWSEAction.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/action/LaunchWSEAction.java @@ -15,7 +15,6 @@ import org.eclipse.jface.viewers.ISelection; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.IWorkbenchWindowActionDelegate; import org.eclipse.wst.command.internal.env.ui.eclipse.EclipseEnvironment; -import org.eclipse.wst.command.internal.env.ui.eclipse.EclipseProgressMonitor; import org.eclipse.wst.command.internal.env.ui.eclipse.EclipseStatusHandler; import org.eclipse.wst.command.internal.provisional.env.core.context.TransientResourceContext; import org.eclipse.wst.ws.internal.explorer.LaunchOption; @@ -29,9 +28,8 @@ public class LaunchWSEAction implements IWorkbenchWindowActionDelegate public void run(IAction action) { EclipseStatusHandler handler = new EclipseStatusHandler(); - EclipseProgressMonitor monitor = new EclipseProgressMonitor(); TransientResourceContext context = new TransientResourceContext(); - EclipseEnvironment environment = new EclipseEnvironment( null, context, monitor, handler ); + EclipseEnvironment environment = new EclipseEnvironment( null, context, handler ); WSExplorerLauncherCommand cmd = new WSExplorerLauncherCommand(); String stateLocation = ExplorerPlugin.getInstance().getPluginStateLocation(); diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/CheckForServiceProjectCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/CheckForServiceProjectCommand.java index a036a81cc..851a47ccf 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/CheckForServiceProjectCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/CheckForServiceProjectCommand.java @@ -14,14 +14,14 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jem.util.emf.workbench.ProjectUtilities; import org.eclipse.jst.ws.internal.consumption.ui.common.ValidationUtils; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; import org.eclipse.wst.command.internal.provisional.env.core.common.StatusException; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.command.internal.provisional.env.core.selection.SelectionListChoices; import org.eclipse.wst.ws.internal.parser.wsil.WebServicesParser; @@ -65,7 +65,7 @@ public class CheckForServiceProjectCommand extends EnvironmentalOperation public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) { Environment environment = getEnvironment(); - Status status = new SimpleStatus(""); + IStatus status = Status.OK_STATUS; if (runtime2ClientTypes==null || wsdlURI==null || wsdlURI.length()==0 || webServicesParser==null) return status; @@ -78,7 +78,7 @@ public class CheckForServiceProjectCommand extends EnvironmentalOperation boolean isServiceProject = vu.isProjectServiceProject(clientProject, wsdlURI, webServicesParser); if (isServiceProject) { - Status wStatus = new SimpleStatus("", msgUtils.getMessage("MSG_WARN_IS_SERVICE_PROJECT", new String[]{clientProjectName}), Status.WARNING); + IStatus wStatus = StatusUtils.warningStatus( msgUtils.getMessage("MSG_WARN_IS_SERVICE_PROJECT", new String[]{clientProjectName}) ); try { environment.getStatusHandler().report(wStatus); @@ -86,7 +86,7 @@ public class CheckForServiceProjectCommand extends EnvironmentalOperation catch (StatusException se) { //User decided to abort. Return an error status - Status eStatus = new SimpleStatus("", msgUtils.getMessage("MSG_USER_ABORTED"), Status.ERROR); + IStatus eStatus = StatusUtils.errorStatus( msgUtils.getMessage("MSG_USER_ABORTED") ); return eStatus; } } diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/GenerateHandlerSkeletonCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/GenerateHandlerSkeletonCommand.java index 3d12ff98d..24838eaab 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/GenerateHandlerSkeletonCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/GenerateHandlerSkeletonCommand.java @@ -22,14 +22,15 @@ import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.ws.internal.common.EnvironmentUtils; +import org.eclipse.core.runtime.MultiStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jst.ws.internal.common.ResourceUtils; import org.eclipse.wst.command.internal.env.common.FileResourceUtils; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; +import org.eclipse.wst.ws.internal.common.EnvironmentUtils; @@ -51,40 +52,45 @@ public class GenerateHandlerSkeletonCommand extends EnvironmentalOperation public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) { - Environment env = getEnvironment(); + Environment env = getEnvironment(); + MultiStatus status = null; + IStatus returnStatus = Status.OK_STATUS; - if (!genSkeleton_) - return new SimpleStatus(""); + if (!genSkeleton_) return returnStatus; int i; boolean error = false; - SimpleStatus status = null; - Status writeStatus; + IStatus writeStatus; - for (i=0; i<handlerNames_.length; i++) { - writeStatus = writeFile(env, handlerNames_[i], outputLocation_); + for (i=0; i<handlerNames_.length; i++) + { + writeStatus = writeFile(env, handlerNames_[i], outputLocation_, monitor ); // handle status return - if (writeStatus.getSeverity() == Status.ERROR) { // write status is OK or ERROR + if (writeStatus.getSeverity() == Status.ERROR) + { // write status is OK or ERROR error = true; - if (status == null) { - status = new SimpleStatus( "execute", msgUtils_.getMessage("MSG_ERROR_GENERATE_HANDLER_SKELETON"), Status.ERROR); + if (status == null) + { + status = StatusUtils.multiStatus( msgUtils_.getMessage("MSG_ERROR_GENERATE_HANDLER_SKELETON"), new IStatus[0] ); } - status.addChild(writeStatus); + status.add(writeStatus); } } - if (error) { + + if (error) + { env.getStatusHandler().reportError(status); - } else { - status = new SimpleStatus( "" ); + returnStatus = status; } - return status; + + return returnStatus; } - public Status writeFile (Environment env, String className, IPath outputLocation) + private IStatus writeFile (Environment env, String className, IPath outputLocation, IProgressMonitor monitor ) { - Status status = new SimpleStatus(""); + IStatus status = Status.OK_STATUS; int index; String simpleClassName = className; @@ -125,7 +131,7 @@ public class GenerateHandlerSkeletonCommand extends EnvironmentalOperation handlerNameForEdit_ = className; } - OutputStream outputStream = FileResourceUtils.newFileOutputStream( EnvironmentUtils.getResourceContext(env), filePath, env.getProgressMonitor(), env.getStatusHandler()); + OutputStream outputStream = FileResourceUtils.newFileOutputStream( EnvironmentUtils.getResourceContext(env), filePath, monitor, env.getStatusHandler()); // create buffered writer for writing file BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(outputStream)); try { @@ -195,9 +201,11 @@ public class GenerateHandlerSkeletonCommand extends EnvironmentalOperation bw.newLine(); bw.write("}"); bw.close(); - status = new SimpleStatus( "" ); - } catch (IOException e) { - status = new SimpleStatus( "writeFile", msgUtils_.getMessage("MSG_ERROR_WRITE_FILE", new String[]{ className }), Status.ERROR, e ); + status = Status.OK_STATUS; + } + catch (IOException e) + { + status = StatusUtils.errorStatus( msgUtils_.getMessage("MSG_ERROR_WRITE_FILE", new String[]{ className }), e ); if (bw != null) { try { bw.close(); @@ -207,16 +215,6 @@ public class GenerateHandlerSkeletonCommand extends EnvironmentalOperation } return status; } - - public Status undo(Environment environment) - { - return null; - } - - public Status redo(Environment environment) - { - return null; - } public void setOutputLocation(IPath outputLocation) { diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/OpenJavaEditorCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/OpenJavaEditorCommand.java index b16def4b1..c07b5767a 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/OpenJavaEditorCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/OpenJavaEditorCommand.java @@ -16,6 +16,7 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.IType; @@ -24,7 +25,6 @@ import org.eclipse.jdt.ui.JavaUI; import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin; import org.eclipse.ui.progress.UIJob; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; public class OpenJavaEditorCommand extends EnvironmentalOperation @@ -41,7 +41,7 @@ public class OpenJavaEditorCommand extends EnvironmentalOperation OpenJavaEditorJob job = new OpenJavaEditorJob(classNames, project); job.setPriority(Job.LONG); job.schedule(); - return new SimpleStatus(""); + return Status.OK_STATUS; } public void setClassNames(List classNames) diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/WSINonCompliantRuntimeCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/WSINonCompliantRuntimeCommand.java index 9d9d5da7e..62fa392f5 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/WSINonCompliantRuntimeCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/WSINonCompliantRuntimeCommand.java @@ -16,11 +16,11 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.ws.internal.ui.plugin.WSUIPlugin; import org.eclipse.wst.ws.internal.ui.wsi.preferences.PersistentWSIAPContext; import org.eclipse.wst.ws.internal.ui.wsi.preferences.PersistentWSISSBPContext; @@ -48,41 +48,31 @@ public class WSINonCompliantRuntimeCommand extends EnvironmentalOperation PersistentWSISSBPContext wsiSSBPContext = WSUIPlugin.getInstance().getWSISSBPContext(); PersistentWSIAPContext wsiAPContext = WSUIPlugin.getInstance().getWSIAPContext(); Vector statusSSBP = new Vector(); - statusSSBP.add(new SimpleStatus("WSINonCompliantRuntimeCommand", - msgUtils_.getMessage("WSI_SSBP_INCOMPLIANT_RUNTIME"), WSIComplianceUtils.getWSISeverity(serviceProject_, wsiSSBPContext))); + statusSSBP.add( new Status( WSIComplianceUtils.getWSISeverity(serviceProject_, wsiSSBPContext), "id", 0, + msgUtils_.getMessage("WSI_SSBP_INCOMPLIANT_RUNTIME"), null ) ); Status[] statusesSSBP = (Status[]) statusSSBP.toArray(new Status[statusSSBP.size()]); Vector statusAP = new Vector(); - statusAP.add(new SimpleStatus("WSINonCompliantRuntimeCommand", - msgUtils_.getMessage("WSI_AP_INCOMPLIANT_RUNTIME"), WSIComplianceUtils.getWSISeverity(serviceProject_, wsiAPContext))); + statusAP.add( new Status( WSIComplianceUtils.getWSISeverity(serviceProject_, wsiAPContext), "id", 0, + msgUtils_.getMessage("WSI_AP_INCOMPLIANT_RUNTIME"), null )); Status[] statusesAP = (Status[]) statusAP.toArray(new Status[statusAP.size()]); - if (WSIComplianceUtils.checkWSICompliance (environment.getStatusHandler(), statusesSSBP, serviceProject_, wsiSSBPContext)) { - if (WSIComplianceUtils.checkWSICompliance (environment.getStatusHandler(), statusesAP, serviceProject_, wsiAPContext)) { - return new SimpleStatus( "" ); - } else { - return new SimpleStatus( - "WSINonCompliantRuntimeCommand", - msgUtils_.getMessage("NOT_OK"), - Status.ERROR); + if (WSIComplianceUtils.checkWSICompliance (environment.getStatusHandler(), statusesSSBP, serviceProject_, wsiSSBPContext)) + { + if (WSIComplianceUtils.checkWSICompliance (environment.getStatusHandler(), statusesAP, serviceProject_, wsiAPContext)) + { + return Status.OK_STATUS; + } + else + { + return StatusUtils.errorStatus( msgUtils_.getMessage("NOT_OK") ); } - } else { - return new SimpleStatus( - "WSINonCompliantRuntimeCommand", - msgUtils_.getMessage("NOT_OK"), - Status.ERROR); + } + else + { + return StatusUtils.errorStatus( msgUtils_.getMessage("NOT_OK") ); } } - - public Status undo(Environment environment) - { - return null; - } - - public Status redo(Environment environment) - { - return null; - } public void setServiceProject(IProject serviceProject) { this.serviceProject_ = serviceProject; diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/data/ServerName2IServerTransformer.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/data/ServerName2IServerTransformer.java index 7ac5f0dd8..0e228a0c8 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/data/ServerName2IServerTransformer.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/data/ServerName2IServerTransformer.java @@ -10,8 +10,6 @@ *******************************************************************************/ package org.eclipse.jst.ws.internal.consumption.ui.command.data; -import java.util.Vector; - import org.eclipse.wst.command.internal.provisional.env.core.data.Transformer; import org.eclipse.wst.server.core.IServer; import org.eclipse.wst.server.core.ServerCore; @@ -20,7 +18,6 @@ public class ServerName2IServerTransformer implements Transformer { public Object transform(Object value) { - Vector serverIds = new Vector(); { String serverName = value.toString(); IServer[] servers = ServerCore.getServers(); diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/ServerSelectionUtils.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/ServerSelectionUtils.java index 26ff13fa3..ae8a5c96c 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/ServerSelectionUtils.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/ServerSelectionUtils.java @@ -13,7 +13,6 @@ package org.eclipse.jst.ws.internal.consumption.ui.common; import java.util.ArrayList; import java.util.List; - import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/ValidationUtils.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/ValidationUtils.java index 61ab08f89..44345accc 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/ValidationUtils.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/ValidationUtils.java @@ -13,14 +13,14 @@ package org.eclipse.jst.ws.internal.consumption.ui.common; import java.util.ArrayList; import java.util.Iterator; import java.util.Map; - import javax.wsdl.Definition; import javax.wsdl.Port; import javax.wsdl.Service; - import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jem.util.emf.workbench.ProjectUtilities; import org.eclipse.jst.j2ee.internal.webservice.helper.WebServicesManager; import org.eclipse.jst.j2ee.webservice.internal.WebServiceConstants; @@ -32,8 +32,7 @@ import org.eclipse.jst.ws.internal.common.ResourceUtils; import org.eclipse.jst.ws.internal.common.ServerUtils; import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.command.internal.provisional.env.core.selection.SelectionListChoices; import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; import org.eclipse.wst.server.core.IRuntime; @@ -55,18 +54,18 @@ public class ValidationUtils msgUtils = new MessageUtils( pluginId + ".plugin", this ); } - public Status validateProjectTargetAndJ2EE(String projectName, String compName, String earName, String earCompName, String serverFactoryId, String j2eeLevel) + public IStatus validateProjectTargetAndJ2EE(String projectName, String compName, String earName, String earCompName, String serverFactoryId, String j2eeLevel) { IProject p = ProjectUtilities.getProject(projectName); IProject earP = null; if (earName!=null && !earName.equalsIgnoreCase("")) { earP = ProjectUtilities.getProject(earName); } - Status targetStatus = doesProjectTargetMatchServerType(p, serverFactoryId); + IStatus targetStatus = doesProjectTargetMatchServerType(p, serverFactoryId); if (earP!=null && targetStatus.getSeverity()==Status.OK) { //check the EAR - Status earTargetStatus = doesProjectTargetMatchServerType(earP, serverFactoryId); + IStatus earTargetStatus = doesProjectTargetMatchServerType(earP, serverFactoryId); if(earTargetStatus.getSeverity()==Status.ERROR) { return earTargetStatus; @@ -79,10 +78,10 @@ public class ValidationUtils //Validate service side J2EE level - Status j2eeStatus = doesProjectMatchJ2EELevel(p, compName, j2eeLevel); + IStatus j2eeStatus = doesProjectMatchJ2EELevel(p, compName, j2eeLevel); if(earP!=null && j2eeStatus.getSeverity()==Status.OK) { - Status earJ2EEStatus = doesProjectMatchJ2EELevel(earP, earCompName, j2eeLevel); + IStatus earJ2EEStatus = doesProjectMatchJ2EELevel(earP, earCompName, j2eeLevel); if(earJ2EEStatus.getSeverity()==Status.ERROR) { return earJ2EEStatus; @@ -93,10 +92,10 @@ public class ValidationUtils return j2eeStatus; } - return new SimpleStatus(""); + return Status.OK_STATUS; } - private Status doesProjectTargetMatchServerType(IProject p, String serverFactoryId) + private IStatus doesProjectTargetMatchServerType(IProject p, String serverFactoryId) { if (p!=null && p.exists()) { @@ -109,15 +108,15 @@ public class ValidationUtils { if(!projectTargetId.equals(serverTargetId)) { - return new SimpleStatus("",msgUtils.getMessage("MSG_SERVER_TARGET_MISMATCH",new String[]{p.getName()}),Status.ERROR); + return StatusUtils.errorStatus( msgUtils.getMessage("MSG_SERVER_TARGET_MISMATCH",new String[]{p.getName()}) ); } } } } - return new SimpleStatus(""); + return Status.OK_STATUS; } - private Status doesProjectMatchJ2EELevel(IProject p, String compName, String j2eeLevel) + private IStatus doesProjectMatchJ2EELevel(IProject p, String compName, String j2eeLevel) { try { @@ -131,7 +130,7 @@ public class ValidationUtils { if (!projectJ2EELevelString.equals(j2eeLevel)) { - return new SimpleStatus("",msgUtils.getMessage("MSG_J2EE_MISMATCH",new String[]{p.getName()}), Status.ERROR); + return StatusUtils.errorStatus( msgUtils.getMessage("MSG_J2EE_MISMATCH",new String[]{p.getName()}) ); } } } @@ -140,12 +139,12 @@ public class ValidationUtils } - return new SimpleStatus(""); + return Status.OK_STATUS; } - public Status validateProjectType(String projectName, SelectionListChoices runtime2ClientTypes) + public IStatus validateProjectType(String projectName, SelectionListChoices runtime2ClientTypes) { - Status status = new SimpleStatus(""); + IStatus status = Status.OK_STATUS; IProject p = ProjectUtilities.getProject(projectName); if (p==null || !p.exists()) { @@ -170,7 +169,7 @@ public class ValidationUtils //Get the label for the client type id String clientTypeLabel = getClientTypeLabel(runtime2ClientTypes.getChoice().getList().getSelection()); String message = msgUtils.getMessage("MSG_WRONG_CLIENT_PROJECT_TYPE",new String[]{projectName, clientTypeLabel}); - Status eStatus = new SimpleStatus("",message,Status.ERROR); + IStatus eStatus = StatusUtils.errorStatus( message ); return eStatus; } diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientAssembleCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientAssembleCommand.java index 663663549..4a0d6d987 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientAssembleCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientAssembleCommand.java @@ -14,13 +14,11 @@ package org.eclipse.jst.ws.internal.consumption.ui.extension; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.ws.internal.common.EnvironmentUtils; +import org.eclipse.core.runtime.Status; import org.eclipse.jst.ws.internal.consumption.command.common.AssociateModuleWithEARCommand; import org.eclipse.jst.ws.internal.consumption.command.common.CreateModuleCommand; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; import org.eclipse.wst.ws.internal.provisional.wsrt.IWebServiceClient; public class PreClientAssembleCommand extends EnvironmentalOperation @@ -40,7 +38,7 @@ public class PreClientAssembleCommand extends EnvironmentalOperation // Check if EAR module is req'd, ie. !=null if (earProject_==null) - return new SimpleStatus(""); + return Status.OK_STATUS; //Create the client EAR module CreateModuleCommand command = new CreateModuleCommand(); @@ -54,7 +52,7 @@ public class PreClientAssembleCommand extends EnvironmentalOperation IStatus status = command.execute( null, null ); if (status.getSeverity()==Status.ERROR) { - environment.getStatusHandler().reportError( EnvironmentUtils.convertIStatusToStatus(status)); + environment.getStatusHandler().reportError( status ); return status; } @@ -69,7 +67,7 @@ public class PreClientAssembleCommand extends EnvironmentalOperation status = associateCommand.execute( null, null ); if (status.getSeverity()==Status.ERROR) { - environment.getStatusHandler().reportError( EnvironmentUtils.convertIStatusToStatus(status)); + environment.getStatusHandler().reportError( status ); } return status; diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientDevelopCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientDevelopCommand.java index 7e6113ff1..bed81b8e8 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientDevelopCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientDevelopCommand.java @@ -14,13 +14,12 @@ package org.eclipse.jst.ws.internal.consumption.ui.extension; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.ws.internal.common.EnvironmentUtils; +import org.eclipse.core.runtime.Status; import org.eclipse.jst.ws.internal.consumption.command.common.CreateModuleCommand; import org.eclipse.jst.ws.internal.consumption.ui.wsrt.WebServiceRuntimeExtensionUtils; import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; import org.eclipse.wst.command.internal.provisional.env.core.context.ResourceContext; import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; import org.eclipse.wst.ws.internal.provisional.wsrt.IContext; @@ -43,7 +42,6 @@ public class PreClientDevelopCommand extends EnvironmentalOperation */ private TypeRuntimeServer typeRuntimeServer_; - private Environment environment_; private IContext context_; private ISelection selection_; private String project_; @@ -91,7 +89,6 @@ public class PreClientDevelopCommand extends EnvironmentalOperation wsInfo.setWebServiceRuntimeId(typeRuntimeServer_.getRuntimeId()); wsInfo.setWsdlURL(wsdlURI_); - environment_ = environment; webServiceClient_ = wsrt.getWebServiceClient(wsInfo); WebServiceScenario scenario = WebServiceScenario.CLIENT_LITERAL; context_ = new SimpleContext(true, true, true, true, true, true, test_, @@ -123,7 +120,7 @@ public class PreClientDevelopCommand extends EnvironmentalOperation if (status.getSeverity() == Status.ERROR) { - environment.getStatusHandler().reportError(EnvironmentUtils.convertIStatusToStatus(status)); + environment.getStatusHandler().reportError( status ); } return status; } diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientInstallCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientInstallCommand.java index efe5dd9f4..4773881e9 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientInstallCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientInstallCommand.java @@ -14,12 +14,11 @@ package org.eclipse.jst.ws.internal.consumption.ui.extension; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.ws.internal.common.EnvironmentUtils; +import org.eclipse.core.runtime.Status; import org.eclipse.jst.ws.internal.consumption.command.common.AddModuleToServerCommand; import org.eclipse.jst.ws.internal.consumption.command.common.CreateServerCommand; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; import org.eclipse.wst.ws.internal.provisional.wsrt.IWebServiceClient; public class PreClientInstallCommand extends EnvironmentalOperation @@ -48,7 +47,7 @@ public class PreClientInstallCommand extends EnvironmentalOperation { if (createServerStatus.getSeverity()==Status.ERROR) { - environment.getStatusHandler().reportError(EnvironmentUtils.convertIStatusToStatus(createServerStatus)); + environment.getStatusHandler().reportError( createServerStatus ); } return createServerStatus; } @@ -73,7 +72,7 @@ public class PreClientInstallCommand extends EnvironmentalOperation IStatus status = command.execute( null, null ); if (status.getSeverity()==Status.ERROR) { - environment.getStatusHandler().reportError( EnvironmentUtils.convertIStatusToStatus(status)); + environment.getStatusHandler().reportError( status ); } return status; } diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientRunCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientRunCommand.java index cf4067f88..54c43003a 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientRunCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientRunCommand.java @@ -14,11 +14,10 @@ package org.eclipse.jst.ws.internal.consumption.ui.extension; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.ws.internal.common.EnvironmentUtils; +import org.eclipse.core.runtime.Status; import org.eclipse.jst.ws.internal.consumption.command.common.StartServerCommand; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; import org.eclipse.wst.ws.internal.provisional.wsrt.IWebServiceClient; public class PreClientRunCommand extends EnvironmentalOperation @@ -36,7 +35,7 @@ public class PreClientRunCommand extends EnvironmentalOperation IStatus status = command.execute( null, null ); if (status.getSeverity()==Status.ERROR) { - environment.getStatusHandler().reportError( EnvironmentUtils.convertIStatusToStatus(status)); + environment.getStatusHandler().reportError( status ); } return status; } diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/preferences/ServerRuntimePreferencePage.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/preferences/ServerRuntimePreferencePage.java index 50cf57147..b2abb86e1 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/preferences/ServerRuntimePreferencePage.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/preferences/ServerRuntimePreferencePage.java @@ -12,7 +12,6 @@ package org.eclipse.jst.ws.internal.consumption.ui.preferences; import java.util.ArrayList; - import org.eclipse.jface.preference.PreferencePage; import org.eclipse.jst.ws.internal.common.J2EEUtils; import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin; @@ -268,7 +267,6 @@ public class ServerRuntimePreferencePage extends PreferencePage implements IWork ArrayList serverLabelsList = new ArrayList(); for (int i=0;i<factoryIds.length;i++) { - String thisFactoryId = factoryIds[i]; //String thisServerLabel = WebServiceServerRuntimeTypeRegistry.getInstance().getServerLabel(factoryIds[i]); String thisServerLabel = WebServiceRuntimeExtensionUtils.getServerLabelById(factoryIds[i]); if (thisServerLabel!=null && thisServerLabel.length()>0) 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 74e850ebc..e21bf0406 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 @@ -13,13 +13,14 @@ package org.eclipse.jst.ws.internal.consumption.ui.server; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.IJobChangeEvent; import org.eclipse.core.runtime.jobs.IJobManager; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.jobs.JobChangeAdapter; import org.eclipse.jface.wizard.ProgressMonitorPart; -import org.eclipse.jst.ws.internal.common.EnvironmentUtils; import org.eclipse.jst.ws.internal.consumption.command.common.StartServerCommand; import org.eclipse.jst.ws.internal.ui.common.UIUtils; import org.eclipse.swt.SWT; @@ -35,21 +36,19 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; import org.eclipse.ui.PlatformUI; import org.eclipse.wst.command.internal.env.ui.eclipse.EclipseEnvironment; -import org.eclipse.wst.command.internal.env.ui.eclipse.EclipseProgressMonitor; 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.command.internal.provisional.env.core.common.MessageUtils; import org.eclipse.wst.command.internal.provisional.env.core.common.NullStatusHandler; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.command.internal.provisional.env.core.context.TransientResourceContext; import org.eclipse.wst.server.core.IServer; public class StartServerWidget extends SimpleWidgetDataContributor { private IServer server_; - private Status status_; + private IStatus status_; private Listener statusListener_; private Button button_; private JobChangeAdapter jobChangeAdapter_; @@ -136,7 +135,7 @@ public class StartServerWidget extends SimpleWidgetDataContributor return this; } - public Status getStatus() + public IStatus getStatus() { return status_; } @@ -149,7 +148,7 @@ public class StartServerWidget extends SimpleWidgetDataContributor { case IServer.STATE_STARTED: { - status_ = new SimpleStatus( "" ); + status_ = Status.OK_STATUS; button_.setEnabled( false ); serverStateText_.setText( getStateMessage( "TEXT_SERVER_STATUS", "TEXT_SERVER_STARTED" ) ); @@ -158,7 +157,7 @@ public class StartServerWidget extends SimpleWidgetDataContributor case IServer.STATE_STARTING: { - status_ = new SimpleStatus( "", "", Status.ERROR ); + status_ = StatusUtils.errorStatus( "" ); button_.setEnabled( false ); serverStateText_.setText( getStateMessage( "TEXT_SERVER_STATUS", "TEXT_SERVER_STARTING" ) ); progressMonitor_.beginTask( getStateMessage( "TEXT_SERVER_MSG", "TEXT_SERVER_STARTING" ), IProgressMonitor.UNKNOWN ); @@ -171,7 +170,7 @@ public class StartServerWidget extends SimpleWidgetDataContributor default: { - status_ = new SimpleStatus( "", "", Status.ERROR ); + status_ = StatusUtils.errorStatus( "" ); button_.setEnabled( true ); serverStateText_.setText( getStateMessage( "TEXT_SERVER_STATUS", "TEXT_SERVER_STOPPED" ) ); break; @@ -211,7 +210,7 @@ public class StartServerWidget extends SimpleWidgetDataContributor { synchronized( StartServerFamily ) { - Status status = startServerJob.getStatus(); + IStatus status = startServerJob.getStatus(); // We are using status to determine if the job has completed or not. // Normally, we would not get here if the job had already completed, @@ -229,7 +228,7 @@ public class StartServerWidget extends SimpleWidgetDataContributor // Note: this job was reporting progress to different progressMonitor_ // control. We need to tell the job that it should report progress // to our new progressMonitor_ control on this wizard page. - ProgressMonitorWrapper monitor = (ProgressMonitorWrapper)startServerJob.getMonitor().getMonitor(); + ProgressMonitorWrapper monitor = (ProgressMonitorWrapper)startServerJob.getMonitor(); monitor.setMonitor( progressMonitor_ ); } else @@ -251,15 +250,15 @@ public class StartServerWidget extends SimpleWidgetDataContributor private void reportErrorIfRequired( StartServerJob serverJob ) { - Status status = serverJob.getStatus(); + IStatus status = serverJob.getStatus(); - if( status.getSeverity() == Status.ERROR ) - { - Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); + if( status.getSeverity() == Status.ERROR ) + { + Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); EclipseStatusHandler handler = new EclipseStatusHandler( shell ); handler.reportError( status ); - } + } } final private static String StartServerFamily = "StartServerFamily"; @@ -267,93 +266,79 @@ public class StartServerWidget extends SimpleWidgetDataContributor // This class is used to start up the server in an Eclipse job. private class StartServerJob extends Job { - private Status status_ = null; - private SimpleProgressMonitor envMonitor_; + private IStatus status_ = null; + private ProgressMonitorWrapper envMonitor_; - public StartServerJob() - { - super( "StartServerJob" ); + public StartServerJob() + { + super( "StartServerJob" ); - envMonitor_ = new SimpleProgressMonitor(); - } + envMonitor_ = new ProgressMonitorWrapper( progressMonitor_ ); + } - public IServer getServer() - { - return server_; - } + public IServer getServer() + { + return server_; + } - public SimpleProgressMonitor getMonitor() - { - return envMonitor_; - } + public ProgressMonitorWrapper getMonitor() + { + return envMonitor_; + } - public boolean belongsTo(Object family) - { - return family == StartServerFamily; - } + public boolean belongsTo(Object family) + { + return family == StartServerFamily; + } - protected IStatus run(IProgressMonitor monitor) - { - NullStatusHandler handler = new NullStatusHandler(); - TransientResourceContext resourceContext = new TransientResourceContext(); - EclipseEnvironment environment = new EclipseEnvironment( null,resourceContext, envMonitor_ , handler ); - StartServerCommand serverCommand = new StartServerCommand( false, false ); + protected IStatus run(IProgressMonitor monitor) + { + NullStatusHandler handler = new NullStatusHandler(); + TransientResourceContext resourceContext = new TransientResourceContext(); + EclipseEnvironment environment = new EclipseEnvironment( null,resourceContext, handler ); + StartServerCommand serverCommand = new StartServerCommand( false, false ); - serverCommand.setServerInstanceId( server_.getId() ); - serverCommand.setEnvironment( environment ); + serverCommand.setServerInstanceId( server_.getId() ); + serverCommand.setEnvironment( environment ); - try - { - setStatus( EnvironmentUtils.convertIStatusToStatus(serverCommand.execute( null, null ) ) ); + try + { + setStatus( serverCommand.execute( envMonitor_, null ) ); + } + catch( Throwable exc ) + { + exc.printStackTrace(); + setStatus( StatusUtils.errorStatus( exc ) ); + } + + return Status.OK_STATUS; } - catch( Throwable exc ) + + // Calls to this method need to first synchronize on the + // StartServerFamily object. + public IStatus getStatus() { - exc.printStackTrace(); - setStatus( new SimpleStatus( "", exc.getMessage(), Status.ERROR, exc ) ); + return status_; } - - return org.eclipse.core.runtime.Status.OK_STATUS; - } - // Calls to this method need to first synchronize on the - // StartServerFamily object. - public Status getStatus() - { - return status_; - } - - private void setStatus( Status status ) - { - synchronized( StartServerFamily ) + private void setStatus( IStatus status ) { + synchronized( StartServerFamily ) + { status_ = status; + } } - } - } - - // This is just a simple progress monitor. - private class SimpleProgressMonitor extends EclipseProgressMonitor - { - public SimpleProgressMonitor() - { - setMonitor( new ProgressMonitorWrapper( progressMonitor_ ) ); - } - - public void report( final String progress) - { - monitor_.beginTask( progress, IProgressMonitor.UNKNOWN ); - } } - + private class ProgressMonitorWrapper implements IProgressMonitor { - private IProgressMonitor monitor_; - + private IProgressMonitor monitor_ = new NullProgressMonitor(); + public ProgressMonitorWrapper( IProgressMonitor monitor ) { - monitor_ = monitor; + monitor_ = monitor; } - + public void setMonitor( IProgressMonitor monitor ) { monitor_ = monitor; diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/AbstractHandlersWidgetDefaultingCmd.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/AbstractHandlersWidgetDefaultingCmd.java index 16576c229..a7104a597 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/AbstractHandlersWidgetDefaultingCmd.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/AbstractHandlersWidgetDefaultingCmd.java @@ -18,13 +18,13 @@ import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jst.ws.internal.common.ResourceUtils; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; /** @@ -42,11 +42,11 @@ public abstract class AbstractHandlersWidgetDefaultingCmd extends EnvironmentalO Environment env = getEnvironment(); String pluginId = "org.eclipse.jst.ws.consumption.ui"; MessageUtils msgUtils_ = new MessageUtils( pluginId + ".plugin", this ); - Status status = new SimpleStatus(""); + IStatus status = Status.OK_STATUS; IStructuredSelection selection = initialSelection_; if (selection == null) { - status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED"), Status.ERROR, null); + status = StatusUtils.errorStatus( msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED") ); env.getStatusHandler().reportError(status); return status; } diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/AddHandlerDialog.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/AddHandlerDialog.java index 8a95a5a62..cf0081546 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/AddHandlerDialog.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/AddHandlerDialog.java @@ -47,7 +47,6 @@ public class AddHandlerDialog extends Dialog implements Listener { private boolean isClient_; private String className; private String name; - private String[] portNames; private String selectedPortName; private Text classNameText; @@ -261,7 +260,6 @@ public class AddHandlerDialog extends Dialog implements Listener { * @param portName The portName to set. */ public void setPortNames(String[] portNames) { - this.portNames = portNames; portNameCombo.setItems(portNames); portNameCombo.select(0); } diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/CheckWSDLValidationCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/CheckWSDLValidationCommand.java index d4ffbc13d..c221154b8 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/CheckWSDLValidationCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/CheckWSDLValidationCommand.java @@ -14,6 +14,7 @@ import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.IJobManager; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.ValidateWSDLJob; @@ -21,10 +22,8 @@ import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperat import org.eclipse.wst.command.internal.provisional.env.core.common.Choice; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.ws.internal.plugin.WSPlugin; -import org.eclipse.wst.ws.internal.ui.plugin.WSUIPlugin; public class CheckWSDLValidationCommand extends EnvironmentalOperation @@ -53,19 +52,16 @@ public class CheckWSDLValidationCommand extends EnvironmentalOperation if (ignoreWSDLValidation(env)) { // if don't want to wait for validation, cancel existing validation job existingValidateWSDLJob.cancel(); - return new SimpleStatus(""); + return Status.OK_STATUS; } else { // wait for WSDL validation - return new SimpleStatus( - "CheckWSDLValidationCommand", - msgUtils_.getMessage("WAIT_FOR_WSDL"), - Status.ERROR); + return StatusUtils.errorStatus( msgUtils_.getMessage("WAIT_FOR_WSDL") ); } } } } - return new SimpleStatus(""); + return Status.OK_STATUS; } @@ -75,8 +71,7 @@ public class CheckWSDLValidationCommand extends EnvironmentalOperation // give a warning message with the options to stop, ignore this one, or // ignore all coming messages - SimpleStatus status_ = new SimpleStatus(WSUIPlugin.ID, msgUtils_ - .getMessage("STILL_VALIDATING_WSDL"), Status.WARNING); + IStatus status_ = StatusUtils.warningStatus( msgUtils_.getMessage("STILL_VALIDATING_WSDL") ); // adding all messages from WSI Incompliances Choice ignoreChoice = new Choice('I', msgUtils_ diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ClientHandlersWidgetDefaultingCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ClientHandlersWidgetDefaultingCommand.java index 99f792b9e..effa63b29 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ClientHandlersWidgetDefaultingCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ClientHandlersWidgetDefaultingCommand.java @@ -20,6 +20,7 @@ import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jem.util.emf.workbench.ProjectUtilities; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jst.j2ee.internal.webservice.WebServiceNavigatorGroupType; @@ -34,8 +35,7 @@ import org.eclipse.jst.ws.internal.common.ResourceUtils; import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.HandlerTableItem; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.common.componentcore.ComponentCore; import org.eclipse.wst.common.componentcore.resources.ComponentHandle; import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; @@ -74,13 +74,13 @@ public class ClientHandlersWidgetDefaultingCommand extends AbstractHandlersWidge Environment env = getEnvironment(); String pluginId = "org.eclipse.jst.ws.consumption.ui"; MessageUtils msgUtils_ = new MessageUtils(pluginId + ".plugin", this); - Status status = new SimpleStatus(""); + IStatus status = Status.OK_STATUS; webServicesManager_ = new WebServicesManager(); IStructuredSelection selection = getInitialSelection(); if (selection == null) { - status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED"), Status.ERROR, null); + status = StatusUtils.errorStatus( msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED") ); env.getStatusHandler().reportError(status); return status; } @@ -90,7 +90,7 @@ public class ClientHandlersWidgetDefaultingCommand extends AbstractHandlersWidge } - public Status processHandlers() { + public IStatus processHandlers() { try { Vector handlers = new Vector(); wsRefsToHandlersTable_ = new Hashtable(); @@ -130,9 +130,9 @@ public class ClientHandlersWidgetDefaultingCommand extends AbstractHandlersWidge } } catch (Exception e) { - return new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED"), Status.ERROR, e); + return StatusUtils.errorStatus( msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED"), e); } - return new SimpleStatus(""); + return Status.OK_STATUS; } public HandlerTableItem[] getAllHandlers() { diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ClientHandlersWidgetOutputCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ClientHandlersWidgetOutputCommand.java index f19150b55..75f7c894f 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ClientHandlersWidgetOutputCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ClientHandlersWidgetOutputCommand.java @@ -20,6 +20,7 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jem.internal.plugin.JavaEMFNature; import org.eclipse.jem.java.JavaClass; import org.eclipse.jem.java.impl.JavaClassImpl; @@ -31,8 +32,7 @@ import org.eclipse.jst.j2ee.webservice.wsclient.internal.impl.Webservice_clientF import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.HandlerTableItem; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.common.internal.emf.utilities.EtoolsCopyUtility; import org.eclipse.wst.common.internal.emfworkbench.integration.EditModel; @@ -64,7 +64,7 @@ public class ClientHandlersWidgetOutputCommand extends EnvironmentalOperation { String pluginId = "org.eclipse.jst.ws.consumption.ui"; MessageUtils msgUtils_ = new MessageUtils(pluginId + ".plugin", this); - Status status = new SimpleStatus(""); + IStatus status = Status.OK_STATUS; try { @@ -139,8 +139,9 @@ public class ClientHandlersWidgetOutputCommand extends EnvironmentalOperation // } } } - catch (Exception e) { - return new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED"), Status.ERROR, e); + catch (Exception e) + { + return StatusUtils.errorStatus( msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED"), e); } finally { if (editModel_ != null) diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ConfigClientHandlersTableWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ConfigClientHandlersTableWidget.java index 5a8499ab7..2dae0b23d 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ConfigClientHandlersTableWidget.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ConfigClientHandlersTableWidget.java @@ -15,8 +15,9 @@ import java.util.Enumeration; import java.util.Hashtable; import java.util.List; import java.util.Vector; - import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredContentProvider; @@ -50,8 +51,6 @@ import org.eclipse.swt.widgets.Text; import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor; import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; /** * ConfigClientHandlersTreeWidget @@ -61,7 +60,6 @@ public class ConfigClientHandlersTableWidget extends SimpleWidgetDataContributor private String pluginId_ = "org.eclipse.jst.ws.consumption.ui"; private MessageUtils msgUtils_ = null; - private Listener statusListener_; private Composite parent_; private boolean isGenSkeletonEnabled_; private String outputLocation_; @@ -109,7 +107,6 @@ public class ConfigClientHandlersTableWidget extends SimpleWidgetDataContributor UIUtils uiUtils = new UIUtils(msgUtils_, pluginId_); parent_ = parent; - statusListener_ = statusListener; // Web service reference combo Composite webServiceRefComp = uiUtils.createComposite(parent_, 2); @@ -271,7 +268,6 @@ public class ConfigClientHandlersTableWidget extends SimpleWidgetDataContributor try { int sizeOfHandlers = wsRefsToHandlers_.size(); - String[] wsRefs = new String[sizeOfHandlers]; String[] wsRefNames = (String[]) wsRefsToHandlers_.keySet().toArray(new String[0]); webServiceRefCombo_.setItems(wsRefNames); @@ -321,8 +317,8 @@ public class ConfigClientHandlersTableWidget extends SimpleWidgetDataContributor * * @see org.eclipse.wst.command.env.ui.widgets.WidgetContributor#getStatus() */ - public Status getStatus() { - Status finalStatus = new SimpleStatus(""); + public IStatus getStatus() { + IStatus finalStatus = Status.OK_STATUS; return finalStatus; } @@ -361,7 +357,6 @@ public class ConfigClientHandlersTableWidget extends SimpleWidgetDataContributor private void handleMoveUpButtonSelected(SelectionEvent event) { int index = tableViewer_.getTable().getSelectionIndex(); - ISelection selected = tableViewer_.getSelection(); if (index != -1) { if (index > 0) { orderedHandlers_ = (Vector) wsRefsToHandlers_.get(webServiceRefCombo_.getText()); @@ -376,7 +371,6 @@ public class ConfigClientHandlersTableWidget extends SimpleWidgetDataContributor private void handleMoveDownButtonSelected(SelectionEvent event) { int index = tableViewer_.getTable().getSelectionIndex(); - ISelection selected = tableViewer_.getSelection(); if (index != -1) { if (index < orderedHandlers_.size() - 1) { orderedHandlers_ = (Vector) wsRefsToHandlers_.get(webServiceRefCombo_.getText()); @@ -469,7 +463,6 @@ public class ConfigClientHandlersTableWidget extends SimpleWidgetDataContributor ISelection selection = tableViewer_.getSelection(); if (selection != null && !selection.isEmpty() && (selection instanceof IStructuredSelection)) { int selectionIndex = handlersTable_.getSelectionIndex(); - int selectionCount = handlersTable_.getItemCount(); orderedHandlers_ = (Vector) wsRefsToHandlers_.get(webServiceRefCombo_.getText()); orderedHandlers_.remove(selectionIndex); @@ -558,8 +551,6 @@ public class ConfigClientHandlersTableWidget extends SimpleWidgetDataContributor try { if (wsRefsToHandlersArray != null) { - int sizeOfHandlers = wsRefsToHandlersArray.size(); - String[] wsRefs = new String[sizeOfHandlers]; // store the wsRefs Enumeration wsRef = wsRefsToHandlersArray.keys(); while (wsRef.hasMoreElements()) { diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ConfigServiceHandlersTableWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ConfigServiceHandlersTableWidget.java index dd749b210..d51b3a4b1 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ConfigServiceHandlersTableWidget.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ConfigServiceHandlersTableWidget.java @@ -16,8 +16,9 @@ import java.util.HashSet; import java.util.Hashtable; import java.util.List; import java.util.Vector; - import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredContentProvider; @@ -52,8 +53,6 @@ import org.eclipse.swt.widgets.Text; import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor; import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; /** * ConfigServiceHandlersTreeWidget @@ -332,8 +331,8 @@ public class ConfigServiceHandlersTableWidget extends SimpleWidgetDataContributo * * @see org.eclipse.wst.command.env.ui.widgets.WidgetContributor#getStatus() */ - public Status getStatus() { - Status finalStatus = new SimpleStatus(""); + public IStatus getStatus() { + IStatus finalStatus = Status.OK_STATUS; return finalStatus; } diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/HandlersDefaultingCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/HandlersDefaultingCommand.java index d1c36e6c2..04655e0f9 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/HandlersDefaultingCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/HandlersDefaultingCommand.java @@ -13,12 +13,12 @@ package org.eclipse.jst.ws.internal.consumption.ui.widgets; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jst.j2ee.internal.webservice.WebServiceNavigatorGroupType; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; /** @@ -36,7 +36,7 @@ public class HandlersDefaultingCommand extends AbstractHandlersWidgetDefaultingC Environment env = getEnvironment(); String pluginId = "org.eclipse.jst.ws.consumption.ui"; MessageUtils msgUtils_ = new MessageUtils(pluginId + ".plugin", this); - Status status = new SimpleStatus(""); + IStatus status = Status.OK_STATUS; IStructuredSelection selection = getInitialSelection(); if (selection != null && selection.size() == 1) { @@ -55,7 +55,7 @@ public class HandlersDefaultingCommand extends AbstractHandlersWidgetDefaultingC } } else { - status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED"), Status.ERROR, null); + status = StatusUtils.errorStatus( msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED") ); env.getStatusHandler().reportError(status); return status; } diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ImportWSILWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ImportWSILWidget.java index e1f7be27e..a2c7612e0 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ImportWSILWidget.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ImportWSILWidget.java @@ -13,9 +13,10 @@ package org.eclipse.jst.ws.internal.consumption.ui.widgets; import java.net.MalformedURLException; import java.util.ArrayList; import java.util.Iterator; - import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.emf.common.util.URI; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jst.j2ee.webservice.wsclient.ServiceRef; @@ -41,8 +42,7 @@ import org.eclipse.ui.help.IWorkbenchHelpSystem; import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor; import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.ws.internal.wsil.AddWSDLToWSILCommand; import org.eclipse.wst.wsdl.internal.impl.ServiceImpl; import org.eclipse.wst.wsdl.util.WSDLResourceImpl; @@ -71,7 +71,6 @@ public class ImportWSILWidget extends SimpleWidgetDataContributor private TableViewerEditor wsdls_; private MessageUtils msgUtils; - private IStructuredSelection selection; /** * Constructs a new page. @@ -140,24 +139,6 @@ public class ImportWSILWidget extends SimpleWidgetDataContributor return this; } - private IResource[] getWSDLResources() - { - ArrayList list = new ArrayList(); - if (selection != null && !selection.isEmpty()) - { - for (Iterator it = selection.iterator(); it.hasNext();) - { - Object object = it.next(); - if ((object instanceof IFile) && ((IFile)object).getFileExtension() != null && ((IFile)object).getFileExtension().equals("wsdl")) - list.add(object); - } - } - IResource[] res = new IResource[list.size()]; - for (int i = 0; i < res.length; i++) - res[i] = (IResource)list.get(i); - return res; - } - public void handleBrowseEvent(Event event) { DialogResourceBrowser dialog = new DialogResourceBrowser(browse_.getShell(), null, new FileExtensionFilter(new String[] {"wsil"})); @@ -172,17 +153,16 @@ public class ImportWSILWidget extends SimpleWidgetDataContributor } } - public Status getStatus() + public IStatus getStatus() { if (!wsil_.getText().endsWith(".wsil")) - return new SimpleStatus("", msgUtils.getMessage("PAGE_MSG_INVALID_WSIL_FILE_NAME"), Status.ERROR); + return StatusUtils.errorStatus( msgUtils.getMessage("PAGE_MSG_INVALID_WSIL_FILE_NAME") ); else - return new SimpleStatus(""); + return Status.OK_STATUS; } public void setInitialSelection(IStructuredSelection selection) { - this.selection = selection; ArrayList list = new ArrayList(); if (selection != null && !selection.isEmpty()) { diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ServiceHandlersWidgetDefaultingCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ServiceHandlersWidgetDefaultingCommand.java index 8bdbd01ce..800c960f0 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ServiceHandlersWidgetDefaultingCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ServiceHandlersWidgetDefaultingCommand.java @@ -13,12 +13,12 @@ package org.eclipse.jst.ws.internal.consumption.ui.widgets; import java.util.Hashtable; import java.util.List; import java.util.Vector; - import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jem.util.emf.workbench.ProjectUtilities; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jst.j2ee.internal.webservice.WebServiceNavigatorGroupType; @@ -32,8 +32,7 @@ import org.eclipse.jst.ws.internal.common.ResourceUtils; import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.HandlerTableItem; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.wsdl.Service; import org.eclipse.wst.wsdl.internal.impl.ServiceImpl; import org.eclipse.wst.wsdl.util.WSDLResourceImpl; @@ -60,12 +59,12 @@ public class ServiceHandlersWidgetDefaultingCommand extends AbstractHandlersWidg Environment env = getEnvironment(); String pluginId = "org.eclipse.jst.ws.consumption.ui"; msgUtils_ = new MessageUtils(pluginId + ".plugin", this); - Status status = new SimpleStatus(""); + IStatus status = Status.OK_STATUS; webServicesManager_ = new WebServicesManager(); IStructuredSelection selection = getInitialSelection(); if (selection == null) { - status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED"), Status.ERROR, null); + status = StatusUtils.errorStatus( msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED") ); env.getStatusHandler().reportError(status); return status; } @@ -75,7 +74,7 @@ public class ServiceHandlersWidgetDefaultingCommand extends AbstractHandlersWidg } - public Status processHandlers(Environment env) { + public IStatus processHandlers(Environment env) { try { Vector handlers = new Vector(); wsDescToHandlers_ = new Hashtable(); @@ -88,7 +87,7 @@ public class ServiceHandlersWidgetDefaultingCommand extends AbstractHandlersWidg // wsddResource_ = wsed.getWebServicesXmlResource(); if (wsddResource_ == null) { - Status status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED"), Status.ERROR, null); + IStatus status = StatusUtils.errorStatus( msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED") ); env.getStatusHandler().reportError(status); return status; } @@ -132,11 +131,12 @@ public class ServiceHandlersWidgetDefaultingCommand extends AbstractHandlersWidg handlers_ = (HandlerTableItem[]) handlers.toArray(new HandlerTableItem[0]); } } - catch (Exception e) { + catch (Exception e) + { e.printStackTrace(); - return new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED"), Status.ERROR, e); + return StatusUtils.errorStatus( msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED"), e); } - return new SimpleStatus(""); + return Status.OK_STATUS; } public HandlerTableItem[] getHandlers() { diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ServiceHandlersWidgetOutputCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ServiceHandlersWidgetOutputCommand.java index dec976ff9..677b2a224 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ServiceHandlersWidgetOutputCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ServiceHandlersWidgetOutputCommand.java @@ -18,6 +18,7 @@ import java.util.List; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jst.j2ee.webservice.wsdd.Handler; import org.eclipse.jst.j2ee.webservice.wsdd.PortComponent; import org.eclipse.jst.j2ee.webservice.wsdd.WebServiceDescription; @@ -26,8 +27,6 @@ import org.eclipse.jst.j2ee.webservice.wsdd.WsddResource; import org.eclipse.jst.j2ee.webservice.wsdd.internal.impl.WsddFactoryImpl; import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.HandlerTableItem; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; import org.eclipse.wst.common.internal.emf.utilities.EtoolsCopyUtility; /* @@ -43,7 +42,7 @@ public class ServiceHandlersWidgetOutputCommand extends EnvironmentalOperation public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) { - Status status = new SimpleStatus(""); + IStatus status = Status.OK_STATUS; try { Enumeration e = wsDescToHandlers_.keys(); while (e.hasMoreElements()) { diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/TableViewerWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/TableViewerWidget.java index 8a18713b6..9064efc8d 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/TableViewerWidget.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/TableViewerWidget.java @@ -18,9 +18,10 @@ import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; - import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jface.viewers.ColumnWeightData; import org.eclipse.jface.viewers.ILabelProviderListener; import org.eclipse.jface.viewers.ISelection; @@ -60,8 +61,7 @@ import org.eclipse.swt.widgets.Text; import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor; import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; public class TableViewerWidget extends SimpleWidgetDataContributor @@ -351,10 +351,10 @@ public class TableViewerWidget extends SimpleWidgetDataContributor } - public Status getStatus() + public IStatus getStatus() { - return message == null ? new SimpleStatus("") : - new SimpleStatus( "", message, Status.ERROR ); + return message == null ? Status.OK_STATUS : + StatusUtils.errorStatus( message ); } private void setSelectionAsObject(Object object) diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionConditionCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionConditionCommand.java index 4e9af0ff7..a5761e094 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionConditionCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionConditionCommand.java @@ -13,13 +13,13 @@ package org.eclipse.jst.ws.internal.consumption.ui.widgets; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jst.ws.internal.consumption.ui.wsil.DialogWWWAuthentication; import org.eclipse.ui.PlatformUI; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; import org.eclipse.wst.command.internal.provisional.env.core.common.Condition; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.ws.internal.parser.discovery.WebServicesParserExt; import org.eclipse.wst.ws.internal.parser.wsil.WWWAuthenticationException; import org.eclipse.wst.ws.internal.parser.wsil.WebServiceEntity; @@ -81,7 +81,7 @@ public class WSDLSelectionConditionCommand extends EnvironmentalOperation implem } catch (Throwable t) { - return new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_URI_NOT_RESOLVABLE", new Object[] {webServiceURI}), Status.ERROR, t); + return StatusUtils.errorStatus( msgUtils_.getMessage("MSG_ERROR_URI_NOT_RESOLVABLE", new Object[] {webServiceURI}), t); } finally { @@ -92,7 +92,7 @@ public class WSDLSelectionConditionCommand extends EnvironmentalOperation implem } catch (Throwable t) { - return new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_URI_NOT_RESOLVABLE", new Object[] {webServiceURI}), Status.ERROR, t); + return StatusUtils.errorStatus( msgUtils_.getMessage("MSG_ERROR_URI_NOT_RESOLVABLE", new Object[] {webServiceURI}), t); } WebServiceEntity wsEntity = parser.getWebServiceEntityByURI(webServiceURI); if (wsEntity != null) @@ -101,7 +101,7 @@ public class WSDLSelectionConditionCommand extends EnvironmentalOperation implem if (type != WebServiceEntity.TYPE_WSDL) needWSDLSelectionTreeWidget = true; } - return new SimpleStatus(""); + return Status.OK_STATUS; } public boolean evaluate() diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionOutputCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionOutputCommand.java index 981339abf..d5b070c1d 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionOutputCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionOutputCommand.java @@ -15,11 +15,11 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.ws.internal.parser.discovery.WebServicesParserExt; import org.eclipse.wst.ws.internal.parser.wsil.WebServicesParser; @@ -107,16 +107,16 @@ public class WSDLSelectionOutputCommand extends EnvironmentalOperation MessageUtils msgUtils = new MessageUtils("org.eclipse.jst.ws.consumption.ui.plugin", this); if (wsdlURI != null && getWebServicesParser().getWSDLDefinition(wsdlURI) != null) { - Status status = new SimpleStatus(""); + IStatus status = Status.OK_STATUS; Map services = getWebServicesParser().getWSDLDefinition(wsdlURI).getServices(); if (services.isEmpty()){ if (testService==true){ testService = false; - status = new SimpleStatus("", msgUtils.getMessage("MSG_WARNING_NO_SERVICE_ELEMENT"), Status.WARNING); + status = StatusUtils.warningStatus( msgUtils.getMessage("MSG_WARNING_NO_SERVICE_ELEMENT") ); try{ env.getStatusHandler().report(status); }catch(Exception e){ - status = new SimpleStatus("", msgUtils.getMessage("MSG_WARNING_NO_SERVICE_ELEMENT"), Status.ERROR); + status = StatusUtils.errorStatus( msgUtils.getMessage("MSG_WARNING_NO_SERVICE_ELEMENT") ); } } } @@ -124,7 +124,7 @@ public class WSDLSelectionOutputCommand extends EnvironmentalOperation } else { - Status status = new SimpleStatus("", msgUtils.getMessage("PAGE_MSG_SELECTION_MUST_BE_WSDL"), Status.ERROR); + IStatus status = StatusUtils.errorStatus( msgUtils.getMessage("PAGE_MSG_SELECTION_MUST_BE_WSDL") ); env.getStatusHandler().reportError(status); return status; } diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionTreeWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionTreeWidget.java index 84d8ac27a..f7b9d2b7a 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionTreeWidget.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionTreeWidget.java @@ -11,7 +11,8 @@ package org.eclipse.jst.ws.internal.consumption.ui.widgets; import java.util.List; - +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.ILabelProviderListener; import org.eclipse.jface.viewers.ISelection; @@ -35,8 +36,7 @@ import org.eclipse.ui.PlatformUI; import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor; import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.ws.internal.parser.wsil.WebServiceEntity; import org.eclipse.wst.ws.internal.parser.wsil.WebServicesParser; @@ -52,16 +52,9 @@ public class WSDLSelectionTreeWidget extends SimpleWidgetDataContributor /*CONTEXT_ID PWWS0001 for the WSDL Selection Page*/ private final String INFOPOP_PWWS_PAGE = ".PWWS0001"; - /*CONTEXT_ID PWWS0002 for the WSDL Document text field of the WSDL Selection Page*/ - private final String INFOPOP_PWWS_TEXT_WSDL = ".PWWS0002"; - - /*CONTEXT_ID PWWS0003 for the WSDL Resource Browse button of the WSDL Selection Page*/ - private final String INFOPOP_PWWS_BUTTON_BROWSE_WSDL = ".PWWS0003"; - private WebServicesParser webServicesParser; private String webServiceURI; - private Composite parent; private Listener statusListener; private TreeViewer treeViewer_; private TreeContentProvider treeContentProvider; @@ -79,7 +72,6 @@ public class WSDLSelectionTreeWidget extends SimpleWidgetDataContributor public WidgetDataEvents addControls( Composite parent, Listener statusListener ) { - this.parent = parent; this.statusListener = statusListener; parent.setToolTipText(msgUtils_.getMessage("TOOLTIP_PWWS_PAGE")); PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, pluginId_ + INFOPOP_PWWS_PAGE); @@ -189,13 +181,13 @@ public class WSDLSelectionTreeWidget extends SimpleWidgetDataContributor return null; } - public Status getStatus() + public IStatus getStatus() { WebServiceEntity wsEntity = getSelectionAsWebServiceEntity(); if (wsEntity == null || wsEntity.getType() != WebServiceEntity.TYPE_WSDL) - return new SimpleStatus("", msgUtils_.getMessage("PAGE_MSG_SELECTION_MUST_BE_WSDL"), Status.ERROR); + return StatusUtils.errorStatus( msgUtils_.getMessage("PAGE_MSG_SELECTION_MUST_BE_WSDL") ); else - return new SimpleStatus(""); + return Status.OK_STATUS; } private class TreeContentProvider implements ITreeContentProvider diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionWidgetWrapper.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionWidgetWrapper.java index 9b3397cea..e05e8fd19 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionWidgetWrapper.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionWidgetWrapper.java @@ -11,6 +11,7 @@ package org.eclipse.jst.ws.internal.consumption.ui.widgets; import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.IStatus; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.WSDLSelectionWidget; @@ -19,39 +20,26 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Listener; import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor; import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents; -import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; import org.eclipse.wst.ws.internal.parser.wsil.WebServicesParser; public class WSDLSelectionWidgetWrapper extends SimpleWidgetDataContributor { - private String pluginId; - private MessageUtils msgUtils; - - private Composite parent; - private Listener statusListener; - private WSDLSelectionWidget wsdlSelectionWidget; - private String webServiceURI; private IProject project; private String componentName; public WSDLSelectionWidgetWrapper() { - pluginId = "org.eclipse.jst.ws.consumption.ui"; - msgUtils = new MessageUtils(pluginId + ".plugin", this); } public WidgetDataEvents addControls(Composite parent, Listener statusListener) { - this.parent = parent; - this.statusListener = statusListener; wsdlSelectionWidget = new WSDLSelectionWidget(); wsdlSelectionWidget.addControls(parent, statusListener); return this; } - public Status getStatus() + public IStatus getStatus() { return wsdlSelectionWidget.getStatus(); } diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WebServiceClientTypeWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WebServiceClientTypeWidget.java index 934623ce7..d0e1d20fb 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WebServiceClientTypeWidget.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WebServiceClientTypeWidget.java @@ -15,7 +15,6 @@ import org.eclipse.jst.ws.internal.data.LabelsAndIds; import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; import org.eclipse.jst.ws.internal.ui.common.UIUtils; import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Group; @@ -33,11 +32,7 @@ public class WebServiceClientTypeWidget extends SimpleWidgetDataContributor /*CONTEXT_ID PWPR0014 for the Web Service Client Type combo box of the Project Page*/ private String INFOPOP_PWPR_COMBO_CLIENTTYPE = "PWPR0014"; private Combo clientTypeCombo_; - - /*CONTEXT_ID PWPR0006 for the Test Proxy check box of the Project Page*/ - private String INFOPOP_PWPR_CHECKBOX_TEST_PROXY = "PWPR0006"; - private Button testProxyCheckbox_; - + private TypeRuntimeServer ids_; private LabelsAndIds labelIds_; diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/GenSampleWidgetBinding.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/GenSampleWidgetBinding.java index 64f4bd77b..679b05bac 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/GenSampleWidgetBinding.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/GenSampleWidgetBinding.java @@ -15,8 +15,8 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jst.ws.internal.common.EnvironmentUtils; import org.eclipse.jst.ws.internal.common.ResourceUtils; import org.eclipse.jst.ws.internal.common.StringToIProjectTransformer; import org.eclipse.jst.ws.internal.consumption.command.common.AddModuleToServerCommand; @@ -52,8 +52,6 @@ import org.eclipse.wst.command.internal.env.ui.widgets.WidgetRegistry; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; import org.eclipse.wst.command.internal.provisional.env.core.context.ResourceContext; import org.eclipse.wst.command.internal.provisional.env.core.data.DataMappingRegistry; import org.eclipse.wst.command.internal.provisional.env.core.data.Transformer; @@ -151,7 +149,7 @@ public class GenSampleWidgetBinding implements CommandWidgetBinding public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) { Environment env = getEnvironment(); - Status status = new SimpleStatus( "" ); + IStatus status = Status.OK_STATUS; // Split up the project and module int index = module_.indexOf("/"); @@ -187,7 +185,7 @@ public class GenSampleWidgetBinding implements CommandWidgetBinding clientInfo.setServerInstanceId(createServerCommand.getServerInstanceId()); } else if (createServerStatus.getSeverity()==Status.ERROR){ - env.getStatusHandler().reportError( EnvironmentUtils.convertIStatusToStatus(createServerStatus)); + env.getStatusHandler().reportError( createServerStatus ); } } @@ -206,7 +204,7 @@ public class GenSampleWidgetBinding implements CommandWidgetBinding } command.setEnvironment( env ); - status = EnvironmentUtils.convertIStatusToStatus(command.execute( null, null )); + status = command.execute( monitor, null ); if (status.getSeverity()==Status.ERROR) { env.getStatusHandler().reportError(status); diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ServerExtensionOutputCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ServerExtensionOutputCommand.java index fa344f59f..3e1f4a628 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ServerExtensionOutputCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ServerExtensionOutputCommand.java @@ -13,9 +13,6 @@ package org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; -import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; import org.eclipse.wst.ws.internal.parser.discovery.WebServicesParserExt; import org.eclipse.wst.ws.internal.parser.wsil.WebServicesParser; import org.eclipse.wst.ws.internal.provisional.wsrt.IWebService; @@ -28,46 +25,6 @@ public class ServerExtensionOutputCommand extends EnvironmentalOperation private boolean isWebProjectStartupRequested_ = false; - public boolean isUndoable(){ - return true; - } - - public Status undo(Environment env){ - - - Status stat = new SimpleStatus(""); - - //Commenting out all extranseous sever startups - /* - try { - - // check existingServer - if (fExistingServer!=null) { - - // get EAR project - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - IProject earProject = null; - if (earProjectName_!=null && earProjectName_.length()>0) { - earProject = root.getProject(earProjectName_); - } - - AbstractStartServer startServerCommand = null; - WebServiceStartServerRegistry reg = WebServiceStartServerRegistry.getInstance(); - startServerCommand = (AbstractStartServer)reg.getServerStartByTypeId(fExistingServer.getServerType().getId()); - if (earProject!=null) { - startServerCommand.runPreServerConfig(fExistingServer, earProject); - } - } - } - catch (CoreException ce ) { - IStatus embeddedStatus = ce.getStatus(); - stat = EnvironmentUtils.convertIStatusToStatus(embeddedStatus); - env.getStatusHandler().reportError(stat); - return stat; - } - */ - return stat; - } /** * @return Returns the wsdlURI. diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/AbstractObjectSelectionWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/AbstractObjectSelectionWidget.java index 7a8b886c0..cdb6e3b1f 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/AbstractObjectSelectionWidget.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/AbstractObjectSelectionWidget.java @@ -11,11 +11,11 @@ package org.eclipse.jst.ws.internal.consumption.ui.widgets.object; import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; public abstract class AbstractObjectSelectionWidget extends SimpleWidgetDataContributor implements IObjectSelectionWidget @@ -31,10 +31,10 @@ public abstract class AbstractObjectSelectionWidget extends SimpleWidgetDataCont return new StructuredSelection(); } - public Status validateSelection(IStructuredSelection objectSelection) + public IStatus validateSelection(IStructuredSelection objectSelection) { // subclass should override this method - return new SimpleStatus(""); + return Status.OK_STATUS; } public IProject getProject() diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/EJBSelectionWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/EJBSelectionWidget.java index 922cf67ed..2caee32e8 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/EJBSelectionWidget.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/EJBSelectionWidget.java @@ -13,9 +13,10 @@ package org.eclipse.jst.ws.internal.consumption.ui.widgets.object; import java.util.Collections; import java.util.Iterator; import java.util.Vector; - import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jst.j2ee.ejb.EJBJar; @@ -37,8 +38,7 @@ import org.eclipse.swt.widgets.Table; import org.eclipse.ui.PlatformUI; import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; public class EJBSelectionWidget extends AbstractObjectSelectionWidget implements IObjectSelectionWidget @@ -376,19 +376,19 @@ public class EJBSelectionWidget extends AbstractObjectSelectionWidget implements return null; } - public Status validateSelection(IStructuredSelection objectSelection) + public IStatus validateSelection(IStructuredSelection objectSelection) { - return new SimpleStatus(""); + return Status.OK_STATUS; } - public Status getStatus() + public IStatus getStatus() { if (selectedBeanIndex == null) { - return new SimpleStatus("","",Status.ERROR); + return StatusUtils.errorStatus( "" ); } - return new SimpleStatus(""); + return Status.OK_STATUS; } }
\ No newline at end of file diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/IObjectSelectionWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/IObjectSelectionWidget.java index 3bafa00e6..1383a1781 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/IObjectSelectionWidget.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/IObjectSelectionWidget.java @@ -11,9 +11,9 @@ package org.eclipse.jst.ws.internal.consumption.ui.widgets.object; import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.IStatus; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataContributor; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; /** * This interface defines extra methods that Object Selection Widgets @@ -50,7 +50,7 @@ public interface IObjectSelectionWidget extends WidgetDataContributor * @param objectSelection the object to be validated. * @return the status of the validation. */ - public Status validateSelection(IStructuredSelection objectSelection); + public IStatus validateSelection(IStructuredSelection objectSelection); /** * diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/JavaBeanSelectionWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/JavaBeanSelectionWidget.java index 17962a766..d0d2ede1f 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/JavaBeanSelectionWidget.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/JavaBeanSelectionWidget.java @@ -15,6 +15,8 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.emf.ecore.EObject; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IType; @@ -22,7 +24,6 @@ import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.wizard.IWizardContainer; import org.eclipse.jst.j2ee.webservice.wsdd.BeanLink; import org.eclipse.jst.j2ee.webservice.wsdd.internal.impl.PortComponentImpl; import org.eclipse.jst.j2ee.webservice.wsdd.internal.impl.ServiceImplBeanImpl; @@ -43,8 +44,7 @@ import org.eclipse.swt.widgets.Text; import org.eclipse.ui.PlatformUI; import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; public class JavaBeanSelectionWidget extends AbstractObjectSelectionWidget implements IObjectSelectionWidget @@ -53,7 +53,6 @@ public class JavaBeanSelectionWidget extends AbstractObjectSelectionWidget imple private IProject serverProject_ = null; private String serverComponentName_ = null; private Composite parent_ = null; - private IWizardContainer context_ = null; private JavaResourceFilter filter_ = new JavaResourceFilter(); private IResource initialResource_ = null; private Listener statusListener; @@ -261,19 +260,19 @@ public class JavaBeanSelectionWidget extends AbstractObjectSelectionWidget imple return serverComponentName_; } - public Status getStatus() + public IStatus getStatus() { String beanClassName = beanClassText_.getText().trim(); if (beanClassName == null || beanClassName.length() <= 0) { MessageUtils msgUtils = new MessageUtils(pluginId_ + ".plugin", this); - return new SimpleStatus("", msgUtils.getMessage("PAGE_MSG_BEAN_CANNOT_BE_EMPTY"), Status.ERROR); + return StatusUtils.errorStatus( msgUtils.getMessage("PAGE_MSG_BEAN_CANNOT_BE_EMPTY") ); } - return new SimpleStatus(""); + return Status.OK_STATUS; } - public Status validateSelection(IStructuredSelection objectSelection) + public IStatus validateSelection(IStructuredSelection objectSelection) { - return new SimpleStatus(""); + return Status.OK_STATUS; } }
\ No newline at end of file diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ObjectSelectionOutputCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ObjectSelectionOutputCommand.java index 0b8e748e2..5c4ab9f56 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ObjectSelectionOutputCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ObjectSelectionOutputCommand.java @@ -17,6 +17,7 @@ import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jst.ws.internal.common.ResourceUtils; import org.eclipse.jst.ws.internal.consumption.ui.wsrt.WebServiceImpl; @@ -24,8 +25,6 @@ import org.eclipse.jst.ws.internal.consumption.ui.wsrt.WebServiceRuntimeExtensio import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; import org.eclipse.wst.command.internal.provisional.env.core.common.StatusException; import org.eclipse.wst.command.internal.provisional.env.core.data.Transformer; import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; @@ -76,7 +75,7 @@ public class ObjectSelectionOutputCommand extends EnvironmentalOperation } // Validation - Status status = (objectSelectionWidget_ != null) ? objectSelectionWidget_.validateSelection(getObjectSelection()) : new SimpleStatus(""); + IStatus status = (objectSelectionWidget_ != null) ? objectSelectionWidget_.validateSelection(getObjectSelection()) : Status.OK_STATUS; if (status.getSeverity() != Status.OK) { try diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ObjectSelectionWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ObjectSelectionWidget.java index 9695f9fbd..779de1ee1 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ObjectSelectionWidget.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ObjectSelectionWidget.java @@ -14,6 +14,8 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jst.ws.internal.common.ResourceUtils; import org.eclipse.jst.ws.internal.consumption.ui.wsrt.WebServiceImpl; @@ -26,8 +28,6 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Listener; import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; import org.eclipse.wst.ws.internal.provisional.wsrt.WebServiceScenario; @@ -38,7 +38,6 @@ public class ObjectSelectionWidget extends AbstractObjectSelectionWidget impleme private Composite parent; private Listener statusListener; private Composite composite; - private TypeRuntimeServer typeRuntimeServer; private IStructuredSelection initialSelection; private IProject project; private String componentName; @@ -58,7 +57,6 @@ public class ObjectSelectionWidget extends AbstractObjectSelectionWidget impleme */ public void setTypeRuntimeServer(TypeRuntimeServer typeRuntimeServer) { - this.typeRuntimeServer = typeRuntimeServer; if (composite != null) { composite.dispose(); @@ -126,9 +124,9 @@ public class ObjectSelectionWidget extends AbstractObjectSelectionWidget impleme } } - public Status getStatus() + public IStatus getStatus() { - return (child != null) ? child.getStatus() : new SimpleStatus(""); + return (child != null) ? child.getStatus() : Status.OK_STATUS; } public void setInitialSelection(IStructuredSelection initialSelection) @@ -145,9 +143,9 @@ public class ObjectSelectionWidget extends AbstractObjectSelectionWidget impleme return (child != null) ? child.getObjectSelection() : null; } - public Status validateSelection(IStructuredSelection objectSelection) + public IStatus validateSelection(IStructuredSelection objectSelection) { - return (child != null) ? child.validateSelection(objectSelection) : new SimpleStatus(""); + return (child != null) ? child.validateSelection(objectSelection) : Status.OK_STATUS; } public IProject getProject() diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ValidationMessageViewerWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ValidationMessageViewerWidget.java index 3540e4d14..7c55b0114 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ValidationMessageViewerWidget.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ValidationMessageViewerWidget.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.jst.ws.internal.consumption.ui.widgets.object; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jface.viewers.ColumnWeightData; import org.eclipse.jface.viewers.IContentProvider; import org.eclipse.jface.viewers.ILabelProviderListener; @@ -33,23 +35,15 @@ import org.eclipse.ui.PlatformUI; import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor; import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.wsdl.validation.internal.IValidationMessage; public class ValidationMessageViewerWidget extends SimpleWidgetDataContributor { private int DEFAULT_TABLE_HEIGHT_HINT = 100; - private int DEFAULT_COLUMN_WIDTH = 20; - -// private String[] columns_; private TableViewer tableViewer_; private Table table_; - - private Composite parent_; - private Listener statusListener_; - private String message = null; static final String columns_[] = {"severity", "line", "column", "message"}; static final int columnsWidth_[] = {10, 10, 10, 60}; @@ -62,9 +56,6 @@ public class ValidationMessageViewerWidget extends SimpleWidgetDataContributor public WidgetDataEvents addControls( Composite parent, Listener statusListener ) { - parent_ = parent; - statusListener_ = statusListener; - String pluginId = "org.eclipse.jst.ws.consumption.ui"; MessageUtils msgUtils = new MessageUtils( pluginId + ".plugin", this ); @@ -133,10 +124,10 @@ public class ValidationMessageViewerWidget extends SimpleWidgetDataContributor return tableViewer_.getContentProvider(); } - public Status getStatus() + public IStatus getStatus() { - return message == null ? new SimpleStatus("") : - new SimpleStatus( "", message, Status.ERROR ); + return message == null ? Status.OK_STATUS : + StatusUtils.errorStatus(message ); } public void refresh() diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionWidget.java index d850219ba..707c9f279 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionWidget.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionWidget.java @@ -17,8 +17,10 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IWorkspaceRoot; import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.IJobChangeEvent; import org.eclipse.core.runtime.jobs.IJobManager; import org.eclipse.core.runtime.jobs.Job; @@ -49,8 +51,7 @@ import org.eclipse.swt.widgets.Text; import org.eclipse.ui.PlatformUI; import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; import org.eclipse.wst.ws.internal.parser.wsil.WebServiceEntity; import org.eclipse.wst.ws.internal.parser.wsil.WebServicesParser; @@ -215,7 +216,7 @@ public class WSDLSelectionWidget extends AbstractObjectSelectionWidget implement statusListener_.handleEvent(null); } - public Status getStatus() + public IStatus getStatus() { // Timer validation /* @@ -228,17 +229,17 @@ public class WSDLSelectionWidget extends AbstractObjectSelectionWidget implement // For example, is it pointing to an existing resource in the workspace? String wsPath = webServiceURI.getText(); if( wsPath == null || wsPath.length() <= 0 ) - return new SimpleStatus("", msgUtils_.getMessage("PAGE_MSG_INVALID_WEB_SERVICE_URI"), Status.ERROR); + return StatusUtils.errorStatus( msgUtils_.getMessage("PAGE_MSG_INVALID_WEB_SERVICE_URI") ); else if( wsPath.indexOf(':') < 0 ) { IResource res = ResourceUtils.findResource(wsPath); if( res == null ) { msgViewer_.clearInput(); - return new SimpleStatus("", msgUtils_.getMessage("PAGE_MSG_NO_SUCH_FILE", new Object[] {wsPath}), Status.ERROR); + return StatusUtils.errorStatus( msgUtils_.getMessage("PAGE_MSG_NO_SUCH_FILE", new Object[] {wsPath}) ); } else if( res.getType() != IResource.FILE ) { msgViewer_.clearInput(); - return new SimpleStatus("", msgUtils_.getMessage("PAGE_MSG_INVALID_WEB_SERVICE_URI"), Status.ERROR); + return StatusUtils.errorStatus( msgUtils_.getMessage("PAGE_MSG_INVALID_WEB_SERVICE_URI") ); } } @@ -247,7 +248,7 @@ public class WSDLSelectionWidget extends AbstractObjectSelectionWidget implement // For example, is selection a WSDL URI? if (!Timer.isRunning() && tree.isEnabled()) { - Status status = tree.getStatus(); + IStatus status = tree.getStatus(); if (status != null) { int severity = status.getSeverity(); @@ -264,7 +265,7 @@ public class WSDLSelectionWidget extends AbstractObjectSelectionWidget implement String wsdlURI = iFile2URI((IFile)ResourceUtils.findResource(wsPath)); if (webServicesParser.getWSDLDefinition(wsdlURI) == null) { msgViewer_.clearInput(); - return new SimpleStatus("", msgUtils_.getMessage("PAGE_MSG_SELECTION_MUST_BE_WSDL"), Status.ERROR); + return StatusUtils.errorStatus(msgUtils_.getMessage("PAGE_MSG_SELECTION_MUST_BE_WSDL") ); } } } @@ -292,7 +293,7 @@ public class WSDLSelectionWidget extends AbstractObjectSelectionWidget implement // OK status - return new SimpleStatus( "" ); + return Status.OK_STATUS; } private void validateWSDL (String wsdlURI, boolean isRemote) { @@ -402,9 +403,9 @@ public class WSDLSelectionWidget extends AbstractObjectSelectionWidget implement return webServicesParser; } - public Status validateSelection(IStructuredSelection objectSelection) + public IStatus validateSelection(IStructuredSelection objectSelection) { - return new SimpleStatus(""); + return Status.OK_STATUS; } public IProject getProject() diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ClientRuntimeSelectionWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ClientRuntimeSelectionWidget.java index fc6195c3d..f9adcab51 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ClientRuntimeSelectionWidget.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ClientRuntimeSelectionWidget.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jst.ws.internal.consumption.ui.common.ValidationUtils; import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; import org.eclipse.jst.ws.internal.ui.common.UIUtils; @@ -25,8 +27,6 @@ import org.eclipse.swt.widgets.Listener; import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor; import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; import org.eclipse.wst.command.internal.provisional.env.core.selection.SelectionList; import org.eclipse.wst.command.internal.provisional.env.core.selection.SelectionListChoices; import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; @@ -39,19 +39,13 @@ public class ClientRuntimeSelectionWidget extends SimpleWidgetDataContributor /* CONTEXT_ID PWRS0003 for the Wizard Scenario Client configuration of the Runtime Selection Page */ private String INFOPOP_PWRS_GROUP_CLIENT = pluginId_ + ".PWRS0003"; - private String clientScenarioId; private Group clientGroup_; private RuntimeServerSelectionWidget runtimeWidget_; private SelectionListChoices runtime2ClientTypes_; private Combo clientType_; private SelectionAdapter clientTypeSelListener; private ProjectSelectionWidget projectWidget_; - private boolean isVisible_; - - // rsk revisit - Putting this in temporarily. The RuntimeSelectionDialog needs the server - // information even when it is launched for the client half of the configuration. - private String serviceScenarioId; - // + private boolean isVisible_; public WidgetDataEvents addControls( Composite parent, final Listener statusListener ) @@ -322,11 +316,11 @@ public class ClientRuntimeSelectionWidget extends SimpleWidgetDataContributor /* (non-Javadoc) * @see org.eclipse.wst.command.env.ui.widgets.WidgetContributor#getStatus() */ - public Status getStatus() + public IStatus getStatus() { - Status finalStatus = new SimpleStatus( "" ); - Status projectStatus = projectWidget_.getStatus(); - Status runtimeStatus = runtimeWidget_.getStatus(); + IStatus finalStatus = Status.OK_STATUS; + IStatus projectStatus = projectWidget_.getStatus(); + IStatus runtimeStatus = runtimeWidget_.getStatus(); if( runtimeStatus.getSeverity() == Status.ERROR ) { @@ -355,7 +349,7 @@ public class ClientRuntimeSelectionWidget extends SimpleWidgetDataContributor String clientEARCompName = projectWidget_.getEarComponentName(); //Validate that the selected client project is of the type indicated by client project type. - Status clientProjectTypeStatus = valUtils.validateProjectType(clientProjName, runtime2ClientTypes_); + IStatus clientProjectTypeStatus = valUtils.validateProjectType(clientProjName, runtime2ClientTypes_); if (clientProjectTypeStatus.getSeverity() == Status.ERROR) { finalStatus = clientProjectTypeStatus; @@ -364,7 +358,7 @@ public class ClientRuntimeSelectionWidget extends SimpleWidgetDataContributor //Validate client side server targets and J2EE levels String clientServerFactoryId = getClientTypeRuntimeServer().getServerId(); String clientJ2EElevel = getJ2EEVersion(); - Status clientProjectStatus = valUtils.validateProjectTargetAndJ2EE(clientProjName, clientCompName, clientEARName, clientEARCompName, clientServerFactoryId, + IStatus clientProjectStatus = valUtils.validateProjectTargetAndJ2EE(clientProjName, clientCompName, clientEARName, clientEARCompName, clientServerFactoryId, clientJ2EElevel); if (clientProjectStatus.getSeverity() == Status.ERROR) { diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ClientRuntimeSelectionWidgetDefaultingCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ClientRuntimeSelectionWidgetDefaultingCommand.java index 9554ffd79..2caed055a 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ClientRuntimeSelectionWidgetDefaultingCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ClientRuntimeSelectionWidgetDefaultingCommand.java @@ -18,6 +18,7 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jem.util.emf.workbench.ProjectUtilities; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jst.ws.internal.common.J2EEUtils; @@ -33,8 +34,7 @@ import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.command.internal.provisional.env.core.context.ResourceContext; import org.eclipse.wst.command.internal.provisional.env.core.selection.SelectionList; import org.eclipse.wst.command.internal.provisional.env.core.selection.SelectionListChoices; @@ -219,7 +219,7 @@ public class ClientRuntimeSelectionWidgetDefaultingCommand extends Environmental setClientDefaultProject(); setClientDefaultEAR(); - Status serverStatus = setClientDefaultServer(); + IStatus serverStatus = setClientDefaultServer(); if (serverStatus.getSeverity()== Status.ERROR) { env.getStatusHandler().reportError(serverStatus); @@ -229,11 +229,11 @@ public class ClientRuntimeSelectionWidgetDefaultingCommand extends Environmental //Calculate default IWebServiceClient setDefaultsForExtension(env); - return new SimpleStatus(""); + return Status.OK_STATUS; } catch (Exception e) { //Catch all Exceptions in order to give some feedback to the user - Status errorStatus = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED",new String[]{e.getMessage()}),Status.ERROR, e); + IStatus errorStatus = StatusUtils.errorStatus(msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED",new String[]{e.getMessage()}), e); env.getStatusHandler().reportError(errorStatus); return errorStatus; } @@ -751,9 +751,9 @@ public class ClientRuntimeSelectionWidgetDefaultingCommand extends Environmental } } - private Status setClientDefaultServer() + private IStatus setClientDefaultServer() { - Status status = new SimpleStatus(""); + IStatus status = Status.OK_STATUS; //Calculate reasonable default server based on initial project selection. String initialClientProjectName = runtimeClientTypes_.getChoice().getChoice().getList().getSelection(); IProject initialClientProject = ProjectUtilities.getProject(initialClientProjectName); @@ -847,7 +847,7 @@ public class ClientRuntimeSelectionWidgetDefaultingCommand extends Environmental { String runtimeLabel = WebServiceRuntimeExtensionUtils.getRuntimeLabelById(clientIds_.getRuntimeId()); String serverLabels = getServerLabels(clientIds_.getRuntimeId()); - status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_NO_SERVER_RUNTIME", new String[]{runtimeLabel, serverLabels}),Status.ERROR); + status = StatusUtils.errorStatus(msgUtils_.getMessage("MSG_ERROR_NO_SERVER_RUNTIME", new String[]{runtimeLabel, serverLabels}) ); } } diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ProjectSelectionWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ProjectSelectionWidget.java index 12616081e..81a2cd5a6 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ProjectSelectionWidget.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ProjectSelectionWidget.java @@ -12,6 +12,8 @@ package org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jem.util.emf.workbench.ProjectUtilities; import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; import org.eclipse.jst.ws.internal.common.J2EEUtils; @@ -30,8 +32,7 @@ import org.eclipse.swt.widgets.Text; import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor; import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.command.internal.provisional.env.core.selection.SelectionListChoices; import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; @@ -519,8 +520,8 @@ public class ProjectSelectionWidget extends SimpleWidgetDataContributor { return true; } - private Status handleSetMessageText() { - Status status = new SimpleStatus(""); + private IStatus handleSetMessageText() { + IStatus status = Status.OK_STATUS; try { byte result = (byte) 0; if (module_.getText().length() != 0 && earModule_.getText().length() != 0) { @@ -551,7 +552,7 @@ public class ProjectSelectionWidget extends SimpleWidgetDataContributor { } } catch (Exception e) { - return new SimpleStatus("", msgUtils.getMessage("PAGE_MSG_VALIDATION_INTERNAL_ERROR"), Status.ERROR); + return StatusUtils.errorStatus( msgUtils.getMessage("PAGE_MSG_VALIDATION_INTERNAL_ERROR"), e ); } return status; } @@ -580,8 +581,9 @@ public class ProjectSelectionWidget extends SimpleWidgetDataContributor { return msg != null ? msgUtils.getMessage(msg, new Object[] { serviceOrClient}) : ""; } - public Status getStatus() { - Status finalStatus = new SimpleStatus(""); + public IStatus getStatus() + { + IStatus finalStatus = Status.OK_STATUS; handleSetMessageText(); String projectText = moduleProject_.getText(); String earText = earProject_.getText(); @@ -590,28 +592,28 @@ public class ProjectSelectionWidget extends SimpleWidgetDataContributor { if (projectText==null || projectText.length()==0) { if (isClient_) - return new SimpleStatus("",msgUtils.getMessage("MSG_CLIENT_PROJECT_EMPTY", new String[]{""} ),Status.ERROR); + return StatusUtils.errorStatus( msgUtils.getMessage("MSG_CLIENT_PROJECT_EMPTY", new String[]{""} ) ); else - return new SimpleStatus("",msgUtils.getMessage("MSG_SERVICE_PROJECT_EMPTY", new String[]{""} ),Status.ERROR); + return StatusUtils.errorStatus( msgUtils.getMessage("MSG_SERVICE_PROJECT_EMPTY", new String[]{""} ) ); } if (needEAR_ && (earText==null || earText.length()==0)) { if (isClient_) - return new SimpleStatus("",msgUtils.getMessage("MSG_CLIENT_EAR_EMPTY", new String[]{""} ),Status.ERROR); + return StatusUtils.errorStatus( msgUtils.getMessage("MSG_CLIENT_EAR_EMPTY", new String[]{""} ) ); else - return new SimpleStatus("",msgUtils.getMessage("MSG_SERVICE_EAR_EMPTY", new String[]{""} ),Status.ERROR); + return StatusUtils.errorStatus( msgUtils.getMessage("MSG_SERVICE_EAR_EMPTY", new String[]{""} ) ); } if( module_ == null || module_.getText().length() == 0 ) { if( isClient_ ) { - return new SimpleStatus("",msgUtils.getMessage("MSG_CLIENT_PROJECT_EMPTY", new String[]{moduleText} ),Status.ERROR); + return StatusUtils.errorStatus( msgUtils.getMessage("MSG_CLIENT_PROJECT_EMPTY", new String[]{moduleText} ) ); } else { - return new SimpleStatus("",msgUtils.getMessage("MSG_CLIENT_EAR_EMPTY", new String[]{moduleText} ),Status.ERROR); + return StatusUtils.errorStatus( msgUtils.getMessage("MSG_CLIENT_EAR_EMPTY", new String[]{moduleText} ) ); } } @@ -619,11 +621,11 @@ public class ProjectSelectionWidget extends SimpleWidgetDataContributor { { if( isClient_ ) { - return new SimpleStatus("",msgUtils.getMessage("MSG_CLIENT_EAR_EMPTY", new String[]{moduleText} ),Status.ERROR); + return StatusUtils.errorStatus( msgUtils.getMessage("MSG_CLIENT_EAR_EMPTY", new String[]{moduleText} ) ); } else { - return new SimpleStatus("",msgUtils.getMessage("MSG_SERVICE_EAR_EMPTY", new String[]{moduleText} ),Status.ERROR); + return StatusUtils.errorStatus( msgUtils.getMessage("MSG_SERVICE_EAR_EMPTY", new String[]{moduleText} ) ); } } diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/RuntimeServerSelectionWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/RuntimeServerSelectionWidget.java index dd65f10af..6b4db2bf1 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/RuntimeServerSelectionWidget.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/RuntimeServerSelectionWidget.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jface.window.Window; import org.eclipse.jst.ws.internal.common.J2EEUtils; import org.eclipse.jst.ws.internal.consumption.ui.wizard.RuntimeServerSelectionDialog; @@ -28,8 +30,7 @@ import org.eclipse.swt.widgets.Text; import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor; import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.server.core.IRuntime; import org.eclipse.wst.server.core.IServerType; import org.eclipse.wst.server.core.ServerCore; @@ -194,9 +195,9 @@ public class RuntimeServerSelectionWidget extends SimpleWidgetDataContributor /* (non-Javadoc) * @see org.eclipse.wst.command.env.ui.widgets.WidgetContributor#getStatus() */ - public Status getStatus() + public IStatus getStatus() { - Status status = new SimpleStatus( "" ); + IStatus status = Status.OK_STATUS; String scenario = isClientContext_ ? msgUtils_.getMessage( "MSG_CLIENT_SUB" ) : msgUtils_.getMessage( "MSG_SERVICE_SUB" ); @@ -206,11 +207,11 @@ public class RuntimeServerSelectionWidget extends SimpleWidgetDataContributor if( ids_.getRuntimeId() == null || runtimeLabel == null || runtimeLabel.equals("" )) { - status = new SimpleStatus( "", msgUtils_.getMessage( "MSG_NO_RUNTIME", new String[]{ scenario } ), Status.ERROR ); + status = StatusUtils.errorStatus(msgUtils_.getMessage( "MSG_NO_RUNTIME", new String[]{ scenario } ) ); } else if( ids_.getServerId() == null || serverLabel.equals( "" )) { - status = new SimpleStatus( "", msgUtils_.getMessage( "MSG_NO_SERVER", new String[]{ scenario } ), Status.ERROR ); + status = StatusUtils.errorStatus( msgUtils_.getMessage( "MSG_NO_SERVER", new String[]{ scenario } ) ); } //Check if only stub runtime is available for the selected server type @@ -238,7 +239,7 @@ public class RuntimeServerSelectionWidget extends SimpleWidgetDataContributor if (!foundNonStubRuntime) { String servertypeLabel = WebServiceRuntimeExtensionUtils.getServerLabelById(serverFactoryId); - status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_STUB_ONLY",new String[]{servertypeLabel}), Status.ERROR); + status = StatusUtils.errorStatus( msgUtils_.getMessage("MSG_ERROR_STUB_ONLY",new String[]{servertypeLabel}) ); } } @@ -250,7 +251,7 @@ public class RuntimeServerSelectionWidget extends SimpleWidgetDataContributor if (!WebServiceRuntimeExtensionUtils.webServiceClientRuntimeTypeExists( ids_.getServerId(), ids_.getRuntimeId(), ids_.getTypeId())) { - status = new SimpleStatus( "", msgUtils_.getMessage( "MSG_INVALID_SRT_SELECTIONS", new String[]{ scenario } ), Status.ERROR ); + status = StatusUtils.errorStatus( msgUtils_.getMessage( "MSG_INVALID_SRT_SELECTIONS", new String[]{ scenario } ) ); } } @@ -260,7 +261,7 @@ public class RuntimeServerSelectionWidget extends SimpleWidgetDataContributor { if (!WebServiceRuntimeExtensionUtils.isServerRuntimeTypeSupported(ids_.getServerId(), ids_.getRuntimeId(), ids_.getTypeId())) { - status = new SimpleStatus( "", msgUtils_.getMessage( "MSG_INVALID_SRT_SELECTIONS", new String[]{ scenario } ), Status.ERROR ); + status = StatusUtils.errorStatus( msgUtils_.getMessage( "MSG_INVALID_SRT_SELECTIONS", new String[]{ scenario } ) ); } } diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/ClientTestDelegateCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/ClientTestDelegateCommand.java index 119211d8e..d3ada9f1b 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/ClientTestDelegateCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/ClientTestDelegateCommand.java @@ -16,7 +16,7 @@ import java.util.Vector; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.ws.internal.common.EnvironmentUtils; +import org.eclipse.core.runtime.Status; import org.eclipse.jst.ws.internal.context.ScenarioContext; import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; import org.eclipse.jst.ws.internal.ext.test.WebServiceTestExtension; @@ -24,9 +24,8 @@ import org.eclipse.jst.ws.internal.ext.test.WebServiceTestRegistry; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; import org.eclipse.wst.command.internal.provisional.env.core.ICommandFactory; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; import org.eclipse.wst.command.internal.provisional.env.core.common.StatusHandler; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.command.internal.provisional.env.core.selection.BooleanSelection; import org.eclipse.wst.command.internal.provisional.env.core.selection.SelectionList; import org.eclipse.wst.server.core.IServer; @@ -75,7 +74,7 @@ public class ClientTestDelegateCommand extends EnvironmentalOperation public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) { Environment env = getEnvironment(); - Status status = new SimpleStatus( "" ); + IStatus status = Status.OK_STATUS; String clientTestID = testFacilities.getSelection(); //Get the webservice extension @@ -84,11 +83,11 @@ public class ClientTestDelegateCommand extends EnvironmentalOperation IWebServiceTester iwst = (IWebServiceTester)wscte.getWebServiceExecutableExtension(); TestInfo testInfo = getTestInfo(); - status = commandFactoryExecution(iwst.generate(testInfo),env); + status = commandFactoryExecution(iwst.generate(testInfo),env, monitor ); if(status.getSeverity() == Status.ERROR){ return status; } - status = commandFactoryExecution(iwst.launch(testInfo),env); + status = commandFactoryExecution(iwst.launch(testInfo),env, monitor ); if(status.getSeverity() == Status.ERROR){ return status; } @@ -96,9 +95,9 @@ public class ClientTestDelegateCommand extends EnvironmentalOperation return status; } - private Status commandFactoryExecution(ICommandFactory commandFactory,Environment env) + private IStatus commandFactoryExecution(ICommandFactory commandFactory,Environment env, IProgressMonitor monitor ) { - Status status = new SimpleStatus( "" ); + IStatus status = Status.OK_STATUS; while(commandFactory.hasNext()) { @@ -107,11 +106,11 @@ public class ClientTestDelegateCommand extends EnvironmentalOperation try { - status = EnvironmentUtils.convertIStatusToStatus(operation.execute( null, null )); + status = operation.execute( monitor, null ); } catch( Exception exc ) { - status = new SimpleStatus( "id", exc.getMessage(), Status.ERROR, exc ); + status = StatusUtils.errorStatus( exc ); } if(status.getSeverity() == Status.ERROR){ diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/ClientTestWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/ClientTestWidget.java index 523bd3ca7..87d54067f 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/ClientTestWidget.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/ClientTestWidget.java @@ -75,8 +75,6 @@ public class ClientTestWidget extends SimpleWidgetDataContributor private String INFOPOP_PWSM_COMBO_PROJECT = "PWSM0010"; private Tree methodsTree_; - /*CONTEXT_ID PWSM0005 for the Methods tree of the Sample Page*/ - private String INFOPOP_PWSM_TREE_METHODS = "PWSM0005"; private Button selectAllMethodsButton_; /*CONTEXT_ID PWSM0006 for the Select All button of the Sample Page*/ @@ -98,13 +96,10 @@ public class ClientTestWidget extends SimpleWidgetDataContributor /*CONTEXT_ID PWSM0016 for the EAR combo box of the Sample Page*/ private String INFOPOP_PWSM_EAR_COMBO = "PWSM0016"; - private Label projectExistsLabel_; - private Label earExistsLabel_; private Composite comboGroup_; private SelectionList testFacilities_; private FolderResourceFilter folderFilter_ = new FolderResourceFilter(); private IStructuredSelection initialSelection_; - private String launchedServiceTestName; private boolean isTestWidget = false; public WidgetDataEvents addControls( Composite parent, Listener statusListener ) @@ -133,14 +128,14 @@ public class ClientTestWidget extends SimpleWidgetDataContributor "TOOLTIP_PWSM_COMBOBOX_TEST", INFOPOP_PWSM_COMBOBOX_TEST, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY ); - Label dummyLabel = new Label( comboGroup_, SWT.NONE ); + new Label( comboGroup_, SWT.NONE ); projectCombo_ = uiUtils.createCombo( comboGroup_, "LABEL_JSP_PROJECT_NAME", "TOOLTIP_PWSM_COMBO_PROJECT", INFOPOP_PWSM_COMBO_PROJECT, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY ); projectCombo_.setEnabled( false ); - projectExistsLabel_ = new Label( comboGroup_, SWT.NONE ); + new Label( comboGroup_, SWT.NONE ); earCombo_ = uiUtils.createCombo( comboGroup_, "LABEL_EAR_PROJECTS", @@ -148,7 +143,7 @@ public class ClientTestWidget extends SimpleWidgetDataContributor INFOPOP_PWSM_EAR_COMBO, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY ); earCombo_.setEnabled( false ); - earExistsLabel_ = new Label( comboGroup_, SWT.NONE ); + new Label( comboGroup_, SWT.NONE ); @@ -376,7 +371,6 @@ public class ClientTestWidget extends SimpleWidgetDataContributor public void setLaunchedServiceTestName (String launchedServiceTestName) { - this.launchedServiceTestName = launchedServiceTestName; } public boolean getRunClientTest() diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/CopyWebServiceUtilsJarCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/CopyWebServiceUtilsJarCommand.java index 8e62f5e02..a59314578 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/CopyWebServiceUtilsJarCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/CopyWebServiceUtilsJarCommand.java @@ -19,17 +19,17 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Plugin; +import org.eclipse.core.runtime.Status; import org.eclipse.jem.util.emf.workbench.ProjectUtilities; import org.eclipse.jst.ws.internal.common.J2EEUtils; import org.eclipse.jst.ws.internal.consumption.plugin.WebServiceConsumptionPlugin; -import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin; import org.eclipse.wst.command.internal.env.common.FileResourceUtils; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.command.internal.provisional.env.core.common.ProgressUtils; import org.eclipse.wst.command.internal.provisional.env.core.common.StatusHandler; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.command.internal.provisional.env.core.context.ResourceContext; import org.eclipse.wst.command.internal.provisional.env.core.context.TransientResourceContext; @@ -60,16 +60,16 @@ public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) try { - env.getProgressMonitor().report( msgUtils.getMessage( "PROGRESS_INFO_COPY_WEBSERVICE_UTILS" ) ); + ProgressUtils.report( monitor, msgUtils.getMessage( "PROGRESS_INFO_COPY_WEBSERVICE_UTILS" ) ); IProject sampleIProject = ProjectUtilities.getProject(sampleProject); IPath webModulePath = J2EEUtils.getWebContentPath(sampleIProject, sampleC); if (webModulePath == null) - return new SimpleStatus(WebServiceConsumptionUIPlugin.ID,msgUtils.getMessage("MSG_ERROR_PROJECT_NOT_FOUND"), Status.ERROR); + return StatusUtils.errorStatus( msgUtils.getMessage("MSG_ERROR_PROJECT_NOT_FOUND") ); - Status status = copyIFile("webserviceutils.jar",webModulePath,"WEB-INF/lib/webserviceutils.jar", WebServiceConsumptionPlugin.getInstance(),env); + IStatus status = copyIFile("webserviceutils.jar",webModulePath,"WEB-INF/lib/webserviceutils.jar", WebServiceConsumptionPlugin.getInstance(),env, monitor); if(status.getSeverity() == Status.ERROR){ StatusHandler sHandler = env.getStatusHandler(); - Status errorStatus = new SimpleStatus("", msgUtils.getMessage("MSG_ERROR_FILECOPY_WEBSERVICE_UTILS"), Status.ERROR); + IStatus errorStatus = StatusUtils.errorStatus( msgUtils.getMessage("MSG_ERROR_FILECOPY_WEBSERVICE_UTILS") ); sHandler.reportError(errorStatus); return status; } @@ -78,24 +78,24 @@ public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) } catch (Exception e) { StatusHandler sHandler = env.getStatusHandler(); - Status errorStatus = new SimpleStatus("", msgUtils.getMessage("MSG_ERROR_FILECOPY_WEBSERVICE_UTILS"), Status.ERROR); + IStatus errorStatus = StatusUtils.errorStatus( msgUtils.getMessage("MSG_ERROR_FILECOPY_WEBSERVICE_UTILS") ); sHandler.reportError(errorStatus); - return new SimpleStatus(WebServiceConsumptionUIPlugin.ID,msgUtils.getMessage("MSG_ERROR_FILECOPY_WEBSERVICE_UTILS"),Status.ERROR,e); + return StatusUtils.errorStatus( msgUtils.getMessage("MSG_ERROR_FILECOPY_WEBSERVICE_UTILS"), e); } - return new SimpleStatus(""); + return Status.OK_STATUS; } /** * */ -private Status copyIFile(String source, IPath targetPath, String targetFile, Plugin plugin,Environment env) +private IStatus copyIFile(String source, IPath targetPath, String targetFile, Plugin plugin,Environment env, IProgressMonitor monitor ) { if (plugin != null) { IPath target = targetPath.append(new Path(targetFile)); - env.getProgressMonitor().report( msgUtils.getMessage( "PROGRESS_INFO_COPYING_FILE" ) ); + ProgressUtils.report( monitor, msgUtils.getMessage( "PROGRESS_INFO_COPYING_FILE" ) ); try { ResourceContext context = new TransientResourceContext(); @@ -103,18 +103,18 @@ private Status copyIFile(String source, IPath targetPath, String targetFile, Plu context.setCreateFoldersEnabled(true); context.setCheckoutFilesEnabled(true); IResource resource = FileResourceUtils.findResource(target); - if(resource != null) return new SimpleStatus(""); + if(resource != null) return Status.OK_STATUS; FileResourceUtils.createFile(context, target, plugin.openStream(new Path(source)), - env.getProgressMonitor(), + monitor, env.getStatusHandler()); } catch (Exception e) { - return new SimpleStatus(WebServiceConsumptionUIPlugin.ID,msgUtils.getMessage("MSG_ERROR_FILECOPY_WEBSERVICE_UTILS"),Status.ERROR,e); + return StatusUtils.errorStatus( msgUtils.getMessage("MSG_ERROR_FILECOPY_WEBSERVICE_UTILS") ,e); } } - return new SimpleStatus(""); + return Status.OK_STATUS; } public void setSampleProject(String sampleProject) diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/CreateSampleProjectCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/CreateSampleProjectCommand.java index 9cbe7b497..e1009b69a 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/CreateSampleProjectCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/CreateSampleProjectCommand.java @@ -15,14 +15,12 @@ import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.ws.internal.common.EnvironmentUtils; +import org.eclipse.core.runtime.Status; import org.eclipse.jst.ws.internal.consumption.command.common.AddModuleToServerCommand; import org.eclipse.jst.ws.internal.consumption.command.common.AssociateModuleWithEARCommand; import org.eclipse.jst.ws.internal.consumption.command.common.CreateModuleCommand; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; import org.eclipse.wst.server.core.IServer; public class CreateSampleProjectCommand extends EnvironmentalOperation @@ -59,7 +57,7 @@ public class CreateSampleProjectCommand extends EnvironmentalOperation command.setServerInstanceId(existingServer.getId()); command.setJ2eeLevel(j2eeVersion); command.setEnvironment( env ); - Status status = EnvironmentUtils.convertIStatusToStatus(command.execute( null, null ) ); + IStatus status = command.execute( monitor, null ) ; if (status.getSeverity()==Status.ERROR) { env.getStatusHandler().reportError(status); @@ -78,7 +76,7 @@ public class CreateSampleProjectCommand extends EnvironmentalOperation commandEAR.setServerInstanceId(existingServer.getId()); commandEAR.setJ2eeLevel(j2eeVersion); commandEAR.setEnvironment( env ); - status = EnvironmentUtils.convertIStatusToStatus(commandEAR.execute( null, null )); + status = commandEAR.execute( monitor, null ); if (status.getSeverity()==Status.ERROR) { env.getStatusHandler().reportError(status); @@ -95,7 +93,7 @@ public class CreateSampleProjectCommand extends EnvironmentalOperation //so the component name needs to somehow be piped into this command associateCommand.setEar(sampleProjectEar); associateCommand.setEnvironment( env ); - status = EnvironmentUtils.convertIStatusToStatus(associateCommand.execute(null, null)); + status = associateCommand.execute( monitor, null ); if (status.getSeverity()==Status.ERROR) { env.getStatusHandler().reportError(status); @@ -110,7 +108,7 @@ public class CreateSampleProjectCommand extends EnvironmentalOperation //so the component name needs to somehow be piped into this command commandInstall.setModule(sampleProjectEar); commandInstall.setEnvironment( env ); - status = EnvironmentUtils.convertIStatusToStatus(commandInstall.execute( null, null )); + status = commandInstall.execute( monitor, null ) ; if (status.getSeverity()==Status.ERROR) { env.getStatusHandler().reportError(status); @@ -126,7 +124,7 @@ public class CreateSampleProjectCommand extends EnvironmentalOperation commandInstall.setModule(sampleProject); commandInstall.setEnvironment( env ); - status = EnvironmentUtils.convertIStatusToStatus(commandInstall.execute( null, null )); + status = commandInstall.execute( monitor, null ) ; if (status.getSeverity()==Status.ERROR) { env.getStatusHandler().reportError(status); @@ -135,7 +133,7 @@ public class CreateSampleProjectCommand extends EnvironmentalOperation } } - return new SimpleStatus(""); + return Status.OK_STATUS; } public void setSampleProject(String sampleProject) diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/FinishDefaultCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/FinishDefaultCommand.java index 6c9b38fb3..f227f408d 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/FinishDefaultCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/FinishDefaultCommand.java @@ -14,9 +14,8 @@ package org.eclipse.jst.ws.internal.consumption.ui.widgets.test; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; import org.eclipse.wst.server.core.IServer; import org.eclipse.wst.server.core.ServerCore; @@ -40,7 +39,7 @@ public class FinishDefaultCommand extends EnvironmentalOperation public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) { - Status status = new SimpleStatus( "" ); + IStatus status = Status.OK_STATUS; if(sampleServerInstanceId != null){ sampleExistingServer = ServerCore.findServer(sampleServerInstanceId); if (sampleExistingServer != null) diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/FinishTestFragment.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/FinishTestFragment.java index 5000b7790..c5d4b774f 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/FinishTestFragment.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/FinishTestFragment.java @@ -33,7 +33,6 @@ import org.eclipse.wst.command.internal.provisional.env.core.common.Condition; public class FinishTestFragment extends BooleanFragment{ private boolean isTestWidget; - private boolean launchedTest; private boolean generateProxy; private String launchedServiceTestName; private boolean testService; diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/TestDefaultingFragment.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/TestDefaultingFragment.java index f4a8e8917..3bc51a4a0 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/TestDefaultingFragment.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/TestDefaultingFragment.java @@ -19,10 +19,10 @@ package org.eclipse.jst.ws.internal.consumption.ui.widgets.test; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jst.ws.internal.context.ScenarioContext; import org.eclipse.jst.ws.internal.plugin.WebServicePlugin; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; import org.eclipse.wst.command.internal.provisional.env.core.selection.SelectionList; @@ -42,7 +42,7 @@ public class TestDefaultingFragment extends EnvironmentalOperation public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) { - SimpleStatus status = new SimpleStatus(""); + IStatus status = Status.OK_STATUS; scenarioContext = WebServicePlugin.getInstance().getScenarioContext().copy(); // test facilities diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/WSDLTestLaunchCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/WSDLTestLaunchCommand.java index 32855382e..8262a4fbc 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/WSDLTestLaunchCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/WSDLTestLaunchCommand.java @@ -19,7 +19,7 @@ import java.util.List; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.ws.internal.common.EnvironmentUtils; +import org.eclipse.core.runtime.Status; import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; import org.eclipse.jst.ws.internal.ext.test.WebServiceTestExtension; import org.eclipse.jst.ws.internal.ext.test.WebServiceTestRegistry; @@ -27,9 +27,8 @@ import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperat import org.eclipse.wst.command.internal.provisional.env.core.ICommandFactory; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; import org.eclipse.wst.command.internal.provisional.env.core.common.StatusHandler; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.server.core.IServer; import org.eclipse.wst.server.core.ServerCore; import org.eclipse.wst.ws.internal.provisional.wsrt.IWebServiceTester; @@ -63,7 +62,7 @@ public class WSDLTestLaunchCommand extends EnvironmentalOperation public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) { Environment env = getEnvironment(); - Status status = new SimpleStatus(""); + IStatus status = Status.OK_STATUS; WebServiceTestRegistry testRegistry = WebServiceTestRegistry.getInstance(); WebServiceTestExtension wscte = (WebServiceTestExtension)testRegistry.getWebServiceExtensionsByName(testID); @@ -71,12 +70,12 @@ public class WSDLTestLaunchCommand extends EnvironmentalOperation TestInfo testInfo = getTestInfo(); - status = commandFactoryExecution(iwst.launch(testInfo),env); + status = commandFactoryExecution(iwst.launch(testInfo),env, monitor); //Dont need to shut everything down because the wsdl test doesnt work if(status.getSeverity() != Status.OK){ StatusHandler sHandler = env.getStatusHandler(); - Status infoStatus = new SimpleStatus("", msgUtils.getMessage("MSG_ERROR_UNABLE_TO_LAUNCH_WSDL_TEST"), Status.INFO); + IStatus infoStatus = StatusUtils.infoStatus( msgUtils.getMessage("MSG_ERROR_UNABLE_TO_LAUNCH_WSDL_TEST") ); sHandler.reportInfo(infoStatus); return infoStatus; } @@ -84,9 +83,9 @@ public class WSDLTestLaunchCommand extends EnvironmentalOperation } - private Status commandFactoryExecution(ICommandFactory commandFactory,Environment env) + private IStatus commandFactoryExecution(ICommandFactory commandFactory,Environment env, IProgressMonitor monitor) { - Status status = new SimpleStatus( "" ); + IStatus status = Status.OK_STATUS; while(commandFactory.hasNext()) { EnvironmentalOperation operation = commandFactory.getNextCommand(); @@ -96,11 +95,11 @@ public class WSDLTestLaunchCommand extends EnvironmentalOperation try { operation.setEnvironment( env ); - status = EnvironmentUtils.convertIStatusToStatus(operation.execute( null, null )); + status = operation.execute( monitor, null ); } catch( Exception exc ) { - status = new SimpleStatus( "id", exc.getMessage(), Status.ERROR, exc ); + status = StatusUtils.errorStatus( exc ); } } diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/WebServiceClientTestArrivalCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/WebServiceClientTestArrivalCommand.java index 8fb89ea33..0f07fb9c9 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/WebServiceClientTestArrivalCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/WebServiceClientTestArrivalCommand.java @@ -16,19 +16,18 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jem.java.JavaClass; import org.eclipse.jem.java.JavaHelpers; import org.eclipse.jem.java.Method; import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jst.ws.internal.common.EnvironmentUtils; import org.eclipse.jst.ws.internal.common.J2EEUtils; import org.eclipse.jst.ws.internal.consumption.command.common.JavaMofReflectionCommand; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; import org.eclipse.wst.command.internal.provisional.env.core.common.StatusHandler; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.command.internal.provisional.env.core.selection.BooleanSelection; @@ -74,7 +73,7 @@ public class WebServiceClientTestArrivalCommand extends EnvironmentalOperation { Environment env = getEnvironment(); - Status status = new SimpleStatus( "" ); + IStatus status = Status.OK_STATUS; sampleProjectAndEarSetup(env); @@ -94,7 +93,7 @@ public class WebServiceClientTestArrivalCommand extends EnvironmentalOperation */ if(proxyBean == null){ StatusHandler sHandler = env.getStatusHandler(); - Status errorStatus = new SimpleStatus("", msgUtils.getMessage("MSG_ERROR_JTS_PROXY_NOT_COMPILED"), Status.ERROR); + IStatus errorStatus = StatusUtils.errorStatus( msgUtils.getMessage("MSG_ERROR_JTS_PROXY_NOT_COMPILED") ); sHandler.reportError(errorStatus); return errorStatus; @@ -109,12 +108,12 @@ public class WebServiceClientTestArrivalCommand extends EnvironmentalOperation try{ - Status mofStatus = EnvironmentUtils.convertIStatusToStatus(javamofcommand.execute( null, null)); + IStatus mofStatus = javamofcommand.execute( monitor, null); if(mofStatus.getSeverity() == Status.ERROR) return mofStatus; }catch(Exception exc){ StatusHandler sHandler = env.getStatusHandler(); - Status errorStatus = new SimpleStatus("", msgUtils.getMessage("MSG_ERROR_JTS_PROXY_NOT_COMPILED"), Status.ERROR); + IStatus errorStatus = StatusUtils.errorStatus( msgUtils.getMessage("MSG_ERROR_JTS_PROXY_NOT_COMPILED") ); sHandler.reportError(errorStatus); return errorStatus; } diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/explorer/ExplorerServiceTestCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/explorer/ExplorerServiceTestCommand.java index 58adb2695..5e4d8112f 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/explorer/ExplorerServiceTestCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/explorer/ExplorerServiceTestCommand.java @@ -18,14 +18,12 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.ws.internal.common.EnvironmentUtils; +import org.eclipse.core.runtime.Status; import org.eclipse.jst.ws.internal.common.ResourceUtils; import org.eclipse.jst.ws.internal.consumption.command.common.StartProjectCommand; import org.eclipse.jst.ws.internal.ext.test.WSDLTestFinishCommand; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; import org.eclipse.wst.server.core.IServer; import org.eclipse.wst.ws.internal.explorer.LaunchOption; import org.eclipse.wst.ws.internal.explorer.LaunchOptions; @@ -53,7 +51,7 @@ public class ExplorerServiceTestCommand extends EnvironmentalOperation implement { Environment env = getEnvironment(); - Status status = new SimpleStatus( "" ); + IStatus status = Status.OK_STATUS; StartProjectCommand spc = new StartProjectCommand( true ); spc.setServiceServerTypeID(serviceServerTypeID); @@ -63,7 +61,7 @@ public class ExplorerServiceTestCommand extends EnvironmentalOperation implement spc.setIsWebProjectStartupRequested(true); spc.setEnvironment( env ); - status = EnvironmentUtils.convertIStatusToStatus(spc.execute( null, null )); + status = spc.execute( monitor, null ); if (status.getSeverity() == Status.ERROR) return status; @@ -80,7 +78,7 @@ public class ExplorerServiceTestCommand extends EnvironmentalOperation implement launchOptionVector.add(new LaunchOption(LaunchOptions.WEB_SERVICE_ENDPOINT, it.next().toString())); launchCommand.setLaunchOptions((LaunchOption[])launchOptionVector.toArray(new LaunchOption[0])); launchCommand.setEnvironment( env ); - status = EnvironmentUtils.convertIStatusToStatus(launchCommand.execute( null, null )); + status = launchCommand.execute( monitor, null ); return status; } diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/explorer/WSEGenerateCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/explorer/WSEGenerateCommand.java index cdbf17e2b..8753c1bcc 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/explorer/WSEGenerateCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/explorer/WSEGenerateCommand.java @@ -6,13 +6,11 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jst.ws.internal.common.EnvironmentUtils; import org.eclipse.jst.ws.internal.consumption.command.common.StartProjectCommand; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; import org.eclipse.wst.ws.internal.explorer.LaunchOption; import org.eclipse.wst.ws.internal.explorer.LaunchOptions; import org.eclipse.wst.ws.internal.explorer.WSExplorerLauncherCommand; @@ -32,7 +30,7 @@ public class WSEGenerateCommand extends EnvironmentalOperation { Environment env = getEnvironment(); - Status status = new SimpleStatus( "" ); + IStatus status = Status.OK_STATUS; StartProjectCommand spc = new StartProjectCommand( true ); spc.setServiceServerTypeID(testInfo.getServiceServerTypeID()); @@ -42,7 +40,7 @@ public class WSEGenerateCommand extends EnvironmentalOperation spc.setIsWebProjectStartupRequested(true); spc.setEnvironment( env ); - status = EnvironmentUtils.convertIStatusToStatus(spc.execute( null, null ) ); + status = spc.execute( monitor, null ); if (status.getSeverity() == Status.ERROR) return status; @@ -59,7 +57,7 @@ public class WSEGenerateCommand extends EnvironmentalOperation launchOptionVector.add(new LaunchOption(LaunchOptions.WEB_SERVICE_ENDPOINT, it.next().toString())); launchCommand.setLaunchOptions((LaunchOption[])launchOptionVector.toArray(new LaunchOption[0])); launchCommand.setEnvironment( env ); - status = EnvironmentUtils.convertIStatusToStatus(launchCommand.execute( null, null )); + status = launchCommand.execute( monitor, null ); return status; } } diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/AddModuleDependenciesCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/AddModuleDependenciesCommand.java index 39ed4da45..3a3d8a180 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/AddModuleDependenciesCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/AddModuleDependenciesCommand.java @@ -17,6 +17,7 @@ import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.Status; import org.eclipse.jdt.core.IClasspathEntry; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.JavaCore; @@ -24,7 +25,6 @@ import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jem.util.emf.workbench.ProjectUtilities; import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest; import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.ws.internal.common.EnvironmentUtils; import org.eclipse.jst.ws.internal.common.J2EEUtils; import org.eclipse.jst.ws.internal.consumption.command.common.AddModuleToServerCommand; import org.eclipse.jst.ws.internal.consumption.command.common.AssociateModuleWithEARCommand; @@ -32,8 +32,6 @@ import org.eclipse.jst.ws.internal.consumption.command.common.CreateModuleComman import org.eclipse.jst.ws.internal.consumption.command.common.StartServerCommand; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; import org.eclipse.wst.ws.internal.provisional.wsrt.TestInfo; public class AddModuleDependenciesCommand extends EnvironmentalOperation @@ -61,7 +59,7 @@ public class AddModuleDependenciesCommand extends EnvironmentalOperation Environment env = getEnvironment(); try { - createSampleProjects(env); + createSampleProjects(env, monitor ); clientIProject = ProjectUtilities.getProject(testInfo.getClientProject()); if (clientIProject != null && !J2EEUtils.isWebComponent(clientIProject, testInfo.getClientModule())) @@ -79,7 +77,7 @@ public class AddModuleDependenciesCommand extends EnvironmentalOperation catch (CoreException ce) { } - return new SimpleStatus(""); + return Status.OK_STATUS; } private void addJavaProjectAsUtilityJar(IProject javaProject, IProject earProject, String uri) @@ -99,7 +97,8 @@ public class AddModuleDependenciesCommand extends EnvironmentalOperation public static final String DEFAULT_SAMPLE_EAR_PROJECT_EXT = "EAR"; - private void createSampleProjects(Environment env){ + private void createSampleProjects(Environment env, IProgressMonitor monitor ) + { @@ -127,7 +126,7 @@ public class AddModuleDependenciesCommand extends EnvironmentalOperation createEAR.setModuleType(CreateModuleCommand.EAR); createEAR.setJ2eeLevel(J2EEUtils.getJ2EEVersionAsString(clientIProject,testInfo.getClientModule())); createEAR.setEnvironment( env ); - Status status = EnvironmentUtils.convertIStatusToStatus(createEAR.execute( null, null ) ); + IStatus status = createEAR.execute( monitor, null ); if (status.getSeverity()==Status.ERROR) { env.getStatusHandler().reportError(status); @@ -138,7 +137,7 @@ public class AddModuleDependenciesCommand extends EnvironmentalOperation modToServer.setProject(sampleEARProject); modToServer.setServerInstanceId(testInfo.getClientExistingServer().getId()); modToServer.setEnvironment( env ); - status = EnvironmentUtils.convertIStatusToStatus(modToServer.execute( null, null )); + status = modToServer.execute( monitor, null ); if (status.getSeverity()==Status.ERROR) { env.getStatusHandler().reportError(status); @@ -157,7 +156,7 @@ public class AddModuleDependenciesCommand extends EnvironmentalOperation createSample.setServerFactoryId(testInfo.getClientServerTypeID()); createSample.setJ2eeLevel(J2EEUtils.getJ2EEVersionAsString(clientIProject,testInfo.getClientModule())); createSample.setEnvironment( env ); - Status status = EnvironmentUtils.convertIStatusToStatus(createSample.execute( null, null )); + IStatus status = createSample.execute( monitor, null ); if (testInfo.getClientNeedEAR()) { // Associate the client module and service EAR @@ -167,7 +166,7 @@ public class AddModuleDependenciesCommand extends EnvironmentalOperation associateCommand.setEARProject(sampleEARProject); associateCommand.setEar(sampleEARModule); associateCommand.setEnvironment( env ); - status = EnvironmentUtils.convertIStatusToStatus(associateCommand.execute( null, null )); + status = associateCommand.execute( monitor, null ); if (status.getSeverity()==Status.ERROR) { env.getStatusHandler().reportError(status); @@ -177,7 +176,7 @@ public class AddModuleDependenciesCommand extends EnvironmentalOperation StartServerCommand startServer = new StartServerCommand(false, true); startServer.setServerInstanceId(testInfo.getClientExistingServer().getId()); startServer.setEnvironment( env ); - status = EnvironmentUtils.convertIStatusToStatus(startServer.execute( null, null )); + status = startServer.execute( monitor, null ); if (status.getSeverity()==Status.ERROR) { env.getStatusHandler().reportError(status); diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/GSTCGenerateCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/GSTCGenerateCommand.java index c10e861b9..c4948d088 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/GSTCGenerateCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/GSTCGenerateCommand.java @@ -9,8 +9,8 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Status; import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jst.ws.internal.common.EnvironmentUtils; import org.eclipse.jst.ws.internal.common.J2EEUtils; import org.eclipse.jst.ws.internal.consumption.sampleapp.codegen.InputFileGenerator; import org.eclipse.jst.ws.internal.consumption.sampleapp.codegen.MethodFileGenerator; @@ -21,8 +21,7 @@ import org.eclipse.jst.ws.internal.consumption.sampleapp.command.JavaToModelComm import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.CopyWebServiceUtilsJarCommand; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; +import org.eclipse.wst.ws.internal.common.EnvironmentUtils; import org.eclipse.wst.ws.internal.datamodel.Model; import org.eclipse.wst.ws.internal.provisional.wsrt.TestInfo; @@ -45,15 +44,15 @@ public class GSTCGenerateCommand extends EnvironmentalOperation public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) { Environment env = getEnvironment(); - IStatus status = new SimpleStatus( "" ); + IStatus status = Status.OK_STATUS; CopyWebServiceUtilsJarCommand copy = new CopyWebServiceUtilsJarCommand(); copy.setSampleProject(testInfo.getGenerationProject()); copy.setSampleComponent(testInfo.getGenerationModule()); copy.setEnvironment( env ); - status = copy.execute( null, null); + status = copy.execute( monitor, null); if (status.getSeverity() == Status.ERROR) return status; setJSPFolder(); - status = createModel(env); + status = createModel(env, monitor); if (status.getSeverity() == Status.ERROR) return status; status = generatePages(env); if (status.getSeverity() == Status.ERROR) return status; @@ -82,13 +81,13 @@ public class GSTCGenerateCommand extends EnvironmentalOperation } //create the model from the resource - private Status createModel(Environment env) { + private IStatus createModel(Environment env, IProgressMonitor monitor ) { JavaToModelCommand jtmc = new JavaToModelCommand(); jtmc.setMethods(testInfo.getMethods()); jtmc.setClientProject(testInfo.getClientProject()); jtmc.setProxyBean(testInfo.getProxyBean()); jtmc.setEnvironment( env ); - Status status = EnvironmentUtils.convertIStatusToStatus(jtmc.execute( null, null)); + IStatus status = jtmc.execute( monitor, null); if (status.getSeverity() == Status.ERROR) return status; proxyModel = jtmc.getJavaDataModel(); return status; @@ -100,7 +99,7 @@ public class GSTCGenerateCommand extends EnvironmentalOperation */ private IStatus generatePages(Environment env) { - IStatus status = new SimpleStatus( "" ); + IStatus status = Status.OK_STATUS; IPath fDestinationFolderPath = new Path(jspfolder); fDestinationFolderPath = fDestinationFolderPath.makeAbsolute(); IWorkspaceRoot fWorkspace = ResourcesPlugin.getWorkspace().getRoot(); diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/GSTCLaunchCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/GSTCLaunchCommand.java index 695013533..bab8354f2 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/GSTCLaunchCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/GSTCLaunchCommand.java @@ -9,8 +9,8 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Status; import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jst.ws.internal.common.EnvironmentUtils; import org.eclipse.jst.ws.internal.common.J2EEUtils; import org.eclipse.jst.ws.internal.common.ServerUtils; import org.eclipse.jst.ws.internal.consumption.command.common.PublishProjectCommand; @@ -23,9 +23,8 @@ import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperat import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; import org.eclipse.wst.command.internal.provisional.env.core.common.Log; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; import org.eclipse.wst.command.internal.provisional.env.core.common.StatusException; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.ws.internal.provisional.wsrt.TestInfo; public class GSTCLaunchCommand extends EnvironmentalOperation @@ -52,7 +51,7 @@ public class GSTCLaunchCommand extends EnvironmentalOperation setJSPFolder(); - return launchSample(env); + return launchSample(env, monitor); } private void setJSPFolder(){ //if the client is not a webcomponent then the @@ -75,22 +74,22 @@ public class GSTCLaunchCommand extends EnvironmentalOperation } - private Status launchSample (Environment env) { - Status status = new SimpleStatus( "" ); - IPath fDestinationFolderPath = new Path(jspfolder); - fDestinationFolderPath = fDestinationFolderPath.makeAbsolute(); + private IStatus launchSample (Environment env, IProgressMonitor monitor ) { + IStatus status = Status.OK_STATUS; + IPath fDestinationFolderPath = new Path(jspfolder); + fDestinationFolderPath = fDestinationFolderPath.makeAbsolute(); PublishProjectCommand ppc = new PublishProjectCommand(); ppc.setServerTypeID(testInfo.getClientServerTypeID()); ppc.setExistingServer(testInfo.getClientExistingServer()); ppc.setProject(testInfo.getGenerationProject()); ppc.setEnvironment( env ); - status = EnvironmentUtils.convertIStatusToStatus(ppc.execute( null, null )); + status = ppc.execute( monitor, null ); StartServerCommand serverCommand = new StartServerCommand( true, true ); serverCommand.setServerInstanceId( testInfo.getClientExistingServer().getId() ); serverCommand.setEnvironment( env ); - status = EnvironmentUtils.convertIStatusToStatus(serverCommand.execute(null, null)); + status = serverCommand.execute(monitor, null); if (status.getSeverity() == Status.ERROR) return status; IProject sampleProject = ProjectUtilities.getProject(testInfo.getGenerationProject()); @@ -138,20 +137,20 @@ public class GSTCLaunchCommand extends EnvironmentalOperation }catch(PartInitException exc){ //TODO: change error message env.getLog().log(Log.WARNING, 5048, this, "launchSample", exc); - status = new SimpleStatus( "launchSample", msgUtils.getMessage("MSG_ERROR_MALFORMED_URL"), Status.WARNING ); + status = StatusUtils.warningStatus( msgUtils.getMessage("MSG_ERROR_MALFORMED_URL") ); try { env.getStatusHandler().report(status); } catch (StatusException e) { - status = new SimpleStatus( "launchSample", msgUtils.getMessage("MSG_ERROR_MALFORMED_URL"), Status.ERROR ); + status = StatusUtils.errorStatus( msgUtils.getMessage("MSG_ERROR_MALFORMED_URL"), e ); } return status; }catch(MalformedURLException exc){ env.getLog().log(Log.WARNING, 5048, this, "launchSample", exc); - status = new SimpleStatus( "launchSample", msgUtils.getMessage("MSG_ERROR_MALFORMED_URL"), Status.WARNING ); + status = StatusUtils.warningStatus( msgUtils.getMessage("MSG_ERROR_MALFORMED_URL"), exc ); try { env.getStatusHandler().report(status); } catch (StatusException e) { - status = new SimpleStatus( "launchSample", msgUtils.getMessage("MSG_ERROR_MALFORMED_URL"), Status.ERROR ); + status = StatusUtils.errorStatus( msgUtils.getMessage("MSG_ERROR_MALFORMED_URL"), e ); } return status; } diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/WSSampleFinishCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/WSSampleFinishCommand.java index 3879329e4..ff3324a04 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/WSSampleFinishCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/WSSampleFinishCommand.java @@ -24,7 +24,7 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; -import org.eclipse.jst.ws.internal.common.EnvironmentUtils; +import org.eclipse.core.runtime.Status; import org.eclipse.jst.ws.internal.common.ResourceUtils; import org.eclipse.jst.ws.internal.consumption.command.common.PublishProjectCommand; import org.eclipse.jst.ws.internal.consumption.command.common.StartProjectCommand; @@ -44,11 +44,11 @@ import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperat import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; import org.eclipse.wst.command.internal.provisional.env.core.common.Log; import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; -import org.eclipse.wst.command.internal.provisional.env.core.common.Status; import org.eclipse.wst.command.internal.provisional.env.core.common.StatusException; +import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; import org.eclipse.wst.command.internal.provisional.env.core.selection.BooleanSelection; import org.eclipse.wst.server.core.IServer; +import org.eclipse.wst.ws.internal.common.EnvironmentUtils; import org.eclipse.wst.ws.internal.datamodel.Model; public class WSSampleFinishCommand extends EnvironmentalOperation implements JavaProxyTestCommand @@ -88,19 +88,19 @@ public class WSSampleFinishCommand extends EnvironmentalOperation implements Jav { Environment env = getEnvironment(); - Status status = new SimpleStatus( "" ); + IStatus status = Status.OK_STATUS; //setters and getters to be removed CopyWebServiceUtilsJarCommand copy = new CopyWebServiceUtilsJarCommand(); copy.setSampleProject(sampleProject); copy.setEnvironment( env ); - status = EnvironmentUtils.convertIStatusToStatus(copy.execute( null, null ) ); + status = copy.execute( monitor, null ); if (status.getSeverity() == Status.ERROR) return status; - status = createModel(env); + status = createModel(env, monitor ); if (status.getSeverity() == Status.ERROR) return status; - status = generatePages(env); + status = generatePages(env, monitor ); if (status.getSeverity() == Status.ERROR) return status; //if (!isSuccessful()) return; - status = launchSample(env); + status = launchSample(env, monitor); return status; } @@ -109,9 +109,9 @@ public class WSSampleFinishCommand extends EnvironmentalOperation implements Jav * Generate the four jsps that make up this * sample app. */ - protected Status generatePages(Environment env) + protected IStatus generatePages(Environment env, IProgressMonitor monitor ) { - Status status = new SimpleStatus( "" ); + IStatus status = Status.OK_STATUS; IPath fDestinationFolderPath = new Path(jspFolder); fDestinationFolderPath = fDestinationFolderPath.makeAbsolute(); IWorkspaceRoot fWorkspace = ResourcesPlugin.getWorkspace().getRoot(); @@ -122,7 +122,7 @@ public class WSSampleFinishCommand extends EnvironmentalOperation implements Jav new TestClientFileGenerator(INPUT,METHOD,RESULT),fileTest); //gpcTest.setStatusMonitor(getStatusMonitor()); gpcTest.setEnvironment( env ); - status = EnvironmentUtils.convertIStatusToStatus(gpcTest.execute( null, null ) ); + status = gpcTest.execute( monitor, null ); if (status.getSeverity() == Status.ERROR ) return status; @@ -135,7 +135,7 @@ public class WSSampleFinishCommand extends EnvironmentalOperation implements Jav inputGenerator,fileInput); //gpcInput.setStatusMonitor(getStatusMonitor()); gpcInput.setEnvironment( env ); - status = EnvironmentUtils.convertIStatusToStatus(gpcInput.execute( null, null )); + status = gpcInput.execute( monitor, null ); if (status.getSeverity() == Status.ERROR ) return status; @@ -148,7 +148,7 @@ public class WSSampleFinishCommand extends EnvironmentalOperation implements Jav methodGenerator,fileMethod); //gpcMethod.setStatusMonitor(getStatusMonitor()); gpcMethod.setEnvironment( env ); - status = EnvironmentUtils.convertIStatusToStatus(gpcMethod.execute( null, null )); + status = gpcMethod.execute( monitor, null ); if (status.getSeverity() == Status.ERROR ) return status; @@ -163,15 +163,15 @@ public class WSSampleFinishCommand extends EnvironmentalOperation implements Jav rfg,fileResult); //gpcResult.setStatusMonitor(getStatusMonitor()); gpcResult.setEnvironment( env ); - status = EnvironmentUtils.convertIStatusToStatus(gpcResult.execute( null, null )); + status = gpcResult.execute( monitor, null ); return status; } - protected Status launchSample (Environment env) { + protected IStatus launchSample (Environment env, IProgressMonitor monitor ) { - Status status = new SimpleStatus( "" ); + IStatus status = Status.OK_STATUS; if (!runClientTest) return status; @@ -183,7 +183,7 @@ public class WSSampleFinishCommand extends EnvironmentalOperation implements Jav ppc.setExistingServer(sampleExistingServer); ppc.setProject(sampleProject); ppc.setEnvironment( env ); - status = EnvironmentUtils.convertIStatusToStatus(ppc.execute( null, null )); + status = ppc.execute( monitor, null ); StartProjectCommand spc = new StartProjectCommand(false ); spc.setServiceServerTypeID(sampleServerTypeID); @@ -193,7 +193,7 @@ public class WSSampleFinishCommand extends EnvironmentalOperation implements Jav spc.setIsWebProjectStartupRequested(true); spc.setEnvironment( env ); - status = EnvironmentUtils.convertIStatusToStatus(spc.execute( null, null )); + status = spc.execute( monitor, null ); if (status.getSeverity() == Status.ERROR) return status; IPath newPath = new Path(ResourceUtils.getWebProjectURL(ResourceUtils.getProjectOf(fDestinationFolderPath),sampleServerTypeID,sampleExistingServer)); @@ -238,20 +238,20 @@ public class WSSampleFinishCommand extends EnvironmentalOperation implements Jav }catch(PartInitException exc){ //TODO: change error message env.getLog().log(Log.WARNING, 5048, this, "launchSample", exc); - status = new SimpleStatus( "launchSample", msgUtils.getMessage("MSG_ERROR_MALFORMED_URL"), Status.WARNING ); + status = StatusUtils.warningStatus( msgUtils.getMessage("MSG_ERROR_MALFORMED_URL"), exc ); try { env.getStatusHandler().report(status); } catch (StatusException e) { - status = new SimpleStatus( "launchSample", msgUtils.getMessage("MSG_ERROR_MALFORMED_URL"), Status.ERROR ); + status = StatusUtils.errorStatus( msgUtils.getMessage("MSG_ERROR_MALFORMED_URL"), e ); } return status; }catch(MalformedURLException exc){ env.getLog().log(Log.WARNING, 5048, this, "launchSample", exc); - status = new SimpleStatus( "launchSample", msgUtils.getMessage("MSG_ERROR_MALFORMED_URL"), Status.WARNING ); + status = StatusUtils.warningStatus( msgUtils.getMessage("MSG_ERROR_MALFORMED_URL"), exc ); try { env.getStatusHandler().report(status); } catch (StatusException e) { - status = new SimpleStatus( "launchSample", msgUtils.getMessage("MSG_ERROR_MALFORMED_URL"), Status.ERROR ); + status = StatusUtils.errorStatus( msgUtils.getMessage("MSG_ERROR_MALFORMED_URL"), e ); } return status; } @@ -259,7 +259,7 @@ public class WSSampleFinishCommand extends EnvironmentalOperation implements Jav - protected Status createModel(Environment env) { + protected IStatus createModel(Environment env, IProgressMonitor monitor ) { //create the model from the resource JavaToModelCommand jtmc = new JavaToModelCommand(); @@ -268,7 +268,7 @@ public class WSSampleFinishCommand extends EnvironmentalOperation implements Jav jtmc.setProxyBean(proxyBean); jtmc.setEnvironment( env ); //jtmc.setStatusMonitor(getStatusMonitor()); - Status status = EnvironmentUtils.convertIStatusToStatus(jtmc.execute(null, null)); + IStatus status = jtmc.execute( monitor, null); if (status.getSeverity() == Status.ERROR) return status; proxyModel = jtmc.getJavaDataModel(); diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/RuntimeServerSelectionDialog.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/RuntimeServerSelectionDialog.java index 96f20a84a..cef821386 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/RuntimeServerSelectionDialog.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/RuntimeServerSelectionDialog.java @@ -106,7 +106,6 @@ public class RuntimeServerSelectionDialog extends Dialog implements Listener { private String defaultServer_; private String defaultRuntime_; private String typeId_; - private String clientTypeId_; // rskreg //private IWebServiceRuntime selectedRuntime_; private WebServiceRuntimeInfo selectedRuntime_; @@ -118,7 +117,6 @@ public class RuntimeServerSelectionDialog extends Dialog implements Listener { private boolean validateOn_ = false; private byte selectionMode_; private final byte MODE_SERVICE = (byte) 0; - private final byte MODE_CLIENT = (byte) 1; private final String SERVER_TYPES_ICON = "icons/servers/servers_obj.gif"; private final String EXISTING_SERVERS_ICON = "icons/servers/existing_server_obj.gif"; private String j2eeVersion; @@ -661,10 +659,6 @@ public class RuntimeServerSelectionDialog extends Dialog implements Listener { return WebServiceConsumptionUIPlugin.getMessage(key); } - private static String getMessage(String key, Object[] args) { - return WebServiceConsumptionUIPlugin.getMessage(key, args); - } - private void setRuntimesGroup() { runtimesList_.removeAll(); String[] runtimes = null; @@ -713,15 +707,6 @@ public class RuntimeServerSelectionDialog extends Dialog implements Listener { } // rskreg - // Returns the server Factory Id given a server name - private String getServerSelectionFactoryId(String selectedServerName) { - if (serverLabels_.containsKey(selectedServerName) && !isExistingServer_) - return (String) serverLabels_.get(selectedServerName); - else { - return ((IServer) existingServersTable_.get(selectedServerName)).getServerType().getId(); - } - } - /** * * ServersList class @@ -731,7 +716,6 @@ public class RuntimeServerSelectionDialog extends Dialog implements Listener { public class ServersList { private TreeItem[] existingServersTree; - private TreeItem[] serverTypesTree; boolean existingServer = false; public void setServerTreeItems(Tree serversList) { diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/TypeSelectionFilter.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/TypeSelectionFilter.java index f73ad1eff..ee1a33015 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/TypeSelectionFilter.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/TypeSelectionFilter.java @@ -12,10 +12,7 @@ package org.eclipse.jst.ws.internal.consumption.ui.wizard; import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; - import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; @@ -31,8 +28,6 @@ public class TypeSelectionFilter // Copyright public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002."; - private IStructuredSelection initSelection_; - public String[] getWebServiceTypeByInitialSelection(IStructuredSelection initialSelection, ArrayList webServiceTypeList) { diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsil/AddWSDLToWSILWrapperCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsil/AddWSDLToWSILWrapperCommand.java index 759f4a137..af5f1494c 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsil/AddWSDLToWSILWrapperCommand.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsil/AddWSDLToWSILWrapperCommand.java @@ -14,10 +14,10 @@ package org.eclipse.jst.ws.internal.consumption.ui.wsil; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.ui.PlatformUI; import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; -import org.eclipse.wst.command.internal.provisional.env.core.common.SimpleStatus; import org.eclipse.wst.ws.internal.wsil.AddWSDLToWSILCommand; @@ -44,7 +44,7 @@ public class AddWSDLToWSILWrapperCommand extends EnvironmentalOperation command.setEnvironment( env ); return command.execute( null, null); } - return new SimpleStatus(""); + return Status.OK_STATUS; } /** * @param args The args to set. diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsrt/ClientType.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsrt/ClientType.java index 2e3d20c80..808a1afc9 100644 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsrt/ClientType.java +++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsrt/ClientType.java @@ -24,7 +24,6 @@ public class ClientType { private WebServiceClientImpl webServiceClientImpl; private String[] moduleTypesInclude; private String[] moduleTypesExclude; - private String webServiceClientTypeId; |