本文整理匯總了Java中org.eclipse.core.resources.IResourceDelta.findMember方法的典型用法代碼示例。如果您正苦於以下問題:Java IResourceDelta.findMember方法的具體用法?Java IResourceDelta.findMember怎麽用?Java IResourceDelta.findMember使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.core.resources.IResourceDelta
的用法示例。
在下文中一共展示了IResourceDelta.findMember方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isMarkerChangeForThisEditor
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
private boolean isMarkerChangeForThisEditor(IResourceChangeEvent event) {
IResource resource = ResourceUtil.getResource(getEditorInput());
if (resource == null) {
return false;
}
IPath path = resource.getFullPath();
if (path == null) {
return false;
}
IResourceDelta eventDelta = event.getDelta();
if (eventDelta == null) {
return false;
}
IResourceDelta delta = eventDelta.findMember(path);
if (delta == null) {
return false;
}
boolean isMarkerChangeForThisResource = (delta.getFlags() & IResourceDelta.MARKERS) != 0;
return isMarkerChangeForThisResource;
}
示例2: resourceChanged
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
@Override
public void resourceChanged(IResourceChangeEvent event) {
IResource file = ResourceUtil.getResource(getEditorInput());
IResourceDelta delta = event.getDelta();
if (delta != null && file != null) {
IResourceDelta child = delta.findMember(file.getFullPath());
if (child != null && (child.getFlags() & IResourceDelta.MARKERS) != 0) {
UiSync.exec(parentComposite, () -> {
if (!parentComposite.isDisposed()) {
firePropertyChange(IWorkbenchPart.PROP_TITLE);
}
});
}
}
}
示例3: build
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
@Override
protected IProject[] build(int kind, Map<String, String> args, IProgressMonitor monitor)
throws CoreException {
IFacetedProject project = ProjectFacetsManager.create(getProject());
if (project == null || !AppEngineStandardFacet.hasFacet(project)) {
logger.fine(getProject() + ": no build required: no App Engine Standard facet");
return null;
}
IFile appEngineWebDescriptor =
WebProjectUtil.findInWebInf(project.getProject(), new Path("appengine-web.xml"));
if (appEngineWebDescriptor == null || !appEngineWebDescriptor.exists()) {
logger.warning(getProject() + ": no build required: missing appengine-web.xml");
return null;
}
if (kind == FULL_BUILD) {
checkRuntimeElement(project, appEngineWebDescriptor, monitor);
} else {
IResourceDelta delta = getDelta(getProject());
if (delta == null
|| delta.findMember(appEngineWebDescriptor.getProjectRelativePath()) != null) {
checkRuntimeElement(project, appEngineWebDescriptor, monitor);
} else {
logger.finer(getProject() + ": no build required: appengine-web.xml not changed");
}
}
return null;
}
示例4: resourceChanged
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
public void resourceChanged(IResourceChangeEvent event) {
IResourceDelta delta = event.getDelta();
if (delta != null) {
IJSBuildFile projects[] = getProjects();
IPath buildFilePath;
for (int i = 0; i < projects.length; i++) {
buildFilePath = new Path(projects[i].getBuildFileName());
IResourceDelta change = delta.findMember(buildFilePath);
if (change != null) {
handleChangeDelta(change, projects[i]);
}
}
}
}
示例5: getDeltaForFile
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
protected IResourceDelta getDeltaForFile(final IResourceChangeEvent event, final IFile file) {
final String[] segments = file.getFullPath().segments();
IResourceDelta currentDelta = event.getDelta();
for (final String segment : segments) {
final IResourceDelta matchingDelta = currentDelta.findMember(new Path(segment));
if (matchingDelta != null) {
currentDelta = matchingDelta;
continue;
}
return null;
}
return currentDelta;
}
示例6: checkMembers
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
/**
* Checks that delta does not result of adding or changing a file.
*
* @param delta
* the resource delta to check
* @param project
* the project of delta
* @return true if delta does not result of adding or changing a file,
* otherwise false
* @throws CoreException
* project nature could not be proofed
*/
private boolean checkMembers(IResourceDelta delta, IProject project)
throws CoreException {
IResourceDelta openDelta = delta.findMember(new Path(".project"));
if (openDelta != null
&& (openDelta.getKind() == IResourceDelta.ADDED || openDelta
.getKind() == IResourceDelta.CHANGED)) {
if (project != null
&& project.hasNature(VSyncSupportProjectNature.NATURE_ID)) {
update();
}
return false;
}
return true;
}
示例7: updateRoots
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
public synchronized void updateRoots(
IPath containerPath, IResourceDelta containerDelta, DeltaProcessor deltaProcessor) {
Map updatedRoots;
Map otherUpdatedRoots;
if (containerDelta.getKind() == IResourceDelta.REMOVED) {
updatedRoots = this.oldRoots;
otherUpdatedRoots = this.oldOtherRoots;
} else {
updatedRoots = this.roots;
otherUpdatedRoots = this.otherRoots;
}
int containerSegmentCount = containerPath.segmentCount();
boolean containerIsProject = containerSegmentCount == 1;
Iterator iterator = updatedRoots.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry entry = (Map.Entry) iterator.next();
IPath path = (IPath) entry.getKey();
if (containerPath.isPrefixOf(path) && !containerPath.equals(path)) {
IResourceDelta rootDelta =
(IResourceDelta)
containerDelta.findMember(path.removeFirstSegments(containerSegmentCount));
if (rootDelta == null) continue;
DeltaProcessor.RootInfo rootInfo = (DeltaProcessor.RootInfo) entry.getValue();
if (!containerIsProject
|| !rootInfo
.project
.getPath()
.isPrefixOf(
path)) { // only consider folder roots that are not included in the container
deltaProcessor.updateCurrentDeltaAndIndex(
rootDelta, IJavaElement.PACKAGE_FRAGMENT_ROOT, rootInfo);
}
ArrayList rootList = (ArrayList) otherUpdatedRoots.get(path);
if (rootList != null) {
Iterator otherProjects = rootList.iterator();
while (otherProjects.hasNext()) {
rootInfo = (DeltaProcessor.RootInfo) otherProjects.next();
if (!containerIsProject
|| !rootInfo
.project
.getPath()
.isPrefixOf(path)) { // only consider folder roots that are not included in the
// container
deltaProcessor.updateCurrentDeltaAndIndex(
rootDelta, IJavaElement.PACKAGE_FRAGMENT_ROOT, rootInfo);
}
}
}
}
}
}
示例8: resourceChanged
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
/**
* @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
*/
public void resourceChanged(IResourceChangeEvent event) {
IResourceDelta delta = event.getDelta();
switch (delta.getKind()) {
case IResourceDelta.REMOVED:
break;
case IResourceDelta.CHANGED:
List<IConnectionPoint> deleted = new ArrayList<IConnectionPoint>();
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IConnectionPointManager manager = CoreIOPlugin.getConnectionPointManager();
IConnectionPoint[] projectShortcuts = manager.getConnectionPointCategory(CATEGORY_ID)
.getConnectionPoints();
WorkspaceConnectionPoint connectionPoint;
for (IConnectionPoint shortcut : projectShortcuts) {
connectionPoint = (WorkspaceConnectionPoint) shortcut;
// see if the relative path matches the changed item
IResourceDelta d = delta.findMember(connectionPoint.getPath());
if (d != null && d.getKind() == IResourceDelta.REMOVED) {
if (d.getMovedToPath() == null) {
IResource resource = d.getResource();
if (!(resource instanceof IProject) && resource.getProject().exists() && !resource.getProject().isOpen())
{
continue;
}
// the original container was deleted
deleted.add(shortcut);
} else {
// the original container was moved
IPath newPath = d.getMovedToPath();
IContainer newContainer;
if (d.getResource() instanceof IProject) {
newContainer = root.getProject(newPath.toString());
} else {
newContainer = root.getFolder(newPath);
}
connectionPoint.setResource(newContainer);
connectionPoint.setName(newContainer.getName());
}
}
}
// if the item was deleted, remove it
for (IConnectionPoint projectShortcut : deleted) {
manager.removeConnectionPoint(projectShortcut);
}
break;
}
}