本文整理匯總了Java中org.eclipse.core.resources.IResourceDelta.SYNC屬性的典型用法代碼示例。如果您正苦於以下問題:Java IResourceDelta.SYNC屬性的具體用法?Java IResourceDelta.SYNC怎麽用?Java IResourceDelta.SYNC使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.eclipse.core.resources.IResourceDelta
的用法示例。
在下文中一共展示了IResourceDelta.SYNC屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: visit
public boolean visit(IResourceDelta delta) {
if (delta == null || delta.getResource() == null || part == null || part.getEditorInput() == null
|| (((IFileEditorInput) part.getEditorInput()).getFile()) == null)
return true;
if (!delta.getResource().equals((((IFileEditorInput) part.getEditorInput()).getFile())))
return true;
switch (delta.getKind()) {
case IResourceDelta.ADDED:
break;
case IResourceDelta.REMOVED:
if ((IResourceDelta.MOVED_TO & delta.getFlags()) == 0) {
// file removed
UIUtils.getDisplay().asyncExec(new Runnable() {
public void run() {
part.getSite().getPage().closeEditor(part, false);
}
});
} else
changeInput(delta.getMovedToPath());
break;
case IResourceDelta.CHANGED:
if ((delta.getFlags() & IResourceDelta.CONTENT) != 0 || (delta.getFlags() & IResourceDelta.SYNC) != 0
|| (delta.getFlags() & IResourceDelta.REPLACED) != 0)
changeInput(delta.getFullPath());
break;
}
return true;
}
示例2: visit
@Override
public boolean visit(final IResourceDelta delta) {
final IResource res = delta.getResource();
boolean update = false;
switch (delta.getKind()) {
case IResourceDelta.OPEN:
if (res.isAccessible())
update = projectOpened((IProject) res);
else
update = projectClosed((IProject) res);
break;
case IResourceDelta.ADDED:
update = processAddition(res);
break;
case IResourceDelta.REMOVED:
update = processRemoval(res);
break;
case IResourceDelta.CHANGED:
final int flags = delta.getFlags();
if ((flags & IResourceDelta.MARKERS) != 0) {
update = processMarkersChanged(res);
} else if ((flags & IResourceDelta.TYPE) != 0) {
if (DEBUG)
DEBUG("Resource type changed: " + res);
} else if ((flags & IResourceDelta.CONTENT) != 0) {
if (DEBUG)
DEBUG("Resource contents changed: " + res);
} else if ((flags & IResourceDelta.SYNC) != 0) {
if (DEBUG)
DEBUG("Resource sync info changed: " + res);
}
break;
}
if (update) {
updateResource(res);
}
return true; // visit the children
}
示例3: 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;
}