click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From take...@apache.org
Subject svn commit: r1086216 - /click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/facet/ClickFacetInstallDelegate.java
Date Mon, 28 Mar 2011 12:50:56 GMT
Author: takezoe
Date: Mon Mar 28 12:50:56 2011
New Revision: 1086216

URL: http://svn.apache.org/viewvc?rev=1086216&view=rev
Log:
Fixed: disabling HTML validator does not work

Modified:
    click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/facet/ClickFacetInstallDelegate.java

Modified: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/facet/ClickFacetInstallDelegate.java
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/facet/ClickFacetInstallDelegate.java?rev=1086216&r1=1086215&r2=1086216&view=diff
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/facet/ClickFacetInstallDelegate.java
(original)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/facet/ClickFacetInstallDelegate.java
Mon Mar 28 12:50:56 2011
@@ -52,10 +52,10 @@ import org.eclipse.jst.j2ee.webapplicati
 import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
 import org.eclipse.wst.common.project.facet.core.IDelegate;
 import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.html.internal.validation.HTMLValidator;
-import org.eclipse.wst.validation.internal.ConfigurationManager;
-import org.eclipse.wst.validation.internal.ProjectConfiguration;
-import org.eclipse.wst.validation.internal.ValidatorMetaData;
+import org.eclipse.wst.validation.IMutableValidator;
+import org.eclipse.wst.validation.MutableProjectSettings;
+import org.eclipse.wst.validation.MutableWorkspaceSettings;
+import org.eclipse.wst.validation.ValidationFramework;
 
 /**
  * Installs the click facet.
@@ -111,21 +111,22 @@ public class ClickFacetInstallDelegate i
 
 			// Disable HTML validator
 			try {
-				ProjectConfiguration projectConfig
-					= ConfigurationManager.getManager().getProjectConfiguration(project);
-				ValidatorMetaData[] meta = projectConfig.getValidators();
-				List<ValidatorMetaData> enables = new ArrayList<ValidatorMetaData>();
-				for(int i=0;i<meta.length;i++){
-					if(!meta[i].getValidatorUniqueName().equals(HTMLValidator.class.getName())){
-						enables.add(meta[i]);
+				MutableWorkspaceSettings globalSettings = ValidationFramework.getDefault().getWorkspaceSettings();
+
+				List<IMutableValidator> mvs = new ArrayList<IMutableValidator>();
+				for(IMutableValidator mv: globalSettings.getValidators()){
+					if(mv.getId().equals("org.eclipse.wst.html.ui.HTMLValidator")){
+						mv.setBuildValidation(false);
+						mv.setManualValidation(false);
 					}
+					mvs.add(mv);
 				}
-				projectConfig.setDoesProjectOverride(true);
 
-				projectConfig.setEnabledManualValidators(
-						(ValidatorMetaData[])enables.toArray(new ValidatorMetaData[enables.size()]));
-				projectConfig.setEnabledBuildValidators(
-						(ValidatorMetaData[])enables.toArray(new ValidatorMetaData[enables.size()]));
+				MutableProjectSettings projectSettings = new MutableProjectSettings(
+						project, mvs.toArray(new IMutableValidator[mvs.size()]));
+				projectSettings.setOverride(true);
+
+				ValidationFramework.getDefault().applyChanges(projectSettings, true);
 
 			} catch(Exception ex){
 				//ex.printStackTrace();



Mime
View raw message