當前位置: 首頁>>代碼示例>>Java>>正文


Java IResourceDelta.findMember方法代碼示例

本文整理匯總了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;
}
 
開發者ID:de-jcup,項目名稱:eclipse-batch-editor,代碼行數:21,代碼來源:BatchEditor.java

示例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);
                }
            });
        }
    }
}
 
開發者ID:pgcodekeeper,項目名稱:pgcodekeeper,代碼行數:16,代碼來源:SQLEditor.java

示例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;
}
 
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-eclipse,代碼行數:28,代碼來源:AppEngineWebBuilder.java

示例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]);
			}
		}
	}
}
 
開發者ID:angelozerr,項目名稱:jsbuild-eclipse,代碼行數:15,代碼來源:JSBuildFileView.java

示例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;
}
 
開發者ID:Yakindu,項目名稱:statecharts,代碼行數:14,代碼來源:DefaultResourceChangeToIssueProcessor.java

示例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;
}
 
開發者ID:1Tristan,項目名稱:VariantSync,代碼行數:27,代碼來源:ChangeHandler.java

示例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);
          }
        }
      }
    }
  }
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:54,代碼來源:DeltaProcessingState.java

示例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;
    }
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:54,代碼來源:DeleteResourceShortcutListener.java


注:本文中的org.eclipse.core.resources.IResourceDelta.findMember方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。