Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 320322 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java (-5 / +18 lines)
Lines 35-40 Link Here
35
import org.eclipse.jface.text.source.ISourceViewer;
35
import org.eclipse.jface.text.source.ISourceViewer;
36
import org.eclipse.wst.sse.core.StructuredModelManager;
36
import org.eclipse.wst.sse.core.StructuredModelManager;
37
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
37
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
38
import org.eclipse.wst.sse.core.utils.StringUtils;
38
import org.eclipse.wst.sse.ui.internal.IReleasable;
39
import org.eclipse.wst.sse.ui.internal.IReleasable;
39
import org.eclipse.wst.sse.ui.internal.reconcile.DocumentAdapter;
40
import org.eclipse.wst.sse.ui.internal.reconcile.DocumentAdapter;
40
import org.eclipse.wst.sse.ui.internal.reconcile.ReconcileAnnotationKey;
41
import org.eclipse.wst.sse.ui.internal.reconcile.ReconcileAnnotationKey;
Lines 153-162 Link Here
153
	public void reconcile(ITypedRegion tr, DirtyRegion dr) {
154
	public void reconcile(ITypedRegion tr, DirtyRegion dr) {
154
		/*
155
		/*
155
		 * Abort if no workspace file is known (new validation framework does
156
		 * Abort if no workspace file is known (new validation framework does
156
		 * not support that scenario) or no validators have been specified
157
		 * not support that scenario) or no validators have been specified or
158
		 * validation has been disabled
157
		 */
159
		 */
158
		if (isCanceled() || fMetaData.isEmpty())
160
		IFile file = getFile();
161
		if (isCanceled() || fMetaData.isEmpty() || (file != null && (
162
				ValidationFramework.getDefault().isSuspended(file.getProject()) ||
163
				ValidationFramework.getDefault().getProjectSettings(file.getProject()).getSuspend()))) {
159
			return;
164
			return;
165
		}
160
166
161
		IDocument doc = getDocument();
167
		IDocument doc = getDocument();
162
		// for external files, this can be null
168
		// for external files, this can be null
Lines 180-198 Link Here
180
		 * validators.
186
		 * validators.
181
		 */
187
		 */
182
		Set disabledValsByClass = new HashSet(20);
188
		Set disabledValsByClass = new HashSet(20);
183
		IFile file = getFile();
184
		if (file != null) {
189
		if (file != null) {
185
			if (ValidationFramework.getDefault().isSuspended() || ValidationFramework.getDefault().isSuspended(file.getProject()))
190
			if (ValidationFramework.getDefault().isSuspended() || ValidationFramework.getDefault().isSuspended(file.getProject()))
186
				return;
191
				return;
187
192
193
			ValidationFramework.getDefault().getDisabledValidatorsFor(file);
194
			
188
			for (Iterator it = ValidationFramework.getDefault().getDisabledValidatorsFor(file).iterator(); it.hasNext();) {
195
			for (Iterator it = ValidationFramework.getDefault().getDisabledValidatorsFor(file).iterator(); it.hasNext();) {
189
				Validator v = (Validator) it.next();
196
				Validator v = (Validator) it.next();
190
				Validator.V1 v1 = v.asV1Validator();
197
				Validator.V1 v1 = v.asV1Validator();
191
				if (v1 != null)
198
				if (v1 != null)
192
					disabledValsByClass.add(v1.getId());
199
					disabledValsByClass.add(v1.getId());
193
				// not a V1 validator
200
				// not a V1 validator
194
				else if (v.getSourceId() != null)
201
				else if (v.getSourceId() != null) {
195
					disabledValsBySourceId.add(v.getSourceId());
202
					//could be more then one sourceid per batch validator
203
					String[] sourceIDs = StringUtils.unpack(v.getSourceId());
204
					disabledValsBySourceId.addAll(Arrays.asList(sourceIDs));
205
				}
196
			}
206
			}
197
		}
207
		}
198
				
208
				
Lines 211-216 Link Here
211
				 * preferences before attempting to create/use it
221
				 * preferences before attempting to create/use it
212
				 */
222
				 */
213
				if (!disabledValsBySourceId.contains(vmd.getValidatorId()) && !disabledValsByClass.contains(vmd.getValidatorClass())) {
223
				if (!disabledValsBySourceId.contains(vmd.getValidatorId()) && !disabledValsByClass.contains(vmd.getValidatorClass())) {
224
					System.out.println(vmd.getValidatorId());
214
					int validatorScope = vmd.getValidatorScope();
225
					int validatorScope = vmd.getValidatorScope();
215
					ReconcileStepForValidator validatorStep = null;
226
					ReconcileStepForValidator validatorStep = null;
216
					// get step for partition type
227
					// get step for partition type
Lines 241-246 Link Here
241
			}
252
			}
242
		}
253
		}
243
254
255
		System.out.println("---");
256
		
244
		TemporaryAnnotation[] annotationsToRemove = getAnnotationsToRemove(dr, stepsRanOnThisDirtyRegion);
257
		TemporaryAnnotation[] annotationsToRemove = getAnnotationsToRemove(dr, stepsRanOnThisDirtyRegion);
245
		if (annotationsToRemove.length + annotationsToAdd.size() > 0)
258
		if (annotationsToRemove.length + annotationsToAdd.size() > 0)
246
			smartProcess(annotationsToRemove, (IReconcileResult[]) annotationsToAdd.toArray(new IReconcileResult[annotationsToAdd.size()]));
259
			smartProcess(annotationsToRemove, (IReconcileResult[]) annotationsToAdd.toArray(new IReconcileResult[annotationsToAdd.size()]));
(-)plugin.xml (-2 / +4 lines)
Lines 186-192 Link Here
186
            class="org.eclipse.jst.jsp.core.internal.validation.JSPBatchValidator"
186
            class="org.eclipse.jst.jsp.core.internal.validation.JSPBatchValidator"
187
            manual="true"
187
            manual="true"
188
            version="1"
188
            version="1"
189
            markerId="org.eclipse.jst.jsp.core.validationMarker">
189
            markerId="org.eclipse.jst.jsp.core.validationMarker"
190
            sourceid="org.eclipse.jst.jsp.jspelsourcevalidator, org.eclipse.jst.jsp.ui.internal.validation.jspactionvalidator, org.eclipse.jst.jsp.tldsourcevalidator, org.eclipse.jst.jsp.jspsourcevalidator">
190
         <include>
191
         <include>
191
            <rules>
192
            <rules>
192
	           <projectNature id="org.eclipse.jdt.core.javanature"/>
193
	           <projectNature id="org.eclipse.jdt.core.javanature"/>
Lines 238-244 Link Here
238
            class="org.eclipse.jst.jsp.core.internal.validation.JSPContentValidator"
239
            class="org.eclipse.jst.jsp.core.internal.validation.JSPContentValidator"
239
            manual="true"
240
            manual="true"
240
            version="1"
241
            version="1"
241
            markerId="org.eclipse.jst.jsp.core.validationMarker">
242
            markerId="org.eclipse.jst.jsp.core.validationMarker"
243
            sourceid="org.eclipse.jst.jsp.ui.internal.validation.markupvalidator, org.eclipse.jst.jsp.ui.internal.validation.htmlsyntaxvalidator">
242
         <include>
244
         <include>
243
            <rules>
245
            <rules>
244
				<contentType id="org.eclipse.jst.jsp.core.jspsource"/>
246
				<contentType id="org.eclipse.jst.jsp.core.jspsource"/>

Return to bug 320322