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 329997
Collapse All | Expand All

(-)vf2/org/eclipse/wst/validation/internal/DisabledValidatorManager.java (+13 lines)
Lines 1-3 Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 * IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
1
package org.eclipse.wst.validation.internal;
12
package org.eclipse.wst.validation.internal;
2
13
3
import java.util.Collections;
14
import java.util.Collections;
Lines 32-37 Link Here
32
	
43
	
33
	private DisabledValidatorManager(){
44
	private DisabledValidatorManager(){
34
		ValPrefManagerProject.addListener(this);
45
		ValPrefManagerProject.addListener(this);
46
        ValPrefManagerGlobal.getDefault().addListener(this);
35
	}
47
	}
36
	
48
	
37
	/*
49
	/*
Lines 39-44 Link Here
39
	 */
51
	 */
40
	public void dispose(){
52
	public void dispose(){
41
		ValPrefManagerProject.removeListener(this);
53
		ValPrefManagerProject.removeListener(this);
54
        ValPrefManagerGlobal.getDefault().removeListener(this);
42
	}
55
	}
43
56
44
	public Set<Validator> getDisabledValidatorsFor(IResource resource) {
57
	public Set<Validator> getDisabledValidatorsFor(IResource resource) {
(-)vf2/org/eclipse/wst/validation/internal/ValManager.java (-3 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2009 IBM Corporation and others.
2
 * Copyright (c) 2007, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 447-455 Link Here
447
	 */
447
	 */
448
	public boolean isDisabled(IProject project){
448
	public boolean isDisabled(IProject project){
449
		GlobalPreferences gp = getGlobalPreferences();
449
		GlobalPreferences gp = getGlobalPreferences();
450
		if (!gp.getOverride() || project == null)return gp.getDisableAllValidation();
450
		if (mustUseGlobalValidators(project))return gp.getDisableAllValidation();
451
		
451
		
452
		ProjectPreferences pp = _projectPreferences.get(project);
452
		ProjectPreferences pp = getProjectPreferences(project);
453
		if (pp == null)return gp.getDisableAllValidation();
453
		if (pp == null)return gp.getDisableAllValidation();
454
		return pp.getSuspend();		
454
		return pp.getSuspend();		
455
	}
455
	}
(-)vf2/org/eclipse/wst/validation/internal/FullBuildJob.java (+11 lines)
Lines 1-3 Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 * IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
1
package org.eclipse.wst.validation.internal;
12
package org.eclipse.wst.validation.internal;
2
13
3
import org.eclipse.core.resources.IncrementalProjectBuilder;
14
import org.eclipse.core.resources.IncrementalProjectBuilder;
(-)validate/org/eclipse/wst/validation/internal/operations/ValidationBuilder.java (-2 / +7 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2001, 2009 IBM Corporation and others.
2
 * Copyright (c) 2001, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 19-24 Link Here
19
import java.util.Set;
19
import java.util.Set;
20
20
21
import org.eclipse.core.resources.IProject;
21
import org.eclipse.core.resources.IProject;
22
import org.eclipse.core.resources.IResource;
22
import org.eclipse.core.resources.IResourceDelta;
23
import org.eclipse.core.resources.IResourceDelta;
23
import org.eclipse.core.resources.IncrementalProjectBuilder;
24
import org.eclipse.core.resources.IncrementalProjectBuilder;
24
import org.eclipse.core.runtime.CoreException;
25
import org.eclipse.core.runtime.CoreException;
Lines 27-32 Link Here
27
import org.eclipse.wst.validation.ValidationFramework;
28
import org.eclipse.wst.validation.ValidationFramework;
28
import org.eclipse.wst.validation.internal.ConfigurationManager;
29
import org.eclipse.wst.validation.internal.ConfigurationManager;
29
import org.eclipse.wst.validation.internal.InternalValidatorManager;
30
import org.eclipse.wst.validation.internal.InternalValidatorManager;
31
import org.eclipse.wst.validation.internal.MarkerManager;
30
import org.eclipse.wst.validation.internal.ProjectConfiguration;
32
import org.eclipse.wst.validation.internal.ProjectConfiguration;
31
import org.eclipse.wst.validation.internal.ResourceConstants;
33
import org.eclipse.wst.validation.internal.ResourceConstants;
32
import org.eclipse.wst.validation.internal.ResourceHandler;
34
import org.eclipse.wst.validation.internal.ResourceHandler;
Lines 151-157 Link Here
151
		// won't they have builders of their own.
153
		// won't they have builders of their own.
152
		IProject[] referenced = getAllReferencedProjects(project, null);
154
		IProject[] referenced = getAllReferencedProjects(project, null);
153
		if (ValidationFramework.getDefault().isSuspended(project) || 
155
		if (ValidationFramework.getDefault().isSuspended(project) || 
154
			ValManager.getDefault().isDisabled(project))return referenced;
156
			ValManager.getDefault().isDisabled(project)) {
157
		  MarkerManager.getDefault().deleteMarkers(project, System.currentTimeMillis(), IResource.DEPTH_INFINITE);
158
		  return referenced;
159
		}
155
160
156
		try {
161
		try {
157
			newBuild(kind, monitor);
162
			newBuild(kind, monitor);
(-)vf2/org/eclipse/wst/validation/internal/ProjectReValidationJob.java (+43 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 * IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.wst.validation.internal;
13
14
import org.eclipse.core.resources.IProject;
15
import org.eclipse.core.resources.IncrementalProjectBuilder;
16
import org.eclipse.core.resources.WorkspaceJob;
17
import org.eclipse.core.runtime.CoreException;
18
import org.eclipse.core.runtime.IProgressMonitor;
19
import org.eclipse.core.runtime.IStatus;
20
import org.eclipse.core.runtime.Status;
21
import org.eclipse.wst.validation.internal.plugin.ValidationPlugin;
22
23
public class ProjectReValidationJob extends WorkspaceJob {
24
    
25
    private final IProject project;
26
27
    public ProjectReValidationJob(IProject project){
28
        super(ValMessages.JobName);
29
        this.project = project;
30
    }
31
32
    @Override
33
    public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
34
        try {
35
            project.build(IncrementalProjectBuilder.FULL_BUILD, ValidationPlugin.VALIDATION_BUILDER_ID, null, monitor);
36
        }
37
        catch (Exception e){
38
            return new Status(IStatus.ERROR,ValidationPlugin.PLUGIN_ID, e.toString(), e);
39
        }
40
        return Status.OK_STATUS;
41
    }
42
43
}
(-)vf2/org/eclipse/wst/validation/ui/internal/ValUIMessages.java (-1 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2008 IBM Corporation and others.
2
 * Copyright (c) 2007, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 109-114 Link Here
109
	
109
	
110
	public static String RebuildTitle;
110
	public static String RebuildTitle;
111
	public static String RebuildMsg;
111
	public static String RebuildMsg;
112
    public static String RevalidateProjectMsg;
112
	
113
	
113
		
114
		
114
	static {
115
	static {
(-)property_files/org/eclipse/wst/validation/ui/internal/messages.properties (-2 / +3 lines)
Lines 1-5 Link Here
1
###############################################################################
1
###############################################################################
2
# Copyright (c) 2001, 2008 IBM Corporation and others.
2
# Copyright (c) 2001, 2010 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
5
# which accompanies this distribution, and is available at
Lines 150-156 Link Here
150
FrMsgSev=Select the severity level for the following problems
150
FrMsgSev=Select the severity level for the following problems
151
151
152
RebuildTitle=Validation Settings Changed
152
RebuildTitle=Validation Settings Changed
153
RebuildMsg=The validation settings have changed. A full rebuild is required for the changes to take effect. Do the full build now?
153
RebuildMsg=The workspace validation settings have changed. A full rebuild is required for the changes to take effect. Do the full build now?
154
RevalidateProjectMsg=The project validation settings have changed. A full project re-validation is required for the changes to take effect. Do the full re-validation now?
154
155
155
#
156
#
156
# End Validation Builder Framework UI Strings
157
# End Validation Builder Framework UI Strings
(-)vf2/org/eclipse/wst/validation/ui/internal/preferences/ValidationPropertyPage.java (-1 / +10 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2001, 2008 IBM Corporation and others.
2
 * Copyright (c) 2001, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 62-67 Link Here
62
import org.eclipse.wst.validation.Validator;
62
import org.eclipse.wst.validation.Validator;
63
import org.eclipse.wst.validation.internal.ConfigurationManager;
63
import org.eclipse.wst.validation.internal.ConfigurationManager;
64
import org.eclipse.wst.validation.internal.GlobalConfiguration;
64
import org.eclipse.wst.validation.internal.GlobalConfiguration;
65
import org.eclipse.wst.validation.internal.ProjectReValidationJob;
65
import org.eclipse.wst.validation.internal.ProjectConfiguration;
66
import org.eclipse.wst.validation.internal.ProjectConfiguration;
66
import org.eclipse.wst.validation.internal.ValManager;
67
import org.eclipse.wst.validation.internal.ValManager;
67
import org.eclipse.wst.validation.internal.ValPrefManagerProject;
68
import org.eclipse.wst.validation.internal.ValPrefManagerProject;
Lines 664-669 Link Here
664
			ProjectPreferences pp = new ProjectPreferences(project, _override.getSelection(), _suspend.getSelection(), null);
665
			ProjectPreferences pp = new ProjectPreferences(project, _override.getSelection(), _suspend.getSelection(), null);
665
			ValPrefManagerProject vpm = new ValPrefManagerProject(project);
666
			ValPrefManagerProject vpm = new ValPrefManagerProject(project);
666
			vpm.savePreferences(pp, _validators);
667
			vpm.savePreferences(pp, _validators);
668
			
669
            if (_changes > 0 && !pp.getSuspend() && 
670
                MessageDialog.openQuestion(_shell, ValUIMessages.RebuildTitle, ValUIMessages.RevalidateProjectMsg)){
671
                
672
                ProjectReValidationJob pbj = new ProjectReValidationJob(project);
673
                pbj.schedule();
674
            }
675
            
667
			return true;
676
			return true;
668
		}
677
		}
669
		
678
		

Return to bug 329997