本文整理匯總了Java中org.eclipse.core.resources.IResourceDelta.MOVED_TO屬性的典型用法代碼示例。如果您正苦於以下問題:Java IResourceDelta.MOVED_TO屬性的具體用法?Java IResourceDelta.MOVED_TO怎麽用?Java IResourceDelta.MOVED_TO使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.eclipse.core.resources.IResourceDelta
的用法示例。
在下文中一共展示了IResourceDelta.MOVED_TO屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: processRemovedDelta
/**
* Process {@link IResourceDelta} with {@link IResourceDelta#REMOVED removed}
* {@link IResourceDelta#getKind() kind}.
*
* @param delta
* the {@link IResourceDelta} with {@link IResourceDelta#REMOVED removed}
* {@link IResourceDelta#getKind() kind}
* @param movedResources
* mapping of moved {@link IResource}
*/
private void processRemovedDelta(IResourceDelta delta, HashMap<IPath, IResource> movedResources) {
if ((delta.getFlags() & IResourceDelta.MOVED_TO) != 0) {
final IResource target = movedResources.get(delta.getMovedToPath());
if (target != null) {
resourceMoved((IFile)delta.getResource(), (IFile)target);
} else {
movedResources.put(delta.getResource().getFullPath(), delta.getResource());
}
} else {
unregister((IFile)delta.getResource());
}
}
示例2: handleMove
private void handleMove(IResourceDelta delta) {
if ((delta.getFlags() & IResourceDelta.MOVED_TO) != 0) {
movedRoots.add(delta.getResource());
} else if ((delta.getFlags() & IResourceDelta.MOVED_FROM) != 0) {
IResource source = createSourceResource(delta);
ensureResourceCovered(source, movedRoots);
}
}
示例3: handleRemoved
private void handleRemoved(IResourceDelta delta) {
if ((delta.getFlags() & IResourceDelta.OPEN) != 0) {
closedProjects.add(delta.getResource());
} else if ((delta.getFlags() & IResourceDelta.MOVED_TO) != 0) {
handleMove(delta);
} else {
ensureResourceCovered(delta.getResource(), removedRoots);
}
}
示例4: 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;
}
示例5: visit
public boolean visit(IResourceDelta delta) {
if (delta == null)
return true;
IEditorInput editorInput = editorPart.getEditorInput();
if (editorInput instanceof FileEditorInput) {
if (!delta.getResource().equals(
((FileEditorInput) editorInput).getFile())) {
return true;
}
} else {
return true; // this is not an input type our editor handles
}
if (delta.getKind() == IResourceDelta.REMOVED) {
if ((IResourceDelta.MOVED_TO & delta.getFlags()) == 0) {
/*
* * if the file was deleted NOTE: The case where an open,
* unsaved file is deleted being handled by the PartListener
* added to the Workbench in the initialize() method.
*/
if (!editorPart.isDirty()) {
closeEditorDoNotSave();
}
}
else { // else if it was moved or renamed
final IFile newFile = ResourcesPlugin.getWorkspace()
.getRoot().getFile(delta.getMovedToPath());
Display display = editorPart.getSite().getShell().getDisplay();
display.asyncExec(new Runnable() {
public void run() {
((ELTGraphicalEditor)editorPart).setInput(new FileEditorInput(newFile));
}
});
}
}
return false;
}
示例6: 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;
}