本文整理汇总了Java中org.eclipse.jdt.core.IJavaElementDelta.F_CONTENT属性的典型用法代码示例。如果您正苦于以下问题:Java IJavaElementDelta.F_CONTENT属性的具体用法?Java IJavaElementDelta.F_CONTENT怎么用?Java IJavaElementDelta.F_CONTENT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jdt.core.IJavaElementDelta
的用法示例。
在下文中一共展示了IJavaElementDelta.F_CONTENT属性的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: createResourceChangedMacro
/**
* Creates a macro corresponding to the changed delta of the change.
* @param time the time when the change occurred
* @param delta the changed delta of the change
* @return the created resource macro
*/
private ResourceMacro createResourceChangedMacro(long time, IJavaElementDelta delta) {
IJavaElement elem = delta.getElement();
String path = elem.getPath().toString();
if (path == null) {
return null;
}
if ((delta.getFlags() & IJavaElementDelta.F_CONTENT) != 0) {
// System.out.println("CONTENT CHANGED" + path);
return null;
}
return new ResourceMacro(time, "Changed", path, elem);
}
示例5: contentChanged
private void contentChanged(Openable element) {
boolean isPrimary = false;
boolean isPrimaryWorkingCopy = false;
if (element.getElementType() == IJavaElement.COMPILATION_UNIT) {
CompilationUnit cu = (CompilationUnit) element;
isPrimary = cu.isPrimary();
isPrimaryWorkingCopy = isPrimary && cu.isWorkingCopy();
}
if (isPrimaryWorkingCopy) {
// filter out changes to primary compilation unit in working copy mode
// just report a change to the resource (see
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=59500)
currentDelta().changed(element, IJavaElementDelta.F_PRIMARY_RESOURCE);
} else {
close(element);
int flags = IJavaElementDelta.F_CONTENT;
if (element instanceof JarPackageFragmentRoot) {
flags |= IJavaElementDelta.F_ARCHIVE_CONTENT_CHANGED;
// need also to reset project cache otherwise it will be out-of-date
// see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=162621
this.projectCachesToReset.add(element.getJavaProject());
}
if (isPrimary) {
flags |= IJavaElementDelta.F_PRIMARY_RESOURCE;
}
currentDelta().changed(element, flags);
}
}
示例6: elementChanged
public void elementChanged(ElementChangedEvent e) {
IJavaElementDelta delta= findElement(fInput, e.getDelta());
if (delta != null && (delta.getFlags() & (IJavaElementDelta.F_CONTENT | IJavaElementDelta.F_CHILDREN)) != 0) {
if (shouldIgnoreDelta(e.getDelta().getCompilationUnitAST(), delta))
return;
fUpdatingCount++;
try {
update(createContext(false));
} finally {
fUpdatingCount--;
}
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:15,代码来源:DefaultJavaFoldingStructureProvider.java
示例7: 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;
}
示例8: isUnknownStructuralChange
private boolean isUnknownStructuralChange(int flags) {
if ((flags & IJavaElementDelta.F_CONTENT) == 0)
return false;
return (flags & IJavaElementDelta.F_FINE_GRAINED) == 0;
}
示例9: isStructuralCUChange
private static boolean isStructuralCUChange(int flags) {
// No refresh on working copy creation (F_PRIMARY_WORKING_COPY)
return (flags & IJavaElementDelta.F_CHILDREN) != 0 || (flags & (IJavaElementDelta.F_CONTENT | IJavaElementDelta.F_FINE_GRAINED)) == IJavaElementDelta.F_CONTENT;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:4,代码来源:PackageExplorerContentProvider.java
示例10: 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;
}
示例11: isPossibleStructuralChange
private boolean isPossibleStructuralChange(int flags) {
return (flags & (IJavaElementDelta.F_CONTENT | IJavaElementDelta.F_FINE_GRAINED)) == IJavaElementDelta.F_CONTENT;
}
示例12: 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
示例13: isContentChanged
private boolean isContentChanged(IJavaElementDelta delta)
{
return delta.getKind() == IJavaElementDelta.CHANGED && (delta.getFlags() & IJavaElementDelta.F_CONTENT) != 0;
}
示例14: isContentChange
/**
* Test whether the given delta represents a significant change.
*
* @param cuDelta the Java element delta
* @return <code>true</code> if the delta represents a content change
* @since 3.5
*/
private boolean isContentChange(IJavaElementDelta cuDelta) {
int flags= cuDelta.getFlags();
return flags != IJavaElementDelta.F_AST_AFFECTED && (cuDelta.getKind() == IJavaElementDelta.CHANGED || (flags & IJavaElementDelta.F_CONTENT) != 0);
}