1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Changes to the ICElementDelta fields to reflect the doc.

This commit is contained in:
Alain Magloire 2004-02-26 17:30:18 +00:00
parent 2e497d6a54
commit 8609c455a2
5 changed files with 65 additions and 72 deletions

View file

@ -1,3 +1,13 @@
2004-02-26 Alain Magloire
To catch with the documentation change to ICElementDelta
field flags
* model/org/eclipse/cdt/core/model/ICElementDelta.java
* model/org/eclipse/cdt/internal/core/model/CElementDelta.java
* model/org/eclipse/cdt/internal/core/model/CProject.java
* model/org/eclipse/cdt/internal/core/model/PathEntryManager.java
2004-02-25 Alain Magloire
Path from Chris Wiebe to deal with PR 52128

View file

@ -96,54 +96,38 @@ public interface ICElementDelta {
public int F_CLOSED = 0x0080;
/**
* A pathEntry Source changed for this resource.
* A source entry added for this resource.
*/
public int F_ADDED_PATHENTRY_SOURCE = 0x0100;
/**
* A pathEntry Macro was added for this resource.
* A source entry was remove for this resource.
*/
public int F_ADDED_PATHENTRY_MACRO = 0x0200;
public int F_REMOVED_PATHENTRY_SOURCE = 0x0200;
/**
* A pathEntry Include was added for this resourc.
* A pathEntry Macro was added for this resource
*/
public int F_ADDED_PATHENTRY_INCLUDE = 0x0400;
public int F_CHANGED_PATHENTRY_MACRO = 0x0400;
/**
* A pathEntry Library was added for this resourc.
* A pathEntry Include was added for this resource
*/
public int F_ADDED_PATHENTRY_LIBRARY = 0x0800;
public int F_CHANGED_PATHENTRY_INCLUDE = 0x0800;
/**
* A pathEntry Library was added for this resource
*/
public int F_ADDED_PATHENTRY_LIBRARY = 0x01000;
/**
* A pathEntry Library was added for this resource
*/
public int F_REMOVED_PATHENTRY_LIBRARY = 0x02000;
/**
* A pathEntry Project was added to the project.
*/
public int F_ADDED_PATHENTRY_PROJECT = 0x01000;
/**
* A pathEtnry Source was remove for this resource.
*/
public int F_REMOVED_PATHENTRY_SOURCE = 0x02000;
/**
* A pathEtnry Macro was remove for this resource.
*/
public int F_REMOVED_PATHENTRY_MACRO = 0x04000;
/**
* A pathEtnry Include was remove for this resource.
*/
public int F_REMOVED_PATHENTRY_INCLUDE = 0x08000;
/**
* A pathEtnry Library was remove for this resource.
*/
public int F_REMOVED_PATHENTRY_LIBRARY = 0x010000;
/**
* A pathEtnry Project was remove for this resource.
*/
public int F_REMOVED_PATHENTRY_PROJECT = 0x020000;
public int F_CHANGED_PATHENTRY_PROJECT = 0x04000;
//public int F_PATHENTRY_REORDER = 0x040000;
//public int F_SUPER_TYPES = 0x080000;

View file

@ -670,16 +670,16 @@ public class CElementDelta implements ICElementDelta {
buffer.append("MODIFIERS CHANGED"); //$NON-NLS-1$
prev = true;
}
if ((changeFlags & ICElementDelta.F_ADDED_PATHENTRY_INCLUDE) != 0) {
if ((changeFlags & ICElementDelta.F_CHANGED_PATHENTRY_INCLUDE) != 0) {
if (prev)
buffer.append(" | "); //$NON-NLS-1$
buffer.append("ADDED TO PATHENTRY INCLUDE"); //$NON-NLS-1$
buffer.append("CHANGED TO PATHENTRY INCLUDE"); //$NON-NLS-1$
prev = true;
}
if ((changeFlags & ICElementDelta.F_ADDED_PATHENTRY_MACRO) != 0) {
if ((changeFlags & ICElementDelta.F_CHANGED_PATHENTRY_MACRO) != 0) {
if (prev)
buffer.append(" | "); //$NON-NLS-1$
buffer.append("ADDED TO PATHENTRY MACRO"); //$NON-NLS-1$
buffer.append("CHANGED TO PATHENTRY MACRO"); //$NON-NLS-1$
prev = true;
}
if ((changeFlags & ICElementDelta.F_ADDED_PATHENTRY_LIBRARY) != 0) {
@ -688,22 +688,10 @@ public class CElementDelta implements ICElementDelta {
buffer.append("ADDED TO PATHENTRY LIBRARY"); //$NON-NLS-1$
prev = true;
}
if ((changeFlags & ICElementDelta.F_REMOVED_PATHENTRY_INCLUDE) != 0) {
if (prev)
buffer.append(" | "); //$NON-NLS-1$
buffer.append("REMOVED FROM PATHENTRY INCLUDE"); //$NON-NLS-1$
prev = true;
}
if ((changeFlags & ICElementDelta.F_REMOVED_PATHENTRY_MACRO) != 0) {
if (prev)
buffer.append(" | "); //$NON-NLS-1$
buffer.append("REMOVED FROM PATHENTRY MACRO"); //$NON-NLS-1$
prev = true;
}
if ((changeFlags & ICElementDelta.F_REMOVED_PATHENTRY_LIBRARY) != 0) {
if (prev)
buffer.append(" | "); //$NON-NLS-1$
buffer.append("REMOVED FROM PATHENTRY LIBRARY"); //$NON-NLS-1$
buffer.append("ADDED TO PATHENTRY LIBRARY"); //$NON-NLS-1$
prev = true;
}

View file

@ -101,20 +101,7 @@ public class CProject extends CContainer implements ICProject {
for (int i = 0; i < entries.length; i++) {
if (entries[i].getEntryKind() == IPathEntry.CDT_LIBRARY) {
ILibraryEntry entry = (ILibraryEntry) entries[i];
ILibraryReference lib = null;
if (binParser != null) {
IBinaryFile bin;
try {
bin = binParser.getBinary(entry.getPath());
if (bin.getType() == IBinaryFile.ARCHIVE) {
lib = new LibraryReferenceArchive(this, entry, (IBinaryArchive)bin);
} else {
lib = new LibraryReferenceShared(this, entry, bin);
}
} catch (IOException e1) {
lib = new LibraryReference(this, entry);
}
}
ILibraryReference lib = getLibraryReference(this, binParser, entry);
if (lib != null) {
list.add(lib);
}
@ -123,6 +110,32 @@ public class CProject extends CContainer implements ICProject {
return (ILibraryReference[]) list.toArray(new ILibraryReference[0]);
}
public static ILibraryReference getLibraryReference(ICProject cproject, IBinaryParser binParser, ILibraryEntry entry) {
if (binParser == null) {
try {
binParser = CCorePlugin.getDefault().getBinaryParser(cproject.getProject());
} catch (CoreException e) {
}
}
ILibraryReference lib = null;
if (binParser != null) {
IBinaryFile bin;
try {
bin = binParser.getBinary(entry.getPath());
if (bin.getType() == IBinaryFile.ARCHIVE) {
lib = new LibraryReferenceArchive(cproject, entry, (IBinaryArchive)bin);
} else {
lib = new LibraryReferenceShared(cproject, entry, bin);
}
} catch (IOException e1) {
}
}
if (lib == null) {
lib = new LibraryReference(cproject, entry);
}
return lib;
}
/**
* @see ICProject#getRequiredProjectNames()
*/

View file

@ -472,25 +472,23 @@ public class PathEntryManager {
celement = CoreModel.getDefault().create(path);
flag = (removed) ? ICElementDelta.F_REMOVED_PATHENTRY_SOURCE : ICElementDelta.F_ADDED_PATHENTRY_SOURCE;
} else if (kind == IPathEntry.CDT_LIBRARY) {
//ILibraryEntry lib = (ILibraryEntry) entry;
//IPath path = lib.getLibraryPath();
celement = cproject;
flag = (removed) ? ICElementDelta.F_REMOVED_PATHENTRY_LIBRARY : ICElementDelta.F_ADDED_PATHENTRY_LIBRARY;
ILibraryEntry lib = (ILibraryEntry) entry;
celement = CProject.getLibraryReference(cproject, null,lib);
flag = (removed) ? ICElementDelta.F_ADDED_PATHENTRY_LIBRARY : ICElementDelta.F_REMOVED_PATHENTRY_LIBRARY;
} else if (kind == IPathEntry.CDT_PROJECT) {
//IProjectEntry pentry = (IProjectEntry) entry;
//IPath path = pentry.getProjectPath();
celement = cproject;
flag = (removed) ? ICElementDelta.F_REMOVED_PATHENTRY_PROJECT : ICElementDelta.F_ADDED_PATHENTRY_PROJECT;
flag = ICElementDelta.F_CHANGED_PATHENTRY_PROJECT;
} else if (kind == IPathEntry.CDT_INCLUDE) {
IIncludeEntry include = (IIncludeEntry) entry;
IPath path = include.getPath();
celement = CoreModel.getDefault().create(path);
flag = (removed) ? ICElementDelta.F_REMOVED_PATHENTRY_INCLUDE : ICElementDelta.F_ADDED_PATHENTRY_INCLUDE;
flag = ICElementDelta.F_CHANGED_PATHENTRY_INCLUDE;
} else if (kind == IPathEntry.CDT_MACRO) {
IMacroEntry macro = (IMacroEntry) entry;
IPath path = macro.getPath();
celement = CoreModel.getDefault().create(path);
flag = (removed) ? ICElementDelta.F_REMOVED_PATHENTRY_MACRO : ICElementDelta.F_ADDED_PATHENTRY_MACRO;
flag = ICElementDelta.F_CHANGED_PATHENTRY_MACRO;
} else if (kind == IPathEntry.CDT_CONTAINER) {
//IContainerEntry container = (IContainerEntry) entry;
//celement = cproject;