本文整理汇总了Java中org.eclipse.jdt.core.IJavaElementDelta.CHANGED属性的典型用法代码示例。如果您正苦于以下问题:Java IJavaElementDelta.CHANGED属性的具体用法?Java IJavaElementDelta.CHANGED怎么用?Java IJavaElementDelta.CHANGED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jdt.core.IJavaElementDelta
的用法示例。
在下文中一共展示了IJavaElementDelta.CHANGED属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: collectDeltas
/**
* Collects all the deltas of the changes.
* @param delta the root delta of the change
* @param deltas the collection of the deltas to be collected
*/
private void collectDeltas(IJavaElementDelta delta) {
if (delta.getKind() == IJavaElementDelta.ADDED ||
delta.getKind() == IJavaElementDelta.REMOVED) {
if (!contain(delta)) {
deltas.add(delta);
}
} else if (delta.getKind() == IJavaElementDelta.CHANGED &&
((delta.getFlags() & IJavaElementDelta.F_CONTENT) != 0)) {
if (!contain(delta)) {
deltas.add(delta);
}
}
for (IJavaElementDelta d : delta.getAffectedChildren()) {
collectDeltas(d);
}
}
示例2: collectRemoved
private void collectRemoved(
Set<IAdaptable> potentiallyRemovedSet,
Set<IAdaptable> removedElements,
IJavaElementDelta delta) {
if (delta.getKind() == IJavaElementDelta.REMOVED) removedElements.add(delta.getElement());
else if (delta.getKind() == IJavaElementDelta.CHANGED) {
int flags = delta.getFlags();
if ((flags & REMOVED_FLAGS) != 0) {
potentiallyRemovedSet.add(delta.getElement());
} else {
IJavaElementDelta[] childDeltas = delta.getAffectedChildren();
for (int i = 0; i < childDeltas.length; i++) {
collectRemoved(potentiallyRemovedSet, removedElements, childDeltas[i]);
}
}
}
IResourceDelta[] resourceDeltas = delta.getResourceDeltas();
if (resourceDeltas != null) {
for (int i = 0; i < resourceDeltas.length; i++) {
collectRemovals(removedElements, resourceDeltas[i]);
}
}
}
示例3: addChange
private void addChange(IMember member, IJavaElementDelta newDelta) throws JavaModelException {
int newKind = newDelta.getKind();
switch (newKind) {
case IJavaElementDelta.ADDED:
ArrayList allTypes = new ArrayList();
getAllTypesFromElement(member, allTypes);
for (int i = 0, length = allTypes.size(); i < length; i++) {
IType innerType = (IType)allTypes.get(i);
addTypeAddition(innerType, (SimpleDelta)this.changes.get(innerType));
}
break;
case IJavaElementDelta.REMOVED:
allTypes = new ArrayList();
getAllTypesFromHierarchy((JavaElement)member, allTypes);
for (int i = 0, length = allTypes.size(); i < length; i++) {
IType type = (IType)allTypes.get(i);
addTypeRemoval(type, (SimpleDelta)this.changes.get(type));
}
break;
case IJavaElementDelta.CHANGED:
addAffectedChildren(newDelta);
break;
}
}
示例4: isClassPathChange
/**
* Tests if the a Java element delta contains a class path change
*
* @param delta the Java element delta
* @return returns <code>true</code> if the delta contains a class path change
*/
protected boolean isClassPathChange(IJavaElementDelta delta) {
// need to test the flags only for package fragment roots
if (delta.getElement().getElementType() != IJavaElement.PACKAGE_FRAGMENT_ROOT) return false;
int flags = delta.getFlags();
return (delta.getKind() == IJavaElementDelta.CHANGED
&& ((flags & IJavaElementDelta.F_ADDED_TO_CLASSPATH) != 0)
|| ((flags & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) != 0)
|| ((flags & IJavaElementDelta.F_REORDER) != 0));
}
示例5: processDelta
public void processDelta(IJavaElementDelta delta, int eventType) {
switch (delta.getKind()) {
case IJavaElementDelta.CHANGED:
IJavaElementDelta[] children = delta.getAffectedChildren();
for (int i = 0, length = children.length; i < length; i++) {
IJavaElementDelta child = children[i];
processDelta(child, eventType);
}
break;
case IJavaElementDelta.REMOVED:
IJavaElement element = delta.getElement();
if (this.encloses(element)) {
if (this.elements != null) {
this.elements.remove(element);
}
String path = null;
switch (element.getElementType()) {
case IJavaElement.JAVA_PROJECT:
path = ((IJavaProject) element).getProject().getFullPath().toString();
break;
case IJavaElement.PACKAGE_FRAGMENT_ROOT:
path = ((IPackageFragmentRoot) element).getPath().toString();
break;
default:
return;
}
for (int i = 0; i < this.pathsCount; i++) {
if (this.relativePaths[i].equals(path)) {
this.relativePaths[i] = null;
rehash();
break;
}
}
}
break;
}
}
示例6: isClassPathChange
/**
* Tests if the a Java element delta contains a class path change
*
* @param delta the Java element delta
* @return returns <code>true</code> if the delta contains a class path change
*/
protected boolean isClassPathChange(IJavaElementDelta delta) {
// need to test the flags only for package fragment roots
if (delta.getElement().getElementType() != IJavaElement.PACKAGE_FRAGMENT_ROOT)
return false;
int flags= delta.getFlags();
return (delta.getKind() == IJavaElementDelta.CHANGED &&
((flags & IJavaElementDelta.F_ADDED_TO_CLASSPATH) != 0) ||
((flags & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) != 0) ||
((flags & IJavaElementDelta.F_REORDER) != 0));
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:18,代码来源:StandardJavaElementContentProvider.java
示例7: processDelta
@Override
protected void processDelta(IJavaElementDelta delta, List<IJavaElement> result) {
IJavaElement elem= delta.getElement();
boolean isChanged= delta.getKind() == IJavaElementDelta.CHANGED;
boolean isRemoved= delta.getKind() == IJavaElementDelta.REMOVED;
int flags= delta.getFlags();
switch (elem.getElementType()) {
case IJavaElement.JAVA_MODEL:
processChildrenDelta(delta, result);
return;
case IJavaElement.JAVA_PROJECT:
if (isRemoved || (isChanged &&
(flags & IJavaElementDelta.F_CLOSED) != 0)) {
return;
}
processChildrenDelta(delta, result);
return;
case IJavaElement.PACKAGE_FRAGMENT_ROOT:
if (isRemoved) {
return;
}
try {
if ((((flags & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) != 0) ||
((flags & IJavaElementDelta.F_ADDED_TO_CLASSPATH) != 0))
&& ((IPackageFragmentRoot)elem).getKind() != IPackageFragmentRoot.K_SOURCE) {
result.add(elem);
}
} catch (JavaModelException e) {
// don't update
}
return;
default:
return;
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:37,代码来源:BuildpathIndicatorLabelDecorator.java
示例8: isPossibleStructuralChange
private boolean isPossibleStructuralChange(IJavaElementDelta cuDelta) {
if (cuDelta.getKind() != IJavaElementDelta.CHANGED) {
return true; // add or remove
}
int flags= cuDelta.getFlags();
if ((flags & IJavaElementDelta.F_CHILDREN) != 0) {
return true;
}
return (flags & (IJavaElementDelta.F_CONTENT | IJavaElementDelta.F_FINE_GRAINED)) == IJavaElementDelta.F_CONTENT;
}
示例9: isClassPathChange
protected boolean isClassPathChange(IJavaElementDelta delta) {
// need to test the flags only for package fragment roots
if (delta.getElement().getElementType() != IJavaElement.PACKAGE_FRAGMENT_ROOT)
return false;
int flags= delta.getFlags();
return (delta.getKind() == IJavaElementDelta.CHANGED &&
((flags & IJavaElementDelta.F_ADDED_TO_CLASSPATH) != 0) ||
((flags & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) != 0) ||
((flags & IJavaElementDelta.F_REORDER) != 0));
}
示例10: processJavaDelta
private void processJavaDelta(WorkingSetDelta result, IJavaElementDelta delta) {
IJavaElement jElement= delta.getElement();
int index= result.indexOf(jElement);
int type= jElement.getElementType();
int kind= delta.getKind();
int flags= delta.getFlags();
if (type == IJavaElement.JAVA_PROJECT && kind == IJavaElementDelta.CHANGED) {
if (index != -1 && (flags & IJavaElementDelta.F_CLOSED) != 0) {
result.set(index, ((IJavaProject)jElement).getProject());
} else if ((flags & IJavaElementDelta.F_OPENED) != 0) {
index= result.indexOf(((IJavaProject)jElement).getProject());
if (index != -1)
result.set(index, jElement);
}
}
if (index != -1) {
if (kind == IJavaElementDelta.REMOVED) {
if ((flags & IJavaElementDelta.F_MOVED_TO) != 0) {
result.set(index, delta.getMovedToElement());
} else {
result.remove(index);
}
}
}
IResourceDelta[] resourceDeltas= delta.getResourceDeltas();
if (resourceDeltas != null) {
for (int i= 0; i < resourceDeltas.length; i++) {
processResourceDelta(result, resourceDeltas[i]);
}
}
IJavaElementDelta[] children= delta.getAffectedChildren();
for (int i= 0; i < children.length; i++) {
processJavaDelta(result, children[i]);
}
}
示例11: onlyChildrenChanged
private boolean onlyChildrenChanged(IJavaElementDelta delta) {
if (delta.getKind() != IJavaElementDelta.CHANGED)
return false;
return (delta.getFlags() & ~IJavaElementDelta.F_FINE_GRAINED) == IJavaElementDelta.F_CHILDREN;
}
示例12: isStructuralChange
private boolean isStructuralChange(IJavaElementDelta delta) {
if (delta.getKind() != IJavaElementDelta.CHANGED)
return true;
return (delta.getFlags() & IJavaElementDelta.F_CONTENT | IJavaElementDelta.F_FINE_GRAINED) == IJavaElementDelta.F_CONTENT;
}
示例13: addTypeChange
private void addTypeChange(IType type, int newFlags, SimpleDelta existingDelta) throws JavaModelException {
if (existingDelta != null) {
switch (existingDelta.getKind()) {
case IJavaElementDelta.CHANGED:
// CHANGED then CHANGED
int existingFlags = existingDelta.getFlags();
boolean hasChange = false;
if ((existingFlags & IJavaElementDelta.F_SUPER_TYPES) != 0
&& hasSuperTypeChange(type)) {
existingDelta.superTypes();
hasChange = true;
}
if ((existingFlags & IJavaElementDelta.F_MODIFIERS) != 0
&& hasVisibilityChange(type)) {
existingDelta.modifiers();
hasChange = true;
}
if (!hasChange) {
// super types and visibility are back to the ones in the existing hierarchy
this.changes.remove(type);
}
break;
// ADDED then CHANGED: leave it as ADDED
// REMOVED then CHANGED: should not happen
}
} else {
// check whether the type change affects the hierarchy
SimpleDelta typeDelta = null;
if ((newFlags & IJavaElementDelta.F_SUPER_TYPES) != 0
&& this.hierarchy.includesTypeOrSupertype(type)) {
typeDelta = new SimpleDelta();
typeDelta.superTypes();
}
if ((newFlags & IJavaElementDelta.F_MODIFIERS) != 0
&& (this.hierarchy.hasSupertype(type.getElementName())
|| type.equals(this.hierarchy.focusType))) {
if (typeDelta == null) {
typeDelta = new SimpleDelta();
}
typeDelta.modifiers();
}
if (typeDelta != null) {
this.changes.put(type, typeDelta);
}
}
}
示例14: processDelta
@Override
protected void processDelta(IJavaElementDelta delta, List<IJavaElement> result) {
IJavaElement elem= delta.getElement();
boolean isChanged= delta.getKind() == IJavaElementDelta.CHANGED;
boolean isRemoved= delta.getKind() == IJavaElementDelta.REMOVED;
int flags= delta.getFlags();
switch (elem.getElementType()) {
case IJavaElement.JAVA_PROJECT:
if (isRemoved || (isChanged &&
(flags & IJavaElementDelta.F_CLOSED) != 0)) {
return;
}
processChildrenDelta(delta, result);
return;
case IJavaElement.PACKAGE_FRAGMENT_ROOT:
if (isRemoved || (isChanged && (
(flags & IJavaElementDelta.F_ARCHIVE_CONTENT_CHANGED) != 0 ||
(flags & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) != 0))) {
return;
}
processChildrenDelta(delta, result);
return;
case IJavaElement.PACKAGE_FRAGMENT:
if (isRemoved)
return;
processChildrenDelta(delta, result);
return;
case IJavaElement.TYPE:
case IJavaElement.CLASS_FILE:
return;
case IJavaElement.JAVA_MODEL:
processChildrenDelta(delta, result);
return;
case IJavaElement.COMPILATION_UNIT:
// Not the primary compilation unit. Ignore it
if (!JavaModelUtil.isPrimary((ICompilationUnit) elem)) {
return;
}
if (isChanged && ((flags & IJavaElementDelta.F_CONTENT) != 0 || (flags & IJavaElementDelta.F_FINE_GRAINED) != 0)) {
if (delta.getAffectedChildren().length == 0)
return;
result.add(elem);
}
return;
default:
// fields, methods, imports ect
return;
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:53,代码来源:InterfaceIndicatorLabelDecorator.java
示例15: processDelta
/**
* Computes whether the history needs a consistency check or not.
*
* @param delta the Java element delta
*
* @return <code>true</code> if consistency must be checked
* <code>false</code> otherwise.
*/
private boolean processDelta(IJavaElementDelta delta) {
IJavaElement elem= delta.getElement();
boolean isChanged= delta.getKind() == IJavaElementDelta.CHANGED;
boolean isRemoved= delta.getKind() == IJavaElementDelta.REMOVED;
switch (elem.getElementType()) {
case IJavaElement.JAVA_PROJECT:
if (isRemoved || (isChanged &&
(delta.getFlags() & IJavaElementDelta.F_CLOSED) != 0)) {
return true;
}
return processChildrenDelta(delta);
case IJavaElement.PACKAGE_FRAGMENT_ROOT:
if (isRemoved || (isChanged && (
(delta.getFlags() & IJavaElementDelta.F_ARCHIVE_CONTENT_CHANGED) != 0 ||
(delta.getFlags() & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) != 0))) {
return true;
}
return processChildrenDelta(delta);
case IJavaElement.TYPE:
if (isChanged && (delta.getFlags() & IJavaElementDelta.F_MODIFIERS) != 0) {
return true;
}
if (isRemoved) {
return true;
}
return processChildrenDelta(delta);
case IJavaElement.JAVA_MODEL:
case IJavaElement.PACKAGE_FRAGMENT:
case IJavaElement.CLASS_FILE:
if (isRemoved) {
return true;
}
return processChildrenDelta(delta);
case IJavaElement.COMPILATION_UNIT:
// Not the primary compilation unit. Ignore it
if (!JavaModelUtil.isPrimary((ICompilationUnit) elem)) {
return false;
}
if (isRemoved || (isChanged && isUnknownStructuralChange(delta.getFlags()))) {
return true;
}
return processChildrenDelta(delta);
default:
// fields, methods, imports ect
return false;
}
}