diff options
author | vbaciu | 2008-02-07 04:59:26 +0000 |
---|---|---|
committer | vbaciu | 2008-02-07 04:59:26 +0000 |
commit | b7492b7415bcdcef129724e3464bdd1eb491ce26 (patch) | |
tree | 5eabf2882211eab03a2def0b7c7e0d69b1f0de52 /bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org | |
parent | 262de13d375b56943cad81911b816aa72d7a56ac (diff) | |
download | webtools.webservices-b7492b7415bcdcef129724e3464bdd1eb491ce26.tar.gz webtools.webservices-b7492b7415bcdcef129724e3464bdd1eb491ce26.tar.xz webtools.webservices-b7492b7415bcdcef129724e3464bdd1eb491ce26.zip |
[218093] port wsdl delegating source validator to validation V2 framework
Diffstat (limited to 'bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org')
-rw-r--r-- | bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/reconciler/DelegatingSourceValidatorForWSDL.java | 71 |
1 files changed, 30 insertions, 41 deletions
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/reconciler/DelegatingSourceValidatorForWSDL.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/reconciler/DelegatingSourceValidatorForWSDL.java index 89dddc24a..e0f343bf9 100644 --- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/reconciler/DelegatingSourceValidatorForWSDL.java +++ b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/reconciler/DelegatingSourceValidatorForWSDL.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. + * Copyright (c) 2001, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -10,58 +10,47 @@ *******************************************************************************/ package org.eclipse.wst.wsdl.ui.internal.reconciler; -import java.lang.reflect.InvocationTargetException; - import org.eclipse.core.resources.IFile; -import org.eclipse.wst.validation.internal.ConfigurationManager; -import org.eclipse.wst.validation.internal.ProjectConfiguration; -import org.eclipse.wst.validation.internal.ValidationRegistryReader; -import org.eclipse.wst.validation.internal.ValidatorMetaData; +import org.eclipse.wst.validation.ValidationFramework; +import org.eclipse.wst.validation.Validator; import org.eclipse.wst.validation.internal.provisional.core.IValidator; -import org.eclipse.wst.xml.ui.internal.Logger; import org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidator; /** - * This performs the as-you-type validation - * @author Mark Hutchinson - * + * This performs the as-you-type validation for WSDL files */ public class DelegatingSourceValidatorForWSDL extends DelegatingSourceValidator { + private final static String Id = "org.eclipse.wst.wsdl.validation.wsdl"; //$NON-NLS-1$ - final private static String VALIDATOR_CLASS = "org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator"; //$NON-NLS-1$ + private Validator _validator; public DelegatingSourceValidatorForWSDL() - { - super(); + { + } + + private Validator getValidator() + { + if (_validator == null) + _validator = ValidationFramework.getDefault().getValidator(Id); + return _validator; } - + protected IValidator getDelegateValidator() { - try - { - ValidationRegistryReader registry = ValidationRegistryReader.getReader(); - return registry.getValidator(VALIDATOR_CLASS); - } - catch (Exception e) - { // - } - return null; + Validator v = getValidator(); + if (v == null) + return null; + return v.asIValidator(); + } + + protected boolean isDelegateValidatorEnabled(IFile file) + { + Validator v = getValidator(); + if (v == null) + return false; + if (!v.shouldValidate(file, false, false)) + return false; + return v.isBuildValidation() || v.isManualValidation(); } - - protected boolean isDelegateValidatorEnabled(IFile file) { - boolean enabled = true; - try { - ProjectConfiguration configuration = ConfigurationManager.getManager().getProjectConfiguration(file.getProject()); - ValidatorMetaData vmd = ValidationRegistryReader.getReader().getValidatorMetaData(VALIDATOR_CLASS); - if (configuration.isBuildEnabled(vmd) || configuration.isManualEnabled(vmd)) - enabled = true; - else - enabled = false; - } - catch (InvocationTargetException e) { - Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e); - } - return enabled; - } -} +}
\ No newline at end of file |