本文整理汇总了Java中org.eclipse.jdt.core.IJavaElementDelta.F_MODIFIERS属性的典型用法代码示例。如果您正苦于以下问题:Java IJavaElementDelta.F_MODIFIERS属性的具体用法?Java IJavaElementDelta.F_MODIFIERS怎么用?Java IJavaElementDelta.F_MODIFIERS使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jdt.core.IJavaElementDelta
的用法示例。
在下文中一共展示了IJavaElementDelta.F_MODIFIERS属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toDebugString
protected boolean toDebugString(StringBuffer buffer, int flags) {
boolean prev = false;
if ((flags & IJavaElementDelta.F_MODIFIERS) != 0) {
if (prev)
buffer.append(" | "); //$NON-NLS-1$
buffer.append("MODIFIERS CHANGED"); //$NON-NLS-1$
prev = true;
}
if ((flags & IJavaElementDelta.F_SUPER_TYPES) != 0) {
if (prev)
buffer.append(" | "); //$NON-NLS-1$
buffer.append("SUPER TYPES CHANGED"); //$NON-NLS-1$
prev = true;
}
return prev;
}
示例2: processDelta
/**
* Computes whether the history needs a consistency check or not.
*
* @param delta the Java element delta
*
* @return <code>true</code> if consistency must be checked
* <code>false</code> otherwise.
*/
private boolean processDelta(IJavaElementDelta delta) {
IJavaElement elem= delta.getElement();
boolean isChanged= delta.getKind() == IJavaElementDelta.CHANGED;
boolean isRemoved= delta.getKind() == IJavaElementDelta.REMOVED;
switch (elem.getElementType()) {
case IJavaElement.JAVA_PROJECT:
if (isRemoved || (isChanged &&
(delta.getFlags() & IJavaElementDelta.F_CLOSED) != 0)) {
return true;
}
return processChildrenDelta(delta);
case IJavaElement.PACKAGE_FRAGMENT_ROOT:
if (isRemoved || (isChanged && (
(delta.getFlags() & IJavaElementDelta.F_ARCHIVE_CONTENT_CHANGED) != 0 ||
(delta.getFlags() & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) != 0))) {
return true;
}
return processChildrenDelta(delta);
case IJavaElement.TYPE:
if (isChanged && (delta.getFlags() & IJavaElementDelta.F_MODIFIERS) != 0) {
return true;
}
if (isRemoved) {
return true;
}
return processChildrenDelta(delta);
case IJavaElement.JAVA_MODEL:
case IJavaElement.PACKAGE_FRAGMENT:
case IJavaElement.CLASS_FILE:
if (isRemoved) {
return true;
}
return processChildrenDelta(delta);
case IJavaElement.COMPILATION_UNIT:
// Not the primary compilation unit. Ignore it
if (!JavaModelUtil.isPrimary((ICompilationUnit) elem)) {
return false;
}
if (isRemoved || (isChanged && isUnknownStructuralChange(delta.getFlags()))) {
return true;
}
return processChildrenDelta(delta);
default:
// fields, methods, imports ect
return false;
}
}
示例3: addTypeChange
private void addTypeChange(IType type, int newFlags, SimpleDelta existingDelta) throws JavaModelException {
if (existingDelta != null) {
switch (existingDelta.getKind()) {
case IJavaElementDelta.CHANGED:
// CHANGED then CHANGED
int existingFlags = existingDelta.getFlags();
boolean hasChange = false;
if ((existingFlags & IJavaElementDelta.F_SUPER_TYPES) != 0
&& hasSuperTypeChange(type)) {
existingDelta.superTypes();
hasChange = true;
}
if ((existingFlags & IJavaElementDelta.F_MODIFIERS) != 0
&& hasVisibilityChange(type)) {
existingDelta.modifiers();
hasChange = true;
}
if (!hasChange) {
// super types and visibility are back to the ones in the existing hierarchy
this.changes.remove(type);
}
break;
// ADDED then CHANGED: leave it as ADDED
// REMOVED then CHANGED: should not happen
}
} else {
// check whether the type change affects the hierarchy
SimpleDelta typeDelta = null;
if ((newFlags & IJavaElementDelta.F_SUPER_TYPES) != 0
&& this.hierarchy.includesTypeOrSupertype(type)) {
typeDelta = new SimpleDelta();
typeDelta.superTypes();
}
if ((newFlags & IJavaElementDelta.F_MODIFIERS) != 0
&& (this.hierarchy.hasSupertype(type.getElementName())
|| type.equals(this.hierarchy.focusType))) {
if (typeDelta == null) {
typeDelta = new SimpleDelta();
}
typeDelta.modifiers();
}
if (typeDelta != null) {
this.changes.put(type, typeDelta);
}
}
}