Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/PersistentWSIContext.java')
-rw-r--r--bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/PersistentWSIContext.java164
1 files changed, 0 insertions, 164 deletions
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 2b4fd0d07..000000000
--- a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/preferences/PersistentWSIContext.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 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.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;
-
-
-
-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";
-
- 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)
-{
- try {
- String property = project.getPersistentProperty(name);
- if (property == null || property.equals(""))
- {
- property = FOLLOW_WSI_PREFERENCE;
- }
- return property;
- }
- catch (CoreException e) {
- System.out.println("No such Project");
- return getPersistentWSICompliance();
- }
-}
-
-public String getWarning()
-{
- return wsiWarning_;
-}
-
-public String getError()
-{
- return wsiError_;
-}
-
-}

Back to the top