本文整理匯總了Java中org.eclipse.core.resources.IResourceDelta.COPIED_FROM屬性的典型用法代碼示例。如果您正苦於以下問題:Java IResourceDelta.COPIED_FROM屬性的具體用法?Java IResourceDelta.COPIED_FROM怎麽用?Java IResourceDelta.COPIED_FROM使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.eclipse.core.resources.IResourceDelta
的用法示例。
在下文中一共展示了IResourceDelta.COPIED_FROM屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: assertTrue
private static boolean assertTrue(IResourceDelta expected, IResourceDelta actual) {
assertEqual(expected.getResource(), actual.getResource());
int actualKind = actual.getKind();
int actualFlags = actual.getFlags();
// The real delta can't combine kinds so we remove it from the received one as well.
if ((actualKind & (IResourceDelta.ADDED | IResourceDelta.REMOVED)) != 0) {
actualKind = actualKind & ~IResourceDelta.CHANGED;
}
// The expected delta doesn't support copy from flag. So remove it
actualFlags = actualFlags & ~IResourceDelta.COPIED_FROM;
int expectKind = expected.getKind();
int expectedFlags = expected.getFlags() & PRE_DELTA_FLAGS;
if ((expectKind & IResourceDelta.ADDED) != 0
&& (expectedFlags & IResourceDelta.MOVED_FROM) != 0) {
expectedFlags = expectedFlags & ~IResourceDelta.OPEN;
}
if (expectKind != actualKind || expectedFlags != actualFlags) {
return false;
}
IResourceDelta[] expectedChildren = getExpectedChildren(expected);
IResourceDelta[] actualChildren = getActualChildren(actual, expectedChildren);
if (expectedChildren.length != actualChildren.length) {
return false;
}
Arrays.sort(expectedChildren, COMPARATOR);
Arrays.sort(actualChildren, COMPARATOR);
for (int i = 0; i < expectedChildren.length; i++) {
boolean res = assertTrue(expectedChildren[i], actualChildren[i]);
if (!res) {
Assert.assertEquals(printDelta(expected), printDelta(actual));
}
}
return true;
}
示例2: change
public void change(IFile file) {
ProposedResourceDelta delta = getDelta(file);
if (delta.getKind() == 0) delta.setKind(IResourceDelta.CHANGED);
// the CONTENT flag only applies to the changed and moved from cases
if (delta.getKind() == IResourceDelta.CHANGED
|| (delta.getFlags() & IResourceDelta.MOVED_FROM) != 0
|| (delta.getFlags() & IResourceDelta.COPIED_FROM) != 0)
delta.addFlags(IResourceDelta.CONTENT);
}
示例3: handleAdded
private void handleAdded(IResourceDelta delta) {
if ((delta.getFlags() & IResourceDelta.MOVED_FROM) != 0) {
handleMove(delta);
} else if ((delta.getFlags() & IResourceDelta.COPIED_FROM) != 0) {
handleCopy(delta);
} else {
ensureResourceCovered(delta.getResource(), addedRoots);
}
}
示例4: getFlagTxt
/**
* Adds debug messages.
*
* @param flag
* @return debug message
*/
private String getFlagTxt(int flag) {
String flags = "F_";
if ((flag & IResourceDelta.ADDED) != 0) {
flags += "ADDED ";
}
if ((flag & IResourceDelta.ADDED_PHANTOM) != 0) {
flags += "ADDED_PHANTOM ";
}
if ((flag & IResourceDelta.ALL_WITH_PHANTOMS) != 0) {
flags += "ALL_WITH_PHANTOMS ";
}
if ((flag & IResourceDelta.CHANGED) != 0) {
flags += "CHANGED ";
}
if ((flag & IResourceDelta.CONTENT) != 0) {
flags += "CONTENT ";
}
if ((flag & IResourceDelta.COPIED_FROM) != 0) {
flags += "COPIED_FROM ";
}
if ((flag & IResourceDelta.DERIVED_CHANGED) != 0) {
flags += "DERIVED_CHANGED ";
}
if ((flag & IResourceDelta.DESCRIPTION) != 0) {
flags += "DESCRIPTION ";
}
if ((flag & IResourceDelta.ENCODING) != 0) {
flags += "ENCODING ";
}
if ((flag & IResourceDelta.LOCAL_CHANGED) != 0) {
flags += "LOCAL_CHANGED ";
}
if ((flag & IResourceDelta.MARKERS) != 0) {
flags += "MARKERS ";
}
if ((flag & IResourceDelta.MOVED_FROM) != 0) {
flags += "MOVED_FROM ";
}
if ((flag & IResourceDelta.MOVED_TO) != 0) {
flags += "MOVED_TO ";
}
if ((flag & IResourceDelta.NO_CHANGE) != 0) {
flags += "NO_CHANGE ";
}
if ((flag & IResourceDelta.OPEN) != 0) {
flags += "OPEN ";
}
if ((flag & IResourceDelta.REMOVED) != 0) {
flags += "REMOVED ";
}
if ((flag & IResourceDelta.REMOVED_PHANTOM) != 0) {
flags += "REMOVED_PHANTOM ";
}
if ((flag & IResourceDelta.REPLACED) != 0) {
flags += "REPLACED ";
}
if ((flag & IResourceDelta.SYNC) != 0) {
flags += "SYNC ";
}
if ((flag & IResourceDelta.TYPE) != 0) {
flags += "TYPE ";
}
return flags;
}
示例5: handleCopy
private void handleCopy(IResourceDelta delta) {
if ((delta.getFlags() & IResourceDelta.COPIED_FROM) != 0) {
IResource source = createSourceResource(delta);
ensureResourceCovered(source, copiedRoots);
}
}