本文整理汇总了Java中org.eclipse.jdt.core.IJavaElementDelta.getKind方法的典型用法代码示例。如果您正苦于以下问题:Java IJavaElementDelta.getKind方法的具体用法?Java IJavaElementDelta.getKind怎么用?Java IJavaElementDelta.getKind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.core.IJavaElementDelta
的用法示例。
在下文中一共展示了IJavaElementDelta.getKind方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: collectDeltas
import org.eclipse.jdt.core.IJavaElementDelta; //导入方法依赖的package包/类
/**
* 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
import org.eclipse.jdt.core.IJavaElementDelta; //导入方法依赖的package包/类
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
import org.eclipse.jdt.core.IJavaElementDelta; //导入方法依赖的package包/类
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
import org.eclipse.jdt.core.IJavaElementDelta; //导入方法依赖的package包/类
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
import org.eclipse.jdt.core.IJavaElementDelta; //导入方法依赖的package包/类
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
import org.eclipse.jdt.core.IJavaElementDelta; //导入方法依赖的package包/类
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: contain
import org.eclipse.jdt.core.IJavaElementDelta; //导入方法依赖的package包/类
/**
* Tests if a given change delta was already contained in the change collection.
* @param delta the change delta
* @return <code>true</code> if the change delta was contained in the change collection, otherwise <code> false</code>
*/
private boolean contain(IJavaElementDelta delta) {
String path = delta.getElement().getPath().toString();
for (IJavaElementDelta d : deltas) {
String p = d.getElement().getPath().toString();
if (p.compareTo(path) == 0 && d.getKind() == delta.getKind()) {
return true;
}
}
return false;
}
示例8: isClassPathChange
import org.eclipse.jdt.core.IJavaElementDelta; //导入方法依赖的package包/类
/**
* 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));
}
示例9: processDelta
import org.eclipse.jdt.core.IJavaElementDelta; //导入方法依赖的package包/类
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;
}
}
示例10: processJavaDelta
import org.eclipse.jdt.core.IJavaElementDelta; //导入方法依赖的package包/类
private void processJavaDelta(List<IAdaptable> elements, IJavaElementDelta delta) {
IJavaElement jElement= delta.getElement();
int type= jElement.getElementType();
if (type == IJavaElement.JAVA_PROJECT) {
int index= elements.indexOf(jElement);
int kind= delta.getKind();
int flags= delta.getFlags();
if (kind == IJavaElementDelta.CHANGED) {
if (index != -1 && (flags & IJavaElementDelta.F_CLOSED) != 0) {
elements.set(index, ((IJavaProject)jElement).getProject());
fWorkingSet.setElements(elements.toArray(new IAdaptable[elements.size()]));
} else if ((flags & IJavaElementDelta.F_OPENED) != 0) {
index= elements.indexOf(((IJavaProject)jElement).getProject());
if (index != -1) {
elements.set(index, jElement);
fWorkingSet.setElements(elements.toArray(new IAdaptable[elements.size()]));
}
}
}
// don't visit below projects
return;
}
IJavaElementDelta[] children= delta.getAffectedChildren();
for (int i= 0; i < children.length; i++) {
processJavaDelta(elements, children[i]);
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:28,代码来源:OthersWorkingSetUpdater.java
示例11: isPossibleStructuralChange
import org.eclipse.jdt.core.IJavaElementDelta; //导入方法依赖的package包/类
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;
}
示例12: isClassPathChange
import org.eclipse.jdt.core.IJavaElementDelta; //导入方法依赖的package包/类
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-Juno38,代码行数:13,代码来源:LogicalPackagesProvider.java
示例13: processDelta
import org.eclipse.jdt.core.IJavaElementDelta; //导入方法依赖的package包/类
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;
}
}
示例14: isClassPathChange
import org.eclipse.jdt.core.IJavaElementDelta; //导入方法依赖的package包/类
/**
* 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-Juno38,代码行数:19,代码来源:StandardJavaElementContentProvider.java
示例15: isClasspathChanged
import org.eclipse.jdt.core.IJavaElementDelta; //导入方法依赖的package包/类
private boolean isClasspathChanged(IJavaElementDelta delta) {
return delta.getKind() == IJavaElementDelta.REMOVED ||
(0 != (delta.getFlags() & (IJavaElementDelta.F_CLASSPATH_CHANGED | IJavaElementDelta.F_RESOLVED_CLASSPATH_CHANGED)));
}