mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-08 16:55:38 +02:00
Bug 133881 - Make refreshing after building optional
Work in progress.
This commit is contained in:
parent
d803a052f5
commit
1c69515ad4
3 changed files with 55 additions and 20 deletions
|
@ -47,9 +47,26 @@ public class ExclusionInstance {
|
||||||
public static final String FILE_VALUE = "FILE"; //$NON-NLS-1$
|
public static final String FILE_VALUE = "FILE"; //$NON-NLS-1$
|
||||||
public static final String DISPLAY_STRING_ATTRIBUTE_NAME = "displayString"; //$NON-NLS-1$
|
public static final String DISPLAY_STRING_ATTRIBUTE_NAME = "displayString"; //$NON-NLS-1$
|
||||||
|
|
||||||
private ExclusionType fInstanceExclusionType;
|
protected ExclusionType fInstanceExclusionType;
|
||||||
private IResource fResource;
|
protected IResource fResource;
|
||||||
private String fDisplayString;
|
protected String fDisplayString;
|
||||||
|
protected RefreshExclusion fParent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the parent exclusion of this exclusion instance.
|
||||||
|
*
|
||||||
|
* @return RefreshExclusion
|
||||||
|
*/
|
||||||
|
public RefreshExclusion getParentExclusion() {
|
||||||
|
return fParent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param parent the RefreshExclusion to set as the parent.
|
||||||
|
*/
|
||||||
|
public void setParentExclusion(RefreshExclusion parent) {
|
||||||
|
fParent = parent;
|
||||||
|
}
|
||||||
|
|
||||||
public ExclusionType getExclusionType() {
|
public ExclusionType getExclusionType() {
|
||||||
return fInstanceExclusionType;
|
return fInstanceExclusionType;
|
||||||
|
|
|
@ -52,9 +52,31 @@ public abstract class RefreshExclusion {
|
||||||
protected List<ExclusionInstance> fExclusionInstanceList = new LinkedList<ExclusionInstance>();
|
protected List<ExclusionInstance> fExclusionInstanceList = new LinkedList<ExclusionInstance>();
|
||||||
protected List<RefreshExclusion> fNestedExclusions = new LinkedList<RefreshExclusion>();
|
protected List<RefreshExclusion> fNestedExclusions = new LinkedList<RefreshExclusion>();
|
||||||
protected ExclusionType fExclusionType;
|
protected ExclusionType fExclusionType;
|
||||||
protected RefreshExclusion fParent;
|
protected RefreshExclusion fParentExclusion;
|
||||||
|
protected IResource fParentResource;
|
||||||
|
|
||||||
|
|
||||||
protected String fContributorId;
|
protected String fContributorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If this exclusion is a direct descendant of a resource, returns that resource.
|
||||||
|
* Otherwise, returns null;
|
||||||
|
*
|
||||||
|
* @return IResource
|
||||||
|
*/
|
||||||
|
public IResource getParentResource() {
|
||||||
|
return fParentResource;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the parent resource of this exclusion.
|
||||||
|
*
|
||||||
|
* @param parentResource the parent resource to set
|
||||||
|
*/
|
||||||
|
public void setParentResource(IResource parentResource) {
|
||||||
|
this.fParentResource = parentResource;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return a String corresponding to the ID of the RefreshExclusionContributor that was used to create
|
* @return a String corresponding to the ID of the RefreshExclusionContributor that was used to create
|
||||||
* this exclusion.
|
* this exclusion.
|
||||||
|
@ -72,12 +94,12 @@ public abstract class RefreshExclusion {
|
||||||
*
|
*
|
||||||
* @return RefreshExclusion
|
* @return RefreshExclusion
|
||||||
*/
|
*/
|
||||||
public RefreshExclusion getParent() {
|
public RefreshExclusion getParentExclusion() {
|
||||||
return fParent;
|
return fParentExclusion;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setParent(RefreshExclusion parent) {
|
public void setParentExclusion(RefreshExclusion parent) {
|
||||||
fParent = parent;
|
fParentExclusion = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ExclusionType getExclusionType() {
|
public ExclusionType getExclusionType() {
|
||||||
|
@ -114,6 +136,7 @@ public abstract class RefreshExclusion {
|
||||||
* @param exclusionInstance
|
* @param exclusionInstance
|
||||||
*/
|
*/
|
||||||
public void addExclusionInstance(ExclusionInstance exclusionInstance) {
|
public void addExclusionInstance(ExclusionInstance exclusionInstance) {
|
||||||
|
exclusionInstance.setParentExclusion(this);
|
||||||
fExclusionInstanceList.add(exclusionInstance);
|
fExclusionInstanceList.add(exclusionInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,7 +159,7 @@ public abstract class RefreshExclusion {
|
||||||
|
|
||||||
public void addNestedExclusion(RefreshExclusion exclusion) {
|
public void addNestedExclusion(RefreshExclusion exclusion) {
|
||||||
fNestedExclusions.add(exclusion);
|
fNestedExclusions.add(exclusion);
|
||||||
exclusion.setParent(this);
|
exclusion.setParentExclusion(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -249,7 +272,7 @@ public abstract class RefreshExclusion {
|
||||||
}
|
}
|
||||||
|
|
||||||
// set parent
|
// set parent
|
||||||
newExclusion.fParent = parent;
|
newExclusion.fParentExclusion = parent;
|
||||||
|
|
||||||
newExclusion.fContributorId = exclusionElement.getAttribute(CONTRIBUTOR_ID_ATTRIBUTE_NAME);
|
newExclusion.fContributorId = exclusionElement.getAttribute(CONTRIBUTOR_ID_ATTRIBUTE_NAME);
|
||||||
|
|
||||||
|
|
|
@ -11,15 +11,14 @@
|
||||||
package org.eclipse.cdt.core.resources;
|
package org.eclipse.cdt.core.resources;
|
||||||
|
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
import java.util.Collections;
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
|
|
||||||
import javax.xml.parsers.DocumentBuilder;
|
import javax.xml.parsers.DocumentBuilder;
|
||||||
import javax.xml.parsers.DocumentBuilderFactory;
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||||||
import javax.xml.parsers.ParserConfigurationException;
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
import javax.xml.transform.OutputKeys;
|
|
||||||
import javax.xml.transform.Transformer;
|
import javax.xml.transform.Transformer;
|
||||||
import javax.xml.transform.TransformerConfigurationException;
|
import javax.xml.transform.TransformerConfigurationException;
|
||||||
import javax.xml.transform.TransformerException;
|
import javax.xml.transform.TransformerException;
|
||||||
|
@ -64,7 +63,7 @@ public class RefreshScopeManager {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private TreeMap<IProject, Set<IResource>> fProjectToResourcesMap;
|
private TreeMap<IProject, LinkedHashSet<IResource>> fProjectToResourcesMap;
|
||||||
private TreeMap<IResource, List<RefreshExclusion>> fResourceToExclusionsMap;
|
private TreeMap<IResource, List<RefreshExclusion>> fResourceToExclusionsMap;
|
||||||
|
|
||||||
private static RefreshScopeManager fInstance;
|
private static RefreshScopeManager fInstance;
|
||||||
|
@ -89,12 +88,8 @@ public class RefreshScopeManager {
|
||||||
* @param project
|
* @param project
|
||||||
* @return Set<IResource>
|
* @return Set<IResource>
|
||||||
*/
|
*/
|
||||||
public Set<IResource> getResourcesToRefresh(IProject project) {
|
public List<IResource> getResourcesToRefresh(IProject project) {
|
||||||
Set<IResource> retval = fProjectToResourcesMap.get(project);
|
List<IResource> retval = new LinkedList<IResource>(fProjectToResourcesMap.get(project));
|
||||||
|
|
||||||
if(retval == null) {
|
|
||||||
return Collections.emptySet();
|
|
||||||
}
|
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue