本文整理汇总了Java中org.eclipse.jdt.core.IJavaElementDelta.F_SOURCEDETACHED属性的典型用法代码示例。如果您正苦于以下问题:Java IJavaElementDelta.F_SOURCEDETACHED属性的具体用法?Java IJavaElementDelta.F_SOURCEDETACHED怎么用?Java IJavaElementDelta.F_SOURCEDETACHED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jdt.core.IJavaElementDelta
的用法示例。
在下文中一共展示了IJavaElementDelta.F_SOURCEDETACHED属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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;
}
示例3: addClasspathDeltas
private void addClasspathDeltas(JavaElementDelta delta, IPackageFragmentRoot[] roots, int flag) {
for (int i = 0; i < roots.length; i++) {
IPackageFragmentRoot root = roots[i];
delta.changed(root, flag);
if ((flag & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) != 0
|| (flag & IJavaElementDelta.F_SOURCEATTACHED) != 0
|| (flag & IJavaElementDelta.F_SOURCEDETACHED) != 0){
try {
root.close();
} catch (JavaModelException e) {
// ignore
}
}
}
}
示例4: getSourceAttachmentDeltaFlag
private int getSourceAttachmentDeltaFlag(IPath oldPath, IPath newPath) {
if (oldPath == null) {
if (newPath != null) {
return IJavaElementDelta.F_SOURCEATTACHED;
} else {
return 0;
}
} else if (newPath == null) {
return IJavaElementDelta.F_SOURCEDETACHED;
} else if (!oldPath.equals(newPath)) {
return IJavaElementDelta.F_SOURCEATTACHED | IJavaElementDelta.F_SOURCEDETACHED;
} else {
return 0;
}
}
示例5: check
/**
* Recursively check whether the class file has been deleted.
*
* @param input the package fragment root
* @param delta the Java element delta
* @return <code>true</code> if delta processing can be stopped
*/
protected boolean check(IPackageFragmentRoot input, IJavaElementDelta delta) {
IJavaElement element= delta.getElement();
if ((delta.getKind() & IJavaElementDelta.REMOVED) != 0 || (delta.getFlags() & IJavaElementDelta.F_CLOSED) != 0) {
// http://dev.eclipse.org/bugs/show_bug.cgi?id=19023
if (element.equals(input.getJavaProject()) || element.equals(input)) {
handleDeleted(fInput);
return true;
}
}
if (((delta.getFlags() & IJavaElementDelta.F_ARCHIVE_CONTENT_CHANGED) != 0) && input.equals(element)) {
handleDeleted(fInput);
return true;
}
if (((delta.getFlags() & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) != 0) && input.equals(element)) {
handleDeleted(fInput);
return true;
}
IJavaElementDelta[] subdeltas= delta.getAffectedChildren();
for (int i= 0; i < subdeltas.length; i++) {
if (check(input, subdeltas[i]))
return true;
}
if ((delta.getFlags() & IJavaElementDelta.F_SOURCEDETACHED) != 0 ||
(delta.getFlags() & IJavaElementDelta.F_SOURCEATTACHED) != 0)
{
IClassFile file= fInput != null ? fInput.getClassFile() : null;
IJavaProject project= input != null ? input.getJavaProject() : null;
boolean isOnClasspath= false;
if (file != null && project != null)
isOnClasspath= project.isOnClasspath(file);
if (isOnClasspath) {
fireInputChanged(fInput);
return false;
} else {
handleDeleted(fInput);
return true;
}
}
return false;
}