本文整理匯總了Java中org.eclipse.core.resources.IResourceDelta.REPLACED屬性的典型用法代碼示例。如果您正苦於以下問題:Java IResourceDelta.REPLACED屬性的具體用法?Java IResourceDelta.REPLACED怎麽用?Java IResourceDelta.REPLACED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.eclipse.core.resources.IResourceDelta
的用法示例。
在下文中一共展示了IResourceDelta.REPLACED屬性的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isRelevantResourceChange
/**
* Given a resource delta, indicate whether or the delta contains a type of
* resource change that GWT generally cares about.
*/
public static boolean isRelevantResourceChange(IResourceDelta delta) {
if (delta == null) {
return false;
}
int relevantChanges = IResourceDelta.CONTENT | IResourceDelta.DESCRIPTION
| IRESOURCEDELTA_LOCAL_CHANGED | IResourceDelta.OPEN
| IResourceDelta.REPLACED | IResourceDelta.TYPE;
// Either added or removed (through != CHANGED), or changed in some
// relevant way (through (.. & relevantChanges) != 0)
if (delta.getKind() != IResourceDelta.CHANGED
|| (delta.getFlags() & relevantChanges) != 0) {
return true;
}
return false;
}
示例2: handleChange
private void handleChange(IResourceDelta delta) {
if ((delta.getFlags() & IResourceDelta.REPLACED) != 0) {
// A replace was added in place of a removed resource
handleAdded(delta);
} else if (delta.getResource().getType() == IResource.FILE) {
ensureResourceCovered(delta.getResource(), changedFiles);
}
}
示例3: 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;
}
示例4: visit
@Override
public boolean visit(final IResourceDelta delta) {
final IResource res = delta.getResource();
switch (delta.getKind()) {
case IResourceDelta.ADDED:
System.out.print("Resource ");
System.out.print(res.getFullPath());
System.out.println(" was added.");
break;
case IResourceDelta.REMOVED:
System.out.print("Resource ");
System.out.print(res.getFullPath());
System.out.println(" was removed.");
break;
case IResourceDelta.CHANGED:
System.out.print("Resource ");
System.out.print(delta.getFullPath());
System.out.println(" has changed.");
final int flags = delta.getFlags();
if ((flags & IResourceDelta.CONTENT) != 0) {
System.out.println("--> Content Change");
}
if ((flags & IResourceDelta.REPLACED) != 0) {
System.out.println("--> Content Replaced");
}
if ((flags & IResourceDelta.MARKERS) != 0) {
System.out.println("--> Marker Change");
final IMarkerDelta[] markers = delta.getMarkerDeltas();
// if interested in markers, check these deltas
}
break;
}
return true; // visit the children
}
示例5: sync
/**
* Performs all required operations to sync given delta with target directory
* @param delta
* @param monitor
* @return true only if this operation was successfull for all mapped files
*/
public boolean sync(IResourceDelta delta, IProgressMonitor monitor) {
IResource res = delta.getResource();
boolean result = false;
switch (delta.getKind()) {
case IResourceDelta.ADDED:
result = copy(res, monitor);
break;
case IResourceDelta.REMOVED:
/*
* TODO Currently we trying to delete the delta's resource
* regardless if this resource should be deleted or only the
* child element.
* Therefore we create warnings while trying to successive
* delete directories, because we are going from root to the
* child entries and as long as childs are exists, deletion
* of parent will fail. I think there should be some kind of
* flags in the delta, if the current resource itself should be
* deleted or only one of the children. In the second case we
* shouldn't try to delete current resource!!!
*/
result = true;
result = delete(res, false, monitor);
break;
case IResourceDelta.REPLACED:
// fall througth
case IResourceDelta.CHANGED:
result = copy(res, monitor);
break;
default:
break;
}
if (result) {
needRefreshAffectedProjects = true;
}
return result;
}
示例6: visit
@Override
public boolean visit(IResourceDelta delta) throws CoreException {
IResource resource = delta.getResource();
switch(resource.getType()) {
case IResource.FOLDER:
case IResource.ROOT:
return true;
case IResource.PROJECT:
return CMakeNature.isCMakeProject((IProject)resource);
default:
break;
}
IFile file = (IFile)resource;
if(".project".equals(file.getName())) {
// we have a project file
if(file.getParent().getType() != IResource.PROJECT) {
// it is a project file not positioned at project level
switch (delta.getFlags()) {
case IResourceDelta.CONTENT:
case IResourceDelta.REPLACED:
launcher.scheduleCopyProjectFiles(file.getProject());
return false;
}
}
}
return true;
}
開發者ID:USESystemEngineeringBV,項目名稱:cmake-eclipse-helper,代碼行數:28,代碼來源:DotProjectFileChangedDeltaVisitor.java
示例7: visit
public boolean visit(IResourceDelta delta) {
IResource res = delta.getResource();
switch (delta.getKind()) {
case IResourceDelta.ADDED:
System.out.print("Resource ");
System.out.print(res.getFullPath());
System.out.println(" was added.");
break;
case IResourceDelta.REMOVED:
System.out.print("Resource ");
System.out.print(res.getFullPath());
System.out.println(" was removed.");
break;
case IResourceDelta.CHANGED:
System.out.print("Resource ");
System.out.print(delta.getFullPath());
System.out.println(" has changed.");
int flags = delta.getFlags();
if ((flags & IResourceDelta.CONTENT) != 0) {
System.out.println("--> Content Change");
}
if ((flags & IResourceDelta.REPLACED) != 0) {
System.out.println("--> Content Replaced");
}
if ((flags & IResourceDelta.MARKERS) != 0) {
System.out.println("--> Marker Change");
IMarkerDelta[] markers = delta.getMarkerDeltas();
// if interested in markers, check these deltas
for (IMarkerDelta iMarkerDelta : markers) {
System.out.println(iMarkerDelta.getAttribute(IMarker.CHAR_START));
switch (iMarkerDelta.getKind()) {
case IResourceDelta.ADDED:
System.out.println("Added");
break;
case IResourceDelta.REMOVED:
System.out.println("Removed");
break;
case IResourceDelta.CHANGED:
System.out.println("Changed");
break;
}
}
}
break;
}
return true; // visit the children
}
示例8: 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;
}