diff options
Diffstat (limited to 'bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences')
11 files changed, 0 insertions, 868 deletions
diff --git a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/MergeDefaults.java b/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/MergeDefaults.java deleted file mode 100644 index 9625998ba..000000000 --- a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/MergeDefaults.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060403 128827 kathy@ca.ibm.com - Kathy Chan - * 20071109 209075 kathy@ca.ibm.com - Kathy Chan - *******************************************************************************/ -package org.eclipse.wst.ws.internal.preferences; - -public class MergeDefaults -{ - private static final boolean PREFERENCE_SKELETON_MERGE_DEFAULT = true; - - /** - * - * @return returns the default setting for skeleton merge. - */ - public static boolean getSkeletonMergeDefault() - { - return PREFERENCE_SKELETON_MERGE_DEFAULT; - } -} diff --git a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/MigrateWSIpreferencesLoadListener.java b/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/MigrateWSIpreferencesLoadListener.java deleted file mode 100644 index 1910b1b9a..000000000 --- a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/MigrateWSIpreferencesLoadListener.java +++ /dev/null @@ -1,175 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 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 - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20071105 196997 pmoogk@ca.ibm.com - Peter Moogk - * 20071218 209858 epeters@ca.ibm.com - Eric Peters, Enhancing service policy framework and UI - * 20080318 223118 ericdp@ca.ibm.com - Eric D. Peters, metadata required in WS-I profiles to support editors & validators - * 20080318 221578 pmoogk@ca.ibm.com - Peter Moogk - *******************************************************************************/ -package org.eclipse.wst.ws.internal.preferences; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.Preferences; -import org.eclipse.core.runtime.QualifiedName; -import org.eclipse.core.runtime.preferences.IEclipsePreferences; -import org.eclipse.core.runtime.preferences.InstanceScope; -import org.eclipse.wst.ws.internal.plugin.WSPlugin; -import org.eclipse.wst.ws.service.policy.IPolicyState; -import org.eclipse.wst.ws.service.policy.IServicePolicy; -import org.eclipse.wst.ws.service.policy.ServicePolicyActivator; -import org.eclipse.wst.ws.service.policy.ServicePolicyPlatform; -import org.eclipse.wst.ws.service.policy.listeners.IPolicyPlatformLoadListener; - -public class MigrateWSIpreferencesLoadListener implements IPolicyPlatformLoadListener -{ - private static final String[] ENUM_ID_VALUES = { "org.eclipse.wst.sug.require", "org.eclipse.wst.sug.suggest", "org.eclipse.wst.sug.ignore"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - private static final String[] CONTEXT_IDS = { PersistentWSIContext.STOP_NON_WSI, PersistentWSIContext.WARN_NON_WSI, PersistentWSIContext.IGNORE_NON_WSI }; - - public void load() - { - // We need to check to see if the user has set any WSI preferences. - // If not we want to default WSI preferences to any old WSI preferences that - // have been set. - - IEclipsePreferences preferences = new InstanceScope().getNode( ServicePolicyActivator.PLUGIN_ID ); - String apValue = preferences.get( WSIServicePoliciesConstants.ServicePolicyID_AP10 + "." + IPolicyState.DefaultValueKey, null ); //$NON-NLS-1$ - String ssbpValue = preferences.get( WSIServicePoliciesConstants.ServicePolicyID_SSBP10 + "." + IPolicyState.DefaultValueKey, null ); //$NON-NLS-1$ - Preferences oldPrefs = WSPlugin.getInstance().getPluginPreferences(); - String[] oldPropNames = oldPrefs.propertyNames(); - - if( apValue == null ) - { - ServicePolicyPlatform platform = ServicePolicyPlatform.getInstance(); - IServicePolicy apPolicy = platform.getServicePolicy( WSIServicePoliciesConstants.ServicePolicyID_AP10 ); - IPolicyState apState = apPolicy.getPolicyState(); - - if( indexOfString( "nonWSIAPCompliance", oldPropNames ) != -1 ) //$NON-NLS-1$ - { - // We have an old AP value so we will use it's value as the default for settings. - String oldApValue = oldPrefs.getString( "nonWSIAPCompliance" ); //$NON-NLS-1$ - int oldApIndex = indexOfString( oldApValue, CONTEXT_IDS ); - String newApValue = null; - - if( oldApIndex < ENUM_ID_VALUES.length ) - { - newApValue = ENUM_ID_VALUES[oldApIndex]; - } - - if( newApValue != null ) - { - apState.putValue( IPolicyState.DefaultValueKey, newApValue ); - } - } - // also need to check if any project specific preferences were set - QualifiedName name = new QualifiedName(WSPlugin.ID, - "nonWSIAPCompliance"); //$NON-NLS-1$ - IProject[] projects = ResourcesPlugin.getWorkspace().getRoot() - .getProjects(); - for (int i = 0; i < projects.length; i++) { - try { - IProject project = projects[i]; - String oldProperty = null; - oldProperty = project.getPersistentProperty(name); - if (oldProperty != null && !oldProperty.equals("")) { //$NON-NLS-1$ - int oldApIndex = indexOfString(oldProperty, CONTEXT_IDS); - String newApValue = null; - if (oldApIndex != -1 && oldApIndex < ENUM_ID_VALUES.length) { - newApValue = ENUM_ID_VALUES[oldApIndex]; - } - - if (newApValue != null) { - apState = apPolicy.getPolicyState(project); - platform.setProjectPreferencesEnabled(project, true); - apState.putValue( IPolicyState.DefaultValueKey, newApValue ); - } - } - } catch (CoreException e) { - //ignore this project - } - } - } - - - - if( ssbpValue == null ) - { - ServicePolicyPlatform platform = ServicePolicyPlatform.getInstance(); - IServicePolicy ssbpPolicy = platform.getServicePolicy( WSIServicePoliciesConstants.ServicePolicyID_SSBP10 ); - IPolicyState ssbpState = ssbpPolicy.getPolicyState(); - - if( indexOfString( "nonWSISSBPCompliance", oldPropNames ) != -1 ) //$NON-NLS-1$ - { - // We have an old SSBP value so we will use it's value as the default for settings. - String oldSSBPValue = oldPrefs.getString( "nonWSISSBPCompliance" ); //$NON-NLS-1$ - int oldSSBPIndex = indexOfString( oldSSBPValue, CONTEXT_IDS ); - String newSSBPValue = null; - - if( oldSSBPIndex < ENUM_ID_VALUES.length ) - { - newSSBPValue = ENUM_ID_VALUES[oldSSBPIndex]; - } - - if( newSSBPValue != null ) - { - ssbpState.putValue( IPolicyState.DefaultValueKey, newSSBPValue ); - } - } - // also need to check if any project specific preferences were set - QualifiedName name = new QualifiedName(WSPlugin.ID, - "nonWSISSBPCompliance"); //$NON-NLS-1$ - IProject[] projects = ResourcesPlugin.getWorkspace().getRoot() - .getProjects(); - for (int i = 0; i < projects.length; i++) { - try { - IProject project = projects[i]; - String oldProperty = null; - oldProperty = project.getPersistentProperty(name); - if (oldProperty != null && !oldProperty.equals("")) { //$NON-NLS-1$ - int oldSSBPIndex = indexOfString(oldProperty, CONTEXT_IDS); - String newSSBPValue = null; - if (oldSSBPIndex != -1 && oldSSBPIndex < ENUM_ID_VALUES.length) { - newSSBPValue = ENUM_ID_VALUES[oldSSBPIndex]; - } - - if (newSSBPValue != null) { - ssbpState = ssbpPolicy.getPolicyState(project); - platform.setProjectPreferencesEnabled(project, true); - ssbpState.putValue( IPolicyState.DefaultValueKey, newSSBPValue ); - } - } - } catch (CoreException e) { - //ignore this project - } - } - - } - } - - private int indexOfString( String target, String[] values ) - { - int result = -1; - - for( int index = 0; index< values.length; index++ ) - { - String value = values[index]; - - if( value.equals( target ) ) - { - result = index; - break; - } - } - - return result; - } -} diff --git a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/PersistentMergeContext.java b/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/PersistentMergeContext.java deleted file mode 100644 index 9cc07cb44..000000000 --- a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/PersistentMergeContext.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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 - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060403 128827 kathy@ca.ibm.com - Kathy Chan - *******************************************************************************/ -package org.eclipse.wst.ws.internal.preferences; - -import org.eclipse.wst.command.internal.env.context.PersistentContext; -import org.eclipse.wst.ws.internal.plugin.WSPlugin; - - -public class PersistentMergeContext extends PersistentContext -{ - /** - * This constant string is used to lookup the enable skeleton merge general preference from - * the plugins local preferences store. - **/ - public static final String PREFERENCE_SKELETON_MERGE = "skeletonMerge"; - - private static PersistentMergeContext context_ = null; - - public static PersistentMergeContext getInstance() - { - if( context_ == null ) - { - context_ = new PersistentMergeContext(); - context_.load(); - } - - return context_; - } - - public PersistentMergeContext() - { - super(WSPlugin.getInstance()); - } - - public void load() - { - setDefault(PREFERENCE_SKELETON_MERGE, MergeDefaults.getSkeletonMergeDefault()); - } - - public void setSkeletonMergeEnabled(boolean enable) - { - setValue(PREFERENCE_SKELETON_MERGE, enable); - } - - public boolean isSkeletonMergeEnabled() - { - return getValueAsBoolean(PREFERENCE_SKELETON_MERGE); - } - -} diff --git a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/PersistentWSDLValidationContext.java b/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/PersistentWSDLValidationContext.java deleted file mode 100644 index cb1c047a9..000000000 --- a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/PersistentWSDLValidationContext.java +++ /dev/null @@ -1,77 +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 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.ws.internal.preferences; - -import org.eclipse.wst.command.internal.env.context.PersistentContext; -import org.eclipse.wst.ws.internal.plugin.WSPlugin; - - - -public class PersistentWSDLValidationContext extends PersistentContext -{ - public static final String VALIDATE_NO_WSDL = "0"; - public static final String VALIDATE_REMOTE_WSDL = "1"; - public static final String VALIDATE_ALL_WSDL = "2"; - - private String wsdl_validation = "WSDL_VALIDATION"; - -public PersistentWSDLValidationContext () -{ - super( WSPlugin.getInstance()); - -} - -public void load() -{ - setDefault(wsdl_validation, VALIDATE_NO_WSDL); -} - -// to be used only by the preference page -public void updateWSDLValidation ( String value) -{ - setValue( wsdl_validation, value); -} - -public String getPersistentWSDLValidation () -{ - String property = getValueAsString(wsdl_validation); -// default to Ignore if no init has been done from ini file - if (property == null || property.equals("")) { - setValue( wsdl_validation, VALIDATE_NO_WSDL); - return VALIDATE_NO_WSDL; - } - else - return property; -} - -public String getDefault() -{ - return getDefaultString(wsdl_validation); -} - -public boolean ValidateNoWSDL() -{ - return VALIDATE_NO_WSDL.equals(getPersistentWSDLValidation()); -} - -public boolean WarnNonWSICompliances() -{ - return VALIDATE_REMOTE_WSDL.equals(getPersistentWSDLValidation()); -} - -public boolean IgnoreNonWSICompliances() -{ - return VALIDATE_ALL_WSDL.equals(getPersistentWSDLValidation()); -} - - -} diff --git a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/PersistentWSIAPContext.java b/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/PersistentWSIAPContext.java deleted file mode 100644 index 3e55b7fa9..000000000 --- a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/PersistentWSIAPContext.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 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 - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20080318 223118 ericdp@ca.ibm.com - Eric D. Peters, metadata required in WS-I profiles to support editors & validators - *******************************************************************************/ - -package org.eclipse.wst.ws.internal.preferences; - -import org.eclipse.core.runtime.QualifiedName; -import org.eclipse.wst.ws.internal.WstWSPluginMessages; -import org.eclipse.wst.ws.internal.plugin.WSPlugin; - - - -public class PersistentWSIAPContext extends PersistentWSIContext -{ - private static final String NON_WSI_AP_COMPLIANCE = "nonWSIAPCompliance"; - -public PersistentWSIAPContext () -{ - super(); - non_wsi_compliance = NON_WSI_AP_COMPLIANCE; - name = new QualifiedName(WSPlugin.ID , non_wsi_compliance); - wsiWarning_ = WstWSPluginMessages.WSI_AP_WARNING; - wsiError_ = WstWSPluginMessages.WSI_AP_ERROR; -} - -public String getPersistentWSICompliance () -{ - String property = getValueAsString(non_wsi_compliance); - // default to Warning if no init has been done from ini file - if (property == null || property.equals("")) { - setValue( non_wsi_compliance, WARN_NON_WSI); - return WARN_NON_WSI; - } - else - return property; -} - -protected String getServicePolicyId() -{ - return WSIServicePoliciesConstants.ServicePolicyID_AP10; -} - -} diff --git a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/PersistentWSIContext.java b/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/PersistentWSIContext.java deleted file mode 100644 index a9624f10a..000000000 --- a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/PersistentWSIContext.java +++ /dev/null @@ -1,186 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 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 - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20071108 209267 pmoogk@ca.ibm.com - Peter Moogk - * 20080318 223118 ericdp@ca.ibm.com - Eric D. Peters, metadata required in WS-I profiles to support editors & validators - *******************************************************************************/ - -package org.eclipse.wst.ws.internal.preferences; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.QualifiedName; -import org.eclipse.wst.command.internal.env.context.PersistentContext; -import org.eclipse.wst.common.environment.EnvironmentService; -import org.eclipse.wst.common.environment.ILog; -import org.eclipse.wst.ws.internal.WstWSPluginMessages; -import org.eclipse.wst.ws.internal.plugin.WSPlugin; -import org.eclipse.wst.ws.service.policy.IServicePolicy; -import org.eclipse.wst.ws.service.policy.ServicePolicyPlatform; - - - -public class PersistentWSIContext extends PersistentContext -{ - public static final String STOP_NON_WSI = "0"; - public static final String WARN_NON_WSI = "1"; - public static final String IGNORE_NON_WSI = "2"; - public static final String FOLLOW_WSI_PREFERENCE = "3"; - - private static final String[] ENUM_ID_VALUES = { "org.eclipse.wst.sug.require", "org.eclipse.wst.sug.suggest", "org.eclipse.wst.sug.ignore"}; - private static final String[] CONTEXT_IDS = { STOP_NON_WSI, WARN_NON_WSI, IGNORE_NON_WSI }; - - protected QualifiedName name = null; // set in subclass - protected String non_wsi_compliance; - private static final String NON_WSI_SSBP_COMPLIANCE = "nonWSISSBPCompliance"; - protected String wsiWarning_; // set in subclass - protected String wsiError_; // set in subclass - -public PersistentWSIContext () -{ - super( WSPlugin.getInstance()); - -// NOTE: name, wsiWarning_ and wsiError_ should be set in the subclasses. This is providing defaulting only. - non_wsi_compliance = NON_WSI_SSBP_COMPLIANCE; - name = new QualifiedName(WSPlugin.ID , non_wsi_compliance); - wsiWarning_ = WstWSPluginMessages.WSI_SSBP_WARNING; - wsiError_ = WstWSPluginMessages.WSI_SSBP_ERROR; -} - -public void load() -{ - // let the default be read from plugin_costomization.ini file - // setDefault(non_wsi_compliance, WARN_NON_WSI); -} - -// to be used only by the preference page -public void updateWSICompliances ( String value) -{ - setValue( non_wsi_compliance, value); -} - -public String getPersistentWSICompliance () -{ - String property = getValueAsString(non_wsi_compliance); -// default to Warning if no init has been done from ini file - if (property == null || property.equals("")) { - setValue( non_wsi_compliance, WARN_NON_WSI); - return WARN_NON_WSI; - } - else - return property; -} - -public boolean StopNonWSICompliances() -{ - return STOP_NON_WSI.equals(getPersistentWSICompliance()); -} - -public boolean WarnNonWSICompliances() -{ - return WARN_NON_WSI.equals(getPersistentWSICompliance()); -} - -public boolean IgnoreNonWSICompliances() -{ - return IGNORE_NON_WSI.equals(getPersistentWSICompliance()); -} - -// to be used only by the property page -public void updateProjectWSICompliances ( IProject project, String value) -{ - try { - project.setPersistentProperty(name, value); - } - catch (CoreException e) { - System.out.println("No such Project"); - ILog log = EnvironmentService.getEclipseLog(); - log.log(ILog.INFO, 5084, this, "updateProjectWSICompliances", "No such Project "+project); - } -} - -public boolean projectStopNonWSICompliances(IProject project) -{ - return STOP_NON_WSI.equals(getProjectPersistentProperty(project)); -} - -public boolean projectWarnNonWSICompliances(IProject project) -{ - return WARN_NON_WSI.equals(getProjectPersistentProperty(project)); -} - -public boolean projectIgnoreNonWSICompliances(IProject project) -{ - return IGNORE_NON_WSI.equals(getProjectPersistentProperty(project)); -} - - -// to be used only by the property page -public boolean projectFollowWSIPreferance(IProject project) -{ - try { - String property = project.getPersistentProperty(name); - return (property == null || property.equals("") || property.equals(FOLLOW_WSI_PREFERENCE)); - } - catch (CoreException e) { - return true; - } -} - -private String getProjectPersistentProperty(IProject project) -{ - String property = getProjectWSICompliance(project); - if (property.equals(FOLLOW_WSI_PREFERENCE)) { - property = getPersistentWSICompliance(); - } - return property; - } - - public String getProjectWSICompliance(IProject project) - { - - ServicePolicyPlatform platform = ServicePolicyPlatform.getInstance(); - IServicePolicy servicePolicy = platform.getServicePolicy( getServicePolicyId() ); - String currentStateID = servicePolicy.getPolicyStateEnum(project).getCurrentItem().getId(); - String property = FOLLOW_WSI_PREFERENCE; - - for( int index = 0; index < ENUM_ID_VALUES.length; index++ ) - { - if( ENUM_ID_VALUES[index].equals( currentStateID ) ) - { - property = CONTEXT_IDS[index]; - break; - } - } - - return property; - } - - protected String getServicePolicyId() - { - return WSIServicePoliciesConstants.ServicePolicyID_SSBP10; - } - - public QualifiedName getName() - { - return name; - } - - public String getWarning() - { - return wsiWarning_; - } - - public String getError() - { - return wsiError_; - } -} diff --git a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/PersistentWSISSBPContext.java b/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/PersistentWSISSBPContext.java deleted file mode 100644 index 510827333..000000000 --- a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/PersistentWSISSBPContext.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 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 - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20080318 223118 ericdp@ca.ibm.com - Eric D. Peters, metadata required in WS-I profiles to support editors & validators - *******************************************************************************/ - -package org.eclipse.wst.ws.internal.preferences; - -import org.eclipse.core.runtime.QualifiedName; -import org.eclipse.wst.ws.internal.WstWSPluginMessages; -import org.eclipse.wst.ws.internal.plugin.WSPlugin; - - - -public class PersistentWSISSBPContext extends PersistentWSIContext -{ - private static final String NON_WSI_SSBP_COMPLIANCE = "nonWSISSBPCompliance"; - - public PersistentWSISSBPContext () - { - super(); - non_wsi_compliance = NON_WSI_SSBP_COMPLIANCE; - name = new QualifiedName(WSPlugin.ID , non_wsi_compliance); - wsiWarning_ = WstWSPluginMessages.WSI_SSBP_WARNING; - wsiError_ = WstWSPluginMessages.WSI_SSBP_ERROR; - } - - protected String getServicePolicyId() - { - return WSIServicePoliciesConstants.ServicePolicyID_SSBP10; - } -} diff --git a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/PersistentWaitForWSDLValidationContext.java b/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/PersistentWaitForWSDLValidationContext.java deleted file mode 100644 index eced2116e..000000000 --- a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/PersistentWaitForWSDLValidationContext.java +++ /dev/null @@ -1,55 +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 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.ws.internal.preferences; - -import org.eclipse.wst.command.internal.env.context.PersistentContext; -import org.eclipse.wst.ws.internal.plugin.WSPlugin; - - - -public class PersistentWaitForWSDLValidationContext extends PersistentContext -{ - - private String wait_for_wsdl_validation = "WAIT_FOR_WSDL_VALIDATION"; - -public PersistentWaitForWSDLValidationContext () -{ - super( WSPlugin.getInstance()); - -} - -public void load() -{ - setDefault(wait_for_wsdl_validation, true); -} - -// to be used only by the preference page -public void setWaitForWSDLValidation ( boolean value) -{ - setValue( wait_for_wsdl_validation, value); -} - -public boolean getPersistentWaitForWSDLValidation () -{ - return getValueAsBoolean(wait_for_wsdl_validation); - -} - -public boolean getDefault() -{ - return getDefaultBoolean(wait_for_wsdl_validation); -} - - - - -} diff --git a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/WSDLFilePropertyTester.java b/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/WSDLFilePropertyTester.java deleted file mode 100644 index fdefe462f..000000000 --- a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/WSDLFilePropertyTester.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20071120 196997 pmoogk@ca.ibm.com - Peter Moogk - * 20071219 213447 pmoogk@ca.ibm.com - Peter Moogk - *******************************************************************************/ -package org.eclipse.wst.ws.internal.preferences; - -import org.eclipse.core.expressions.PropertyTester; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; - -public class WSDLFilePropertyTester extends PropertyTester -{ - public boolean test(Object receiver, String property, Object[] args, Object expectedValue) - { - boolean result = false; - - if( receiver instanceof IContainer) - { - result = hasWSDLfile( (IContainer) receiver ); - } - - return result; - } - - private boolean hasWSDLfile( IContainer container ) - { - boolean result = false; - - try - { - IResource[] children = container.members(); - - for( IResource child : children ) - { - if( child instanceof IContainer ) - { - result = hasWSDLfile( (IContainer) child ); - - } - else if( child instanceof IFile ) - { - String extension = child.getFileExtension(); - - if( extension != null ) - { - result = extension.equals( "wsdl" ); - } - } - - // If we found a single wsdl file we will break out of the loop. - if( result ) break; - } - } - catch( CoreException exc ) - { - // Ignore exception and return false. - } - - return result; - } -} diff --git a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/WSIComplianceUtils.java b/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/WSIComplianceUtils.java deleted file mode 100644 index d48840431..000000000 --- a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/WSIComplianceUtils.java +++ /dev/null @@ -1,88 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 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 - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20080827 245439 ericdp@ca.ibm.com - Eric D. Peters, Usability issue with the compliance warning dialog - *******************************************************************************/ - -package org.eclipse.wst.ws.internal.preferences; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.wst.command.internal.env.core.common.StatusUtils; -import org.eclipse.wst.common.environment.Choice; -import org.eclipse.wst.common.environment.IStatusHandler; -import org.eclipse.wst.ws.internal.WstWSPluginMessages; - - -public class WSIComplianceUtils -{ - -/** - * @param project - * @param context - * @return - */ -public static int getWSISeverity (IProject project, PersistentWSIContext context) -{ - if (context.projectStopNonWSICompliances(project)) - return Status.ERROR; - else if (context.projectWarnNonWSICompliances(project)) - return Status.WARNING; - else - return Status.INFO; -} - -/** - * @param monitor IStatusHandler - * @param status Status[] - * @param project IProject - * @param context PersistentWSIContext - * @return boolean true if to continue - */ -public static boolean checkWSICompliance ( IStatusHandler monitor, Status[] status, IProject project, PersistentWSIContext context) -{ - if (context.projectStopNonWSICompliances(project)) - { - - // emit an error message and return false - IStatus status_ = StatusUtils.multiStatus( context.getError(), status ); - monitor.reportError(status_); - return false; - } - else if (context.projectWarnNonWSICompliances(project)) - { - // give a warning message with the options to stop, ignore this one, or ignore all coming messages - IStatus status_ = StatusUtils.multiStatus( context.getWarning(), status); - - Choice ignoreChoice = new Choice('I', WstWSPluginMessages.IGNORE_LABEL, WstWSPluginMessages.IGNORE_DESCRIPTION); - Choice ignoreAllChoice = new Choice('A', WstWSPluginMessages.IGNORE_ALL_LABEL, WstWSPluginMessages.IGNORE_ALL_DESCRIPTION); - Choice cancelChoice = new Choice('C', WstWSPluginMessages.CANCEL_LABEL, WstWSPluginMessages.CANCEL_DESCRIPTION); - Choice result = monitor.report(status_, new Choice[]{ignoreChoice, ignoreAllChoice, cancelChoice}); - - // if the user selects to cancel, or closes/escapes the message box, do not continue with the command - if (result == null || result.getLabel().equals(cancelChoice.getLabel())) - return false; - // if the user selects ignore, continue - else if (result.getLabel().equals(ignoreChoice.getLabel())) - return true; - // if the user selects ignore all, change the preference - else if (result.getLabel().equals(ignoreAllChoice.getLabel())) - { - context.updateProjectWSICompliances(project, PersistentWSIContext.IGNORE_NON_WSI); - return true; - } - - } - return true; - } - -} diff --git a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/WSIServicePoliciesConstants.java b/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/WSIServicePoliciesConstants.java deleted file mode 100644 index 6c236ccff..000000000 --- a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/WSIServicePoliciesConstants.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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 - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20080318 223118 ericdp@ca.ibm.com - Eric D. Peters, metadata required in WS-I profiles to support editors & validators - * 20080324 223118 ericdp@ca.ibm.com - Eric D. Peters, metadata required in WS-I profiles to support editors & validators - *******************************************************************************/ -package org.eclipse.wst.ws.internal.preferences; - -public interface WSIServicePoliciesConstants { - public static final String stateKeyDefaultProtocol = "defaultProtocol"; - public static final String stateKeyDefaultProtocol_VALUE_SOAP = "http://schemas.xmlsoap.org/wsdl/soap/"; - public static final String stateKeyDefaultProtocol_VALUE_SOAP12 = "http://schemas.xmlsoap.org/wsdl/soap12/"; - - public static final String ServicePolicyID_SSBP10 = "org.eclipse.wst.ws.service.policy.ui.servicepols.wsiprofilecomp.wsissbp"; - public static final String ServicePolicyID_AP10 = "org.eclipse.wst.ws.service.policy.ui.servicepols.wsiprofilecomp.wsiap"; - public static final String ServicePolicyID_WSIProfileRoot = "org.eclipse.wst.ws.service.policy.ui.servicepols.wsiprofilecomp"; - - public static final String stateEnumRequire = "org.eclipse.wst.sug.require"; - public static final String stateEnumSuggest = "org.eclipse.wst.sug.suggest"; - public static final String stateEnumIgnore = "org.eclipse.wst.sug.ignore"; - - -} |