Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions')
-rw-r--r--bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/ValidateAction.java431
-rw-r--r--bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/WSIValidateAction.java295
-rw-r--r--bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/WSIValidationUIMessages.java32
-rw-r--r--bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/actionDelegates/RequestHandlerImpl.java226
-rw-r--r--bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/actionDelegates/ValidateWSILogFileActionDelegate.java76
-rw-r--r--bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/actionDelegates/ValidateWSIProfileActionDelegate.java240
-rw-r--r--bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/icons/wsi_logfile_wiz.gifbin2549 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/wsivalidation.properties17
8 files changed, 0 insertions, 1317 deletions
diff --git a/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/ValidateAction.java b/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/ValidateAction.java
deleted file mode 100644
index 4efceca6b..000000000
--- a/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/ValidateAction.java
+++ /dev/null
@@ -1,431 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsi.ui.internal.actions;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.validation.internal.operations.LocalizedMessage;
-import org.eclipse.wst.validation.internal.operations.WorkbenchReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-import org.eclipse.wst.wsi.ui.internal.WSIUIPlugin;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
-import org.eclipse.wst.xml.core.internal.validation.core.logging.ILogger;
-import org.eclipse.wst.xml.core.internal.validation.core.logging.LoggerFactory;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.validation.XMLValidationUIMessages;
-
-/**
- * A general validate action class that can be extended by validators. This class
- * provides methods to run the action, add markers to a file and will handle
- * showing a dialog with the results of validation (if requested) and prompt to
- * save dirty files (if requested.)
- */
-public abstract class ValidateAction extends Action
-{
- // Locally used, non-UI strings.
- private static final String REFERENCED_FILE_ERROR_OPEN = "referencedFileError("; //$NON-NLS-1$
-
- private static final String REFERENCED_FILE_ERROR_CLOSE = ")"; //$NON-NLS-1$
-
- private static final String REFERENCED_FILE_ERROR = "referencedFileError"; //$NON-NLS-1$
-
- private static final String GROUP_NAME = "groupName"; //$NON-NLS-1$
-
- private static final String FILE_PROTOCOL_NO_SLASH = "file:"; //$NON-NLS-1$
- private static final String FILE_PROTOCOL = "file:///"; //$NON-NLS-1$
-
- protected static final String COLUMN_NUMBER_ATTRIBUTE = "columnNumber"; //$NON-NLS-1$
- protected static final String SQUIGGLE_SELECTION_STRATEGY_ATTRIBUTE = "squiggleSelectionStrategy"; //$NON-NLS-1$
- protected static final String SQUIGGLE_NAME_OR_VALUE_ATTRIBUTE = "squiggleNameOrValue"; //$NON-NLS-1$
-
- protected boolean showDialog = true;
-
- protected IFile file = null;
-
- protected IReporter reporter;
-
- protected IValidator validator;
-
- /**
- * Constructor.
- *
- * @param file
- * The file to validate.
- * @param showDialog
- * Whether or not to show a dialog when validation is complete.
- */
- public ValidateAction(IFile file, boolean showDialog)
- {
- this.showDialog = showDialog;
- this.file = file;
- }
-
- /**
- * Validate the specified file.
- *
- * @param file
- * The file to validate.
- */
- protected abstract void validate(final IFile file);
-
- protected void addInfoToMessage (ValidationMessage v, IMessage m)
- { // This method is overidden by subclasses
- }
-
- /**
- * Create markers for the valiation messages generated from the validation.
- *
- * @param iFile
- * The resource to create the markers on.
- * @param valmessages
- * The array of validation messages.
- */
- public void createMarkers(IFile iFile, ValidationMessage[] valmessages)
- {
- if (!fileIsOK(iFile))
- {
- return;
- }
- int nummessages = valmessages.length;
- for (int i = 0; i < nummessages; i++)
- {
- ValidationMessage validationMessage = valmessages[i];
- String uri = validationMessage.getUri();
-
- LocalizedMessage message;
- if (validationMessage.getSeverity() == ValidationMessage.SEV_LOW)
- {
- message = new LocalizedMessage(getValidationFrameworkSeverity(IMarker.SEVERITY_WARNING), validationMessage
- .getMessage(), iFile);
- }
- else
- {
- message = new LocalizedMessage(getValidationFrameworkSeverity(IMarker.SEVERITY_ERROR), validationMessage.getMessage(), iFile);
- }
-
- message.setLineNo(validationMessage.getLineNumber());
- addInfoToMessage(validationMessage, message);
-
- List nestederrors = validationMessage.getNestedMessages();
- if (nestederrors != null && !nestederrors.isEmpty())
- {
- message.setGroupName(REFERENCED_FILE_ERROR_OPEN + uri + REFERENCED_FILE_ERROR_CLOSE);
- }
-
- getOrCreateReporter().addMessage(getValidator(), message);
-
-
- }
- try
- {
- IMarker[] markers = iFile.findMarkers(null, true, IResource.DEPTH_INFINITE);
- for (int i = 0; i < markers.length; i++)
- {
- IMarker marker = markers[i];
- String groupName = null;
- try
- {
- groupName = (String) marker.getAttribute(GROUP_NAME);
- }
- catch (Exception e)
- {
- }
-
- if (groupName != null && groupName.startsWith(REFERENCED_FILE_ERROR))
- {
-
- marker.setAttribute(IMarker.DONE, true);
- }
- }
- }
- catch (CoreException e)
- {
- e.printStackTrace();
- }
-
- }
-
- public void clearMarkers(IFile iFile)
- {
- if (fileIsOK(iFile))
- {
- getOrCreateReporter().removeAllMessages(getValidator(), iFile);
- }
- }
-
- public void run()
- {
- try
- {
- // CS... a temporary test to avoid performing validation in the absence of xerces
- //
- //dw Class theClass =
- Class.forName("org.apache.xerces.xni.parser.XMLParserConfiguration", true, this.getClass().getClassLoader()); //$NON-NLS-1$
-
- if (fileIsOK(file))
- {
- // Check if the editor is dirty for this file. If so, prompt the user to
- // save before validating.
- if(showDialog)
- {
- checkIfFileDirty(file);
- }
- try
- {
- validate(file);
- }
- catch (Exception e)
- {
- ILogger logger = LoggerFactory.getLoggerInstance();
- logger.logError("", e); //$NON-NLS-1$
- // e.printStackTrace();
- }
- }
- }
- catch (Exception e)
- {
- }
- }
-
- /**
- * Test whether the file given is OK to use. A file is OK to use if 1. It is
- * not null 2. It exists. 3. The project containing the file is accessible.
- *
- * @param file The file to check.
- * @return True if the file is OK to use, false otherwise.
- */
- protected boolean fileIsOK(IFile file)
- {
- if (file != null && file.exists() && file.getProject().isAccessible())
- {
- return true;
- }
- return false;
- }
-
- /**
- * Check if the file is dirty. A file is dirty if there is an open editor for
- * the file that contains changes that haven't been saved.
- *
- * @param file The file to check to see if it is dirty.
- */
- protected void checkIfFileDirty(IFile file)
- {
- IEditorPart[] dirtyEditors = WSIUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow()
- .getActivePage().getDirtyEditors();
- int numeditors = dirtyEditors.length;
- for (int i = 0; i < numeditors; i++)
- {
- IEditorInput editorInput = dirtyEditors[i].getEditorInput();
- if (editorInput instanceof FileEditorInput)
- {
- FileEditorInput fileEditorInput = (FileEditorInput) editorInput;
- if (fileEditorInput.getFile().equals(file))
- {
- String message = XMLValidationUIMessages._UI_SAVE_DIRTY_FILE_MESSAGE;
- String title = XMLValidationUIMessages._UI_SAVE_DIRTY_FILE_TITLE;
- if (MessageDialog.openQuestion(Display.getDefault().getActiveShell(), title, message))
- {
- dirtyEditors[i].doSave(null);
- }
- // There can only be one open editor/file so we can break.
- break;
- }
- }
- }
- }
-
- /**
- * Gets the reporter.
- *
- * @return Returns a IReporter
- */
- public IReporter getReporter()
- {
- return reporter;
- }
-
- /**
- * Sets the reporter.
- *
- * @param reporter
- * The reporter to set
- */
- public void setReporter(IReporter reporter)
- {
- this.reporter = reporter;
- }
-
- /**
- * Gets the validator.
- *
- * @return Returns a IValidator
- */
- public IValidator getValidator()
- {
- return validator;
- }
-
- /**
- * Sets the validator.
- *
- * @param validator
- * The validator to set
- */
- public void setValidator(IValidator validator)
- {
- this.validator = validator;
- }
-
- protected IReporter getOrCreateReporter()
- {
- if (reporter == null)
- {
- reporter = new WorkbenchReporter(file.getProject(), new NullProgressMonitor());
- }
- return reporter;
- }
-
- /**
- * Originally from *validation.Helper
- *
- * @param severity
- * The severity given.
- * @return The validation framework severity corresponding to the error.
- */
- protected int getValidationFrameworkSeverity(int severity)
- {
- switch (severity) {
- case IMarker.SEVERITY_ERROR:
- return IMessage.HIGH_SEVERITY;
- case IMarker.SEVERITY_WARNING:
- return IMessage.NORMAL_SEVERITY;
- case IMarker.SEVERITY_INFO:
- return IMessage.LOW_SEVERITY;
- }
- return IMessage.LOW_SEVERITY;
- }
-
- /**
- * Open an error dialog with the given title and message. Show the problems view
- * if it is not already visible.
- *
- * @param title The title of the error dialog.
- * @param message The message in the error dialog.
- */
- protected void openErrorDialog(String title, String message)
- {
- showProblemsView();
- MessageDialog.openError(Display.getDefault().getActiveShell(), title, message);
- }
-
- /**
- * Open an warning dialog with the given title and message. Show the problems view
- * if it is not already visible.
- *
- * @param title The title of the warning dialog.
- * @param message The message in the warning dialog.
- */
- protected void openWarningDialog(String title, String message)
- {
- showProblemsView();
- MessageDialog.openWarning(Display.getDefault().getActiveShell(), title, message);
- }
-
- /**
- * Open a valid dialog with the given title and message.
- *
- * @param title The title of the valid dialog.
- * @param message The message in the valid dialog.
- */
- protected void openValidDialog(String title, String message)
- {
- MessageDialog.openInformation(Display.getDefault().getActiveShell(), title, message);
- }
-
- /**
- * Show the problems view if it is not already visible.
- */
- protected void showProblemsView()
- {
- IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- IWorkbenchPage page = dw.getActivePage();
- IWorkbenchPart activePart = page.getActivePart();
- try
- {
- if (page != null)
- {
- page.showView(IPageLayout.ID_PROBLEM_VIEW);
- }
- }
- catch (PartInitException e)
- {
- Logger.logException(e);
- }
- page.activate(activePart);
- }
-
- /**
- * Format a file name into a correct URI.
- *
- * @param filename The file name to format.
- * @return The formatted URI.
- */
- protected String createURIForFilePath(String filename)
- {
- if(!filename.startsWith(FILE_PROTOCOL_NO_SLASH))
- {
- while(filename.startsWith("/")) //$NON-NLS-1$
- {
- filename = filename.substring(1);
- }
- filename = FILE_PROTOCOL + filename;
- }
- return filename;
- }
-
- /**
- * The validation outcome class holds the results from validating
- * a file.
- *
- * @author Lawrence Mandel, IBM
- */
- protected class ValidationOutcome
- {
- public boolean isValid = true;
-
- public boolean hasMessages = false;
-
- public ValidationOutcome()
- {
- }
- }
-}
-
diff --git a/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/WSIValidateAction.java b/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/WSIValidateAction.java
deleted file mode 100644
index 26aab86a6..000000000
--- a/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/WSIValidateAction.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002-2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsi.ui.internal.actions;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.validation.internal.core.IMessageAccess;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-import org.eclipse.wst.validation.internal.provisional.core.MessageLimitException;
-import org.eclipse.wst.wsi.internal.analyzer.MessageAnalyzer;
-import org.eclipse.wst.wsi.internal.analyzer.WSIAnalyzerException;
-import org.eclipse.wst.wsi.internal.core.WSIConstants;
-import org.eclipse.wst.wsi.internal.report.AssertionError;
-import org.eclipse.wst.wsi.ui.internal.Messages;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
-import org.xml.sax.SAXParseException;
-
-/**
- * Action for running the validator.
- *
- * @author David Lauzon, IBM
- * @author Lawrence Mandel, IBM
- */
-public class WSIValidateAction extends ValidateAction
-{
- protected IValidator validator;
-
- protected String wsdlfile = null;
- protected String elementname = null;
- protected String namespace = null;
- protected String parentname = null;
- protected String type = null;
- protected boolean wsdlspecified = false;
- protected boolean exceptionCaught = false;
-
- /**
- * Constructor.
- *
- * @param f The file to validate
- * @param showDialog Whether or not to show a status dialog after validation.
- */
- public WSIValidateAction(IFile f, boolean showDialog)
- {
- super(f, showDialog);
- }
-
- /**
- * Constructor with WSDL element specified.
- *
- * @param f The file to validate.
- * @param showDialog Whether or not to show a status dialog after validation.
- * @param file The WSDL file to use for validation.
- * @param elementname The name of the WSDL element to validate.
- * @param namespace The namespace of the WSDL element to validate
- * @param parentname The parent name of the WSDL element to validate.
- * @param type The type of element to validate.
- */
- public WSIValidateAction(IFile f, boolean showDialog, String file, String elementname, String namespace, String parentname, String type)
- {
- this(f, showDialog);
- if (file != null)
- {
- wsdlfile = file.replace('\\', '/');
- if ((!wsdlfile.startsWith(WSIConstants.FILE_PREFIX)) &&
- (!wsdlfile.startsWith(WSIConstants.HTTP_PREFIX)))
- {
- wsdlfile = WSIConstants.FILE_PROTOCOL + wsdlfile;
- }
- }
- this.elementname = elementname;
- this.namespace = namespace;
- this.parentname = parentname;
- this.type = type;
- this.wsdlspecified = true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.validate.ValidateAction#validate(org.eclipse.core.resources.IFile)
- */
- protected void validate(final IFile file1)
- {
- final MessageAnalyzer messageanalyzer;
-
- if(wsdlspecified)
- {
- messageanalyzer = new MessageAnalyzer(WSIConstants.FILE_PROTOCOL + file1.getLocation().toString(), wsdlfile, elementname, namespace, parentname, type);
- }
- else
- {
- messageanalyzer = new MessageAnalyzer(WSIConstants.FILE_PROTOCOL + file1.getLocation().toString());
- }
-
- IWorkspaceRunnable op = new IWorkspaceRunnable()
- {
- public void run(IProgressMonitor progressMonitor) throws CoreException
- {
- clearMarkers(file1);
- try
- {
- messageanalyzer.validateConformance();
- }
- catch (WSIAnalyzerException ae)
- {
- exceptionCaught = true;
- if (ae.getTargetException() instanceof SAXParseException)
- {
- createMarkers(file1, new ValidationMessage[]{createValidationMessageForException((SAXParseException)ae.getTargetException(), ValidationMessage.SEV_NORMAL)});
- }
- else
- {
- createMarkers(file1, new ValidationMessage[]{createValidationMessageForException(ae, ValidationMessage.SEV_NORMAL)});
- }
- }
- catch (Exception e)
- {
- }
-
- createMarkers(file1, convertValidationMessages(messageanalyzer.getAssertionWarnings(), ValidationMessage.SEV_LOW));
- createMarkers(file1, convertValidationMessages(messageanalyzer.getAssertionErrors(), ValidationMessage.SEV_NORMAL));
- file.setSessionProperty(ValidationMessage.ERROR_MESSAGE_MAP_QUALIFIED_NAME, getOrCreateReporter().getMessages());
- }
- };
-
-
- try
- {
- ResourcesPlugin.getWorkspace().run(op, null);
- if (showDialog)
- {
- if (exceptionCaught)
- {
- MessageDialog.openError(Display.getDefault().getActiveShell(),
- Messages.ERROR_UNABLE_TO_VALIDATE,
- Messages.ERROR_PROBLEMS_READING_WSIMSG_FILE);
- }
- else if (messageanalyzer.getAssertionErrors().size() != 0)
- {
- MessageDialog.openError(Display.getDefault().getActiveShell(),
- Messages.ERROR_VALIDATION_FAILED,
- Messages.ERROR_THE_WSIMSG_FILE_IS_NOT_VALID);
- }
- else if (messageanalyzer.getAssertionWarnings().size() != 0)
- {
- String title = Messages.INFO_VALIDATION_SUCEEDED;
- String message = Messages.WARNING_VALIDATION_WARNINGS_DETECTED;
- MessageDialog.openInformation(Display.getDefault().getActiveShell(), title, message);
- }
- else
- {
- String title = Messages.INFO_VALIDATION_SUCEEDED;
- String message = Messages.INFO_THE_WSIMSG_FILE_IS_VALID;
- MessageDialog.openInformation(Display.getDefault().getActiveShell(), title, message);
- }
- }
- }
- catch(Exception e){}
- }
-
- /**
- * Create a validation message from the exception and severity.
- *
- * @param error The error.
- * @param severity The severity.
- * @return An error message.
- */
- protected ValidationMessage createValidationMessageForException(SAXParseException error, int severity)
- {
- String uri = error.getSystemId();
- if(uri == null)
- {
- uri = error.getPublicId();
- }
- ValidationMessage validationMessage = new ValidationMessage(error.getMessage(), error.getLineNumber(), error.getColumnNumber(), uri);
- validationMessage.setSeverity(severity);
- return validationMessage;
- }
-
-
- /**
- * Create a validation message from the exception and severity.
- *
- * @param error The error.
- * @param severity The severity.
- * @return An error message.
- */
- protected ValidationMessage createValidationMessageForException(WSIAnalyzerException error, int severity)
- {
- ValidationMessage validationMessage = new ValidationMessage(error.getMessage(), 0, 0);
- validationMessage.setSeverity(severity);
- return validationMessage;
- }
-
- public ValidationMessage[] convertValidationMessages(List list, int marker)
- {
- if (list != null)
- {
- int size = list.size();
- ValidationMessage[] messages = new ValidationMessage[size];
-
- for (int i = 0; i < size; i++)
- {
- AssertionError assertionError = (AssertionError) list.get(i);
-
- int n = assertionError.getLine();
- int c = assertionError.getColumn();
- String m = WSIConstants.WSI_PREFIX + "(" + assertionError.getAssertionID()+ ") " + assertionError.getErrorMessage();
-
- ValidationMessage message = new ValidationMessage(m,n, c);
- message.setSeverity(marker);
- messages[i] = message;
- }
- return messages;
- }
- return new ValidationMessage[0];
- }
-
- /**
- protected IReporter getOrCreateReporter()
- {
- if (reporter == null)
- {
- reporter = new Reporter();
- }
- return reporter;
- }
- */
- // My Implementation of IReporter
- class Reporter implements IReporter
- {
- List list = new ArrayList();
-
- public Reporter() {
- super();
- }
-
- public IMessageAccess getMessageAccess() {
- return null; // do not need to implement
- }
-
- public boolean isCancelled() {
- return false; // do not need to implement
- }
-
- public void removeAllMessages(IValidator origin, Object object) { // do
- // not
- // need
- // to
- // implement
- }
-
- public void removeAllMessages(IValidator origin) {// do not need to
- // implement
- }
-
- public void removeMessageSubset(IValidator validator, Object obj, String groupName) {// do
- // not
- // need
- // to
- // implement
- }
-
- public List getMessages() {
- return list;
- }
-
- public void addMessage(IValidator origin, IMessage message) throws MessageLimitException
- {
- list.add(message);
- }
-
- public void displaySubtask(IValidator validator, IMessage message)
- {
- // TODO Auto-generated method stub
-
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/WSIValidationUIMessages.java b/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/WSIValidationUIMessages.java
deleted file mode 100644
index c01a2a5e4..000000000
--- a/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/WSIValidationUIMessages.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *
- */
-package org.eclipse.wst.wsi.ui.internal.actions;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by XML Validation
- */
-public class WSIValidationUIMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.wsi.ui.internal.actions.wsivalidation"; //$NON-NLS-1$
-
- private WSIValidationUIMessages() {
- // cannot create new instance
- }
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, WSIValidationUIMessages.class);
- }
- public static String _UI_SAVE_DIRTY_FILE_MESSAGE;
- public static String _UI_SAVE_DIRTY_FILE_TITLE;
-}
diff --git a/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/actionDelegates/RequestHandlerImpl.java b/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/actionDelegates/RequestHandlerImpl.java
deleted file mode 100644
index 425f608fd..000000000
--- a/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/actionDelegates/RequestHandlerImpl.java
+++ /dev/null
@@ -1,226 +0,0 @@
-package org.eclipse.wst.wsi.ui.internal.actions.actionDelegates;
-
-import java.util.Date;
-
-import org.eclipse.wst.internet.monitor.core.internal.provisional.Request;
-import org.eclipse.wst.wsi.internal.core.log.RequestHandler;
-
-/**
- * Implements the RequestHandler interface which represents a TCP/IP
- * request made between the client and the server. Each request
- * represents a request-response pair, where the request is from
- * client -> server, and the response is from server -> client.
- *
- * @author lauzond
- */
-public class RequestHandlerImpl implements RequestHandler
-{
- /**
- * The HTTP header of the request portion of this request.
- */
- protected byte[] requestHeader;
-
- /**
- * The HTTP header of the response portion of this request.
- */
- protected byte[] responseHeader;
-
- /**
- * The HTTP body of the request portion of this request.
- */
- protected byte[] requestContent;
-
- /**
- * The HTTP body of the response portion of this request.
- */
- protected byte[] responseContent;
-
- /**
- * The time this request was made.
- */
- protected Date date = null;
-
- /**
- * The local (client) port.
- */
- protected int localPort = 0;
-
- /**
- * The remote (server) port.
- */
- protected int remotePort = 0;
-
- /**
- * The remote (server) host.
- */
- protected String remoteHost = null;
-
- /**
- * The server's response time in milliseconds.
- */
- protected long responseTime = 0;
-
- /**
- * Constructor.
- * @param request a TCP/IP request
- */
- RequestHandlerImpl(Request request)
- {
- if (request != null)
- {
- this.requestHeader = request.getRequest(Request.TRANSPORT);
- this.requestContent = request.getRequest(Request.CONTENT);
- this.responseHeader = request.getResponse(Request.TRANSPORT);
- this.responseContent = request.getResponse(Request.CONTENT);
- this.date = request.getDate();
- this.localPort = request.getLocalPort();
- this.remotePort = request.getRemotePort();
- this.remoteHost = request.getRemoteHost();
- this.responseTime = request.getResponseTime();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsi.internal.core.log.RequestHandler#getRequestHeader()
- */
- public byte[] getRequestHeader()
- {
- return this.requestHeader;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsi.internal.core.log.RequestHandler#setRequestHeader(byte[])
- */
- public void setRequestHeader(byte[] requestHeader)
- {
- this.requestHeader = requestHeader;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsi.internal.core.log.RequestHandler#getResponseHeader()
- */
- public byte[] getResponseHeader()
- {
- return this.responseHeader;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsi.internal.core.log.RequestHandler#setResponseHeader(byte[])
- */
- public void setResponseHeader(byte[] responseHeader)
- {
- this.responseHeader = responseHeader;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsi.internal.core.log.RequestHandler#getRequestContent()
- */
- public byte[] getRequestContent()
- {
- return this.requestContent;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsi.internal.core.log.RequestHandler#setResponseContent(byte[])
- */
- public void setResponseContent(byte[] responseContent)
- {
- this.responseContent = responseContent;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsi.internal.core.log.RequestHandler#getResponseContent()
- */
- public byte[] getResponseContent()
- {
- return this.responseContent;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsi.internal.core.log.RequestHandler#setRequestContent(byte[])
- */
- public void setRequestContent(byte[] requestContent)
- {
- this.requestContent = requestContent;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsi.internal.core.log.RequestHandler#getDate()
- */
- public Date getDate()
- {
- return this.date;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsi.internal.core.log.RequestHandler#setDate(java.util.Date)
- */
- public void setDate(Date date)
- {
- this.date = date;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsi.internal.core.log.RequestHandler#getLocalPort()
- */
- public int getLocalPort()
- {
- return this.localPort;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsi.internal.core.log.RequestHandler#setLocalPort(int)
- */
- public void setLocalPort(int localPort)
- {
- this.localPort = localPort;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsi.internal.core.log.RequestHandler#getRemotePort()
- */
- public int getRemotePort()
- {
- return this.remotePort;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsi.internal.core.log.RequestHandler#setRemotePort(int)
- */
- public void setRemotePort(int remotePort)
- {
- this.remotePort = remotePort;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsi.internal.core.log.RequestHandler#getRemoteHost()
- */
- public String getRemoteHost()
- {
- return this.remoteHost;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsi.internal.core.log.RequestHandler#setRemoteHost(java.lang.String)
- */
- public void setRemoteHost(String remoteHost)
- {
- this.remoteHost = remoteHost;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsi.internal.core.log.RequestHandler#getResponseTime()
- */
- public long getResponseTime()
- {
- return this.responseTime;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsi.internal.core.log.RequestHandler#setResponseTime(long)
- */
- public void setResponseTime(long responseTime)
- {
- this.responseTime = responseTime;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/actionDelegates/ValidateWSILogFileActionDelegate.java b/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/actionDelegates/ValidateWSILogFileActionDelegate.java
deleted file mode 100644
index 3c410e841..000000000
--- a/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/actionDelegates/ValidateWSILogFileActionDelegate.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002-2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsi.ui.internal.actions.actionDelegates;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IActionDelegate;
-
-import org.eclipse.wst.wsi.ui.internal.WSIMessageValidator;
-import org.eclipse.wst.wsi.ui.internal.actions.WSIValidateAction;
-
-
-/**
- * Action delegate for validating a WS-I log file.
- *
- * @author David Lauzon, IBM
- * @author Lawrence Mandel, IBM
- */
-public class ValidateWSILogFileActionDelegate implements IActionDelegate
-{
- /**
- * The current selection, or null if there is no selection.
- */
- ISelection selection;
-
- /**
- * Constructor.
- */
- public ValidateWSILogFileActionDelegate()
- {
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action)
- {
- try
- {
- if (selection instanceof IStructuredSelection)
- {
- Object obj = ((IStructuredSelection)selection).getFirstElement();
- if (obj instanceof IFile)
- {
- IFile file = (IFile)obj;
- WSIMessageValidator messageValidator = new WSIMessageValidator();
- WSIValidateAction validateAction = new WSIValidateAction(file, true);
- validateAction.setValidator(messageValidator);
- validateAction.run();
- }
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection)
- {
- this.selection = selection;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/actionDelegates/ValidateWSIProfileActionDelegate.java b/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/actionDelegates/ValidateWSIProfileActionDelegate.java
deleted file mode 100644
index 31bae5be5..000000000
--- a/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/actionDelegates/ValidateWSIProfileActionDelegate.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002-2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsi.ui.internal.actions.actionDelegates;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.Request;
-import org.eclipse.wst.internet.monitor.ui.internal.provisional.MonitorUICore;
-import org.eclipse.wst.wsi.internal.core.log.LogBuilder;
-import org.eclipse.wst.wsi.internal.core.log.RequestHandler;
-import org.eclipse.wst.wsi.ui.internal.Messages;
-import org.eclipse.wst.wsi.ui.internal.wizards.ValidationWizard;
-import org.eclipse.wst.wsi.ui.internal.WSIValidator;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-import org.eclipse.ui.dialogs.ContainerGenerator;
-import org.eclipse.wst.wsi.internal.core.log.Log;
-
-/**
- * Action delegate for the WS-I validator.
- *
- * @author David Lauzon, IBM
- * @author Lawrence Mandel, IBM
- */
-public class ValidateWSIProfileActionDelegate implements IViewActionDelegate
-{
- /**
- * The default WS-I Message Log filename.
- */
- public static final String DEFAULT_LOG_FILENAME = "log.wsimsg";
-
- /**
- * The HTTP protocol.
- */
- private final String HTTP = "http://";
-
-
- /**
- * The default tag for WSDL locations.
- */
- private final String WSDL = "?WSDL";
-
- /**
- * The current selection, or null if there is no selection.
- */
- ISelection selection;
-
- /**
- * The list of messages in the form of request-response pairs.
- */
- Request[] requestResponses;
-
- /**
- * The view that provides the context for this delegate.
- */
- IViewPart view;
-
- /**
- * Constructor.
- */
- public ValidateWSIProfileActionDelegate()
- {
- }
-
- /**
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view)
- {
- this.view = view;
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action)
- {
- WorkspaceModifyOperation operation = new WorkspaceModifyOperation()
- {
- protected void execute(IProgressMonitor progressMonitor)
- throws CoreException
- {
- validate(progressMonitor);
- }
- };
-
- try
- {
- operation.run(null);
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
- }
-
- /**
- * The validate action.
- *
- * @param progressMonitor
- */
- public void validate(IProgressMonitor progressMonitor)
- {
- try
- {
- requestResponses = MonitorUICore.getRequests();
- Shell shell = Display.getCurrent().getActiveShell();
- if ((requestResponses != null) && (requestResponses.length > 0))
- {
- ValidationWizard validateWizard = new ValidationWizard(DEFAULT_LOG_FILENAME);
- List wsdllocs = new Vector();
-
- for (int i=0; i<requestResponses.length; i++)
- {
- Request reqresp = requestResponses[i];
- String remotehost = reqresp.getRemoteHost();
- int remoteport = reqresp.getRemotePort();
- String remotelabel = reqresp.getName();
- String location = HTTP + remotehost + ":" + remoteport + remotelabel + WSDL;
- if(!wsdllocs.contains(location))
- {
- wsdllocs.add(location);
- }
- }
-
- validateWizard.setWSDLLocations((String[])wsdllocs.toArray(new String[wsdllocs.size()]));
- WizardDialog wizardDialog = new WizardDialog(shell, validateWizard);
- wizardDialog.create();
-
- int result = wizardDialog.open();
-
- if (validateWizard.isValid() && (result != org.eclipse.jface.window.Window.CANCEL))
- {
- // If the container doesn't exist, create it now
- checkAndCreateContainer(validateWizard.getContainerFullPath());
-
- IFile file = validateWizard.getFile();
- LogBuilder builder = new LogBuilder(file);
- Log log = builder.buildLog(getRequestHandlers(requestResponses));
-
- builder.writeLog(log);
- file.refreshLocal(1, progressMonitor);
-
- WSIValidator messageValidator = new WSIValidator();
- if(validateWizard.includeWSDLFile())
- {
- String wsdlfile = validateWizard.getWSDLFile();
- String name = validateWizard.getElementName();
- String namespace = validateWizard.getNamespace();
- String parentname = validateWizard.getParentName();
- String type = validateWizard.getType();
- messageValidator.validate(file, wsdlfile, name, namespace, parentname, type);
- }
- else
- {
- messageValidator.validate(file);
- }
- }
- }
- else
- {
- // no available messages to validate
- String title = Messages.ACTION_WSI_VALIDATOR;
- String message = Messages.INFO_NO_MESSAGES_TO_VALIDATE;
- MessageDialog.openInformation(shell, title, message);
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- private List getRequestHandlers(Request[] requestResponses)
- {
- List requestHandlers = new ArrayList();
- int size = requestResponses.length;
- for (int i = 0; i<size; i++)
- {
- Request request = requestResponses[i];
- RequestHandler handler = new RequestHandlerImpl(request);
- requestHandlers.add(handler);
- }
- return requestHandlers;
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection)
- {
- this.selection = selection;
- }
-
- /**
- * If the container doesn't exist for the selected IFile, create it now.
- *
- * @param containerPath The container for the selected IFile.
- */
- public static void checkAndCreateContainer(IPath containerPath)
- {
- IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(containerPath);
-
- // If the container doesn't exist in the workspace, create it.
- if (resource == null)
- {
- try
- {
- ContainerGenerator generator = new ContainerGenerator(containerPath);
- generator.generateContainer(null);
- }
- catch (CoreException e)
- {
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/icons/wsi_logfile_wiz.gif b/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/icons/wsi_logfile_wiz.gif
deleted file mode 100644
index 0cc8d3f6e..000000000
--- a/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/icons/wsi_logfile_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/wsivalidation.properties b/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/wsivalidation.properties
deleted file mode 100644
index 94f744a90..000000000
--- a/bundles/org.eclipse.wst.wsi.ui/src/org/eclipse/wst/wsi/ui/internal/actions/wsivalidation.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2006 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-### Constants for strings
-
-#
-# Dirty File Dialog Related Messages
-#
-_UI_SAVE_DIRTY_FILE_MESSAGE = An open editor contains changes to this file that have not been saved. Do you want to save the file before running validation? (If you do not save the file the previously saved version will be validated.)
-_UI_SAVE_DIRTY_FILE_TITLE = Save file?

Back to the top