本文整理汇总了Java中org.eclipse.jdt.core.IJavaElementDelta.REMOVED属性的典型用法代码示例。如果您正苦于以下问题:Java IJavaElementDelta.REMOVED属性的具体用法?Java IJavaElementDelta.REMOVED怎么用?Java IJavaElementDelta.REMOVED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jdt.core.IJavaElementDelta
的用法示例。
在下文中一共展示了IJavaElementDelta.REMOVED属性的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: getJavaProjectsWithClasspathChange
private Set<IJavaProject> getJavaProjectsWithClasspathChange(IJavaElementDelta delta) {
IJavaElement element = delta.getElement();
if (element instanceof IPackageFragmentRoot) {
IPackageFragmentRoot root = (IPackageFragmentRoot) element;
if (delta.getKind() == IJavaElementDelta.REMOVED || delta.getKind() == IJavaElementDelta.ADDED
|| (delta.getFlags() & IJavaElementDelta.F_REORDER) != 0
|| (delta.getFlags() & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) != 0
|| (delta.getFlags() & IJavaElementDelta.F_ADDED_TO_CLASSPATH) != 0
|| (root.isExternal() && (delta.getFlags() & // external folders change
(IJavaElementDelta.F_CONTENT | IJavaElementDelta.F_SOURCEATTACHED | IJavaElementDelta.F_SOURCEDETACHED)) == delta
.getFlags())) {
return Collections.singleton(root.getJavaProject());
}
} else if (element instanceof IJavaModel) {
return getPackageFragmentRootDeltas(delta.getAffectedChildren());
} else if (element instanceof IJavaProject) {
if ((delta.getFlags() & IJavaElementDelta.F_CLASSPATH_CHANGED) != 0
|| (delta.getFlags() & IJavaElementDelta.F_RESOLVED_CLASSPATH_CHANGED) != 0)
return Collections.singleton((IJavaProject) element);
return getPackageFragmentRootDeltas(delta.getAffectedChildren());
}
return Collections.emptySet();
}
示例3: isAffectingPackageFragmentRoots
private boolean isAffectingPackageFragmentRoots(IJavaElementDelta delta) {
IJavaElement element = delta.getElement();
if (element instanceof IPackageFragmentRoot) {
if (delta.getKind() == IJavaElementDelta.REMOVED
|| delta.getKind() == IJavaElementDelta.ADDED
|| (delta.getFlags() & IJavaElementDelta.F_REORDER) != 0
|| (delta.getFlags() & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) != 0
|| (delta.getFlags() & IJavaElementDelta.F_ADDED_TO_CLASSPATH) != 0
|| (((IPackageFragmentRoot) element).isExternal() && (delta.getFlags() & // external folders change
(IJavaElementDelta.F_CONTENT
| IJavaElementDelta.F_SOURCEATTACHED
| IJavaElementDelta.F_SOURCEDETACHED)) == delta.getFlags())) {
return true;
}
} else if (element instanceof IJavaModel) {
return isAffectingPackageFragmentRoots(delta.getAffectedChildren());
} else if (element instanceof IJavaProject) {
if ((delta.getFlags() & IJavaElementDelta.F_CLASSPATH_CHANGED) != 0 ||
(delta.getFlags() & IJavaElementDelta.F_RESOLVED_CLASSPATH_CHANGED) != 0)
return true;
return isAffectingPackageFragmentRoots(delta.getAffectedChildren());
}
return false;
}
示例4: 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]);
}
}
}
示例5: 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]);
}
}
}
示例6: 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;
}
}
示例7: toDebugString
protected void toDebugString(StringBuffer buffer) {
buffer.append("["); //$NON-NLS-1$
switch (getKind()) {
case IJavaElementDelta.ADDED :
buffer.append('+');
break;
case IJavaElementDelta.REMOVED :
buffer.append('-');
break;
case IJavaElementDelta.CHANGED :
buffer.append('*');
break;
default :
buffer.append('?');
break;
}
buffer.append("]: {"); //$NON-NLS-1$
toDebugString(buffer, getFlags());
buffer.append("}"); //$NON-NLS-1$
}
示例8: 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;
}
}
示例9: 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
示例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: 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;
}
}
示例12: addChange
private void addChange(IImportContainer importContainer, IJavaElementDelta newDelta) throws JavaModelException {
int newKind = newDelta.getKind();
if (newKind == IJavaElementDelta.CHANGED) {
addAffectedChildren(newDelta);
return;
}
SimpleDelta existingDelta = (SimpleDelta)this.changes.get(importContainer);
if (existingDelta != null) {
switch (newKind) {
case IJavaElementDelta.ADDED:
if (existingDelta.getKind() == IJavaElementDelta.REMOVED) {
// REMOVED then ADDED
this.changes.remove(importContainer);
}
break;
case IJavaElementDelta.REMOVED:
if (existingDelta.getKind() == IJavaElementDelta.ADDED) {
// ADDED then REMOVED
this.changes.remove(importContainer);
}
break;
// CHANGED handled above
}
} else {
SimpleDelta delta = new SimpleDelta();
switch (newKind) {
case IJavaElementDelta.ADDED:
delta.added();
break;
case IJavaElementDelta.REMOVED:
delta.removed();
break;
}
this.changes.put(importContainer, delta);
}
}
示例13: addTypeAddition
private void addTypeAddition(IType type, SimpleDelta existingDelta) throws JavaModelException {
if (existingDelta != null) {
switch (existingDelta.getKind()) {
case IJavaElementDelta.REMOVED:
// REMOVED then ADDED
boolean hasChange = false;
if (hasSuperTypeChange(type)) {
existingDelta.superTypes();
hasChange = true;
}
if (hasVisibilityChange(type)) {
existingDelta.modifiers();
hasChange = true;
}
if (!hasChange) {
this.changes.remove(type);
}
break;
// CHANGED then ADDED
// or ADDED then ADDED: should not happen
}
} else {
// check whether the type addition affects the hierarchy
String typeName = type.getElementName();
if (this.hierarchy.hasSupertype(typeName)
|| this.hierarchy.subtypesIncludeSupertypeOf(type)
|| this.hierarchy.missingTypes.contains(typeName)) {
SimpleDelta delta = new SimpleDelta();
delta.added();
this.changes.put(type, delta);
}
}
}
示例14: deltaKindToString
private String deltaKindToString(int kind) {
if (kind == IJavaElementDelta.ADDED)
return "ADDED";
else if (kind == IJavaElementDelta.CHANGED)
return "CHANGED";
else if (kind == IJavaElementDelta.REMOVED)
return "REMOVED";
throw new IllegalArgumentException("Unknown delta kind");
}
示例15: isClasspathChanged
private boolean isClasspathChanged(IJavaElementDelta delta) {
return delta.getKind() == IJavaElementDelta.REMOVED ||
(0 != (delta.getFlags() & (IJavaElementDelta.F_CLASSPATH_CHANGED | IJavaElementDelta.F_RESOLVED_CLASSPATH_CHANGED)));
}