本文整理汇总了Java中org.eclipse.jdt.core.IJavaElementDelta.getFlags方法的典型用法代码示例。如果您正苦于以下问题:Java IJavaElementDelta.getFlags方法的具体用法?Java IJavaElementDelta.getFlags怎么用?Java IJavaElementDelta.getFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.core.IJavaElementDelta
的用法示例。
在下文中一共展示了IJavaElementDelta.getFlags方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createResourceRemovedMacro
import org.eclipse.jdt.core.IJavaElementDelta; //导入方法依赖的package包/类
/**
* Creates a macro corresponding to the removed delta of the change.
* @param time the time when the change occurred
* @param delta the removed delta of the change
* @return the created resource macro
*/
private ResourceMacro createResourceRemovedMacro(long time, IJavaElementDelta delta) {
IJavaElement elem = delta.getElement();
String path = elem.getPath().toString();
if (path == null) {
return null;
}
String type = "Removed";
if ((delta.getFlags() & IJavaElementDelta.F_MOVED_TO) != 0) {
if (isRenamed(delta.getElement(), delta.getMovedToElement())) {
type = "RenamedTo";
} else {
type = "MovedTo";
}
}
return new ResourceMacro(time, type, path, elem);
}
示例2: createResourceAddedMacro
import org.eclipse.jdt.core.IJavaElementDelta; //导入方法依赖的package包/类
/**
* Creates a macro corresponding to the added delta of the change.
* @param time the time when the change occurred
* @param delta the added delta of the change
* @return the created resource macro
*/
private ResourceMacro createResourceAddedMacro(long time, IJavaElementDelta delta) {
IJavaElement elem = delta.getElement();
String path = elem.getPath().toString();
if (path == null) {
return null;
}
String type = "Added";
if ((delta.getFlags() & IJavaElementDelta.F_MOVED_FROM) != 0) {
if (isRenamed(delta.getElement(), delta.getMovedFromElement())) {
type = "RenamedFrom";
} else {
type = "MovedFrom";
}
}
return new ResourceMacro(time, type, path, elem);
}
示例3: 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);
}
}
示例4: 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();
}
示例5: 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;
}
示例6: 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]);
}
}
}
示例7: addReconcileDelta
import org.eclipse.jdt.core.IJavaElementDelta; //导入方法依赖的package包/类
protected void addReconcileDelta(ICompilationUnit workingCopy, IJavaElementDelta delta) {
HashMap reconcileDeltas =
JavaModelManager.getJavaModelManager().getDeltaProcessor().reconcileDeltas;
org.eclipse.jdt.internal.core.JavaElementDelta previousDelta =
(org.eclipse.jdt.internal.core.JavaElementDelta) reconcileDeltas.get(workingCopy);
if (previousDelta != null) {
IJavaElementDelta[] children = delta.getAffectedChildren();
for (int i = 0, length = children.length; i < length; i++) {
org.eclipse.jdt.internal.core.JavaElementDelta child =
(org.eclipse.jdt.internal.core.JavaElementDelta) children[i];
previousDelta.insertDeltaTree(child.getElement(), child);
}
// note that the last delta's AST always takes precedence over the existing delta's AST
// since it is the result of the last reconcile operation
if ((delta.getFlags() & IJavaElementDelta.F_AST_AFFECTED) != 0) {
previousDelta.changedAST(delta.getCompilationUnitAST());
}
} else {
reconcileDeltas.put(workingCopy, delta);
}
}
示例8: isClasspathChange
import org.eclipse.jdt.core.IJavaElementDelta; //导入方法依赖的package包/类
/**
* Does the delta indicate a classpath change?
* @param delta the delta to inspect
* @return true if classpath has changed
*/
private boolean isClasspathChange(IJavaElementDelta delta) {
int flags= delta.getFlags();
if (isClasspathChangeFlag(flags))
return true;
if ((flags & IJavaElementDelta.F_CHILDREN) != 0) {
IJavaElementDelta[] children= delta.getAffectedChildren();
for (int i= 0; i < children.length; i++) {
if (isClasspathChangeFlag(children[i].getFlags()))
return true;
}
}
return false;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:21,代码来源:SWTTemplateCompletionProposalComputer.java
示例9: 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]);
}
}
}
示例10: createResourceChangedMacro
import org.eclipse.jdt.core.IJavaElementDelta; //导入方法依赖的package包/类
/**
* 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);
}
示例11: 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));
}
示例12: elementChanged
import org.eclipse.jdt.core.IJavaElementDelta; //导入方法依赖的package包/类
public void elementChanged(ElementChangedEvent event) {
for (IJavaElementDelta delta : event.getDelta().getChangedChildren()) {
int flags = delta.getFlags();
if ((flags & IJavaElementDelta.F_CLASSPATH_CHANGED) != 0) {
IJavaElement element = delta.getElement();
if (element.getElementType() != IJavaElement.JAVA_PROJECT) {
continue;
}
classpathChanged((IJavaProject) element);
}
}
}
示例13: 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,代码行数:19,代码来源:StandardJavaElementContentProvider.java
示例14: elementChanged
import org.eclipse.jdt.core.IJavaElementDelta; //导入方法依赖的package包/类
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,代码行数:16,代码来源:DefaultJavaFoldingStructureProvider.java
示例15: processDelta
import org.eclipse.jdt.core.IJavaElementDelta; //导入方法依赖的package包/类
@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,代码行数:38,代码来源:BuildpathIndicatorLabelDecorator.java