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


Java IResourceDelta.getAffectedChildren方法代碼示例

本文整理匯總了Java中org.eclipse.core.resources.IResourceDelta.getAffectedChildren方法的典型用法代碼示例。如果您正苦於以下問題:Java IResourceDelta.getAffectedChildren方法的具體用法?Java IResourceDelta.getAffectedChildren怎麽用?Java IResourceDelta.getAffectedChildren使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.core.resources.IResourceDelta的用法示例。


在下文中一共展示了IResourceDelta.getAffectedChildren方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: appendDelta

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
private static StringBuffer appendDelta(IResourceDelta delta, int indent, StringBuffer buf) {
  for (int i = 0; i < indent; i++) {
    buf.append("  ");
  }
  buf.append(delta.getResource().toString());
  buf.append("-").append(getKindString(delta.getKind()));
  int flags = delta.getKind();
  if (flags != 0) {
    buf.append("-").append(getFlagString(flags)).append('\n');
  }

  IResourceDelta[] affectedChildren = delta.getAffectedChildren();
  Arrays.sort(affectedChildren, COMPARATOR);

  for (int i = 0; i < affectedChildren.length; i++) {
    appendDelta(affectedChildren[i], indent + 1, buf);
  }
  return buf;
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:20,代碼來源:TestModelProvider.java

示例2: getExpectedChildren

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
private static IResourceDelta[] getExpectedChildren(IResourceDelta delta) {
  List result = new ArrayList();
  IResourceDelta[] children = delta.getAffectedChildren();
  for (int i = 0; i < children.length; i++) {
    IResourceDelta child = children[i];
    IResource resource = child.getResource();
    if (resource != null && isIgnorable(resource)) continue;
    if (child.getAffectedChildren().length > 0) {
      result.add(child);
    } else {
      int flags = child.getFlags();
      if (flags == 0 || (flags & PRE_DELTA_FLAGS) != 0) {
        result.add(child);
      }
    }
  }
  return (IResourceDelta[]) result.toArray(new IResourceDelta[result.size()]);
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:19,代碼來源:TestModelProvider.java

示例3: removeStyle

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
/**
 * When a jrtx file is saved search if it is in the cache and in case it is update
 * 
 * @param editedResources resources saved
 * @param removedStylesName Map where the name of the update jrstyle are stored
 */
private static void removeStyle(IResourceDelta[] editedResources, HashSet<String> removedStylesName){
	for(IResourceDelta resource : editedResources){
		if (resource.getAffectedChildren().length>0) {
			removeStyle(resource.getAffectedChildren(), removedStylesName);
		}
		IPath rawLocation = resource.getResource().getRawLocation();
		if (rawLocation != null){
			String key = rawLocation.toOSString();
			List<JRStyle> removedElement = externalStylesCache.remove(key);
			if (removedElement != null){
				ArrayList<JRStyle> cachedStyles = new ArrayList<JRStyle>();
				StyleTemplateFactory.getStylesReference(key, cachedStyles, new HashSet<File>());
				externalStylesCache.put(key, cachedStyles);
				for(JRStyle style : removedElement)
					removedStylesName.add(style.getName());
			}
		}
	}
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:26,代碼來源:ExternalStylesManager.java

示例4: resourceChanged

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
/**
 * Handles a resource changed event by updating the enablement if one of the selected projects is opened or closed.
 */
@Override
public void resourceChanged(final IResourceChangeEvent event) {
	// Warning: code duplicated in CloseResourceAction
	final List<?> sel = getSelectedResources();
	// don't bother looking at delta if selection not applicable
	if (selectionIsOfType(IResource.PROJECT)) {
		final IResourceDelta delta = event.getDelta();
		if (delta != null) {
			final IResourceDelta[] projDeltas = delta.getAffectedChildren(IResourceDelta.CHANGED);
			for (int i = 0; i < projDeltas.length; ++i) {
				final IResourceDelta projDelta = projDeltas[i];
				if ((projDelta.getFlags() & IResourceDelta.OPEN) != 0) {
					if (sel.contains(projDelta.getResource())) {
						selectionChanged(getStructuredSelection());
						return;
					}
				}
			}
		}
	}
}
 
開發者ID:gama-platform,項目名稱:gama,代碼行數:25,代碼來源:OpenResourceAction.java

示例5: resourceChanged

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
/**
 * Handles a resource changed event by updating the enablement if one of the selected projects is opened or closed.
 */
@Override
public synchronized void resourceChanged(final IResourceChangeEvent event) {
	// Warning: code duplicated in OpenResourceAction
	final List<? extends IResource> sel = getSelectedResources();
	// don't bother looking at delta if selection not applicable
	if (selectionIsOfType(IResource.PROJECT)) {
		final IResourceDelta delta = event.getDelta();
		if (delta != null) {
			final IResourceDelta[] projDeltas = delta.getAffectedChildren(IResourceDelta.CHANGED);
			for (final IResourceDelta projDelta : projDeltas) {
				if ((projDelta.getFlags() & IResourceDelta.OPEN) != 0) {
					if (sel.contains(projDelta.getResource())) {
						selectionChanged(getStructuredSelection());
						return;
					}
				}
			}
		}
	}
}
 
開發者ID:gama-platform,項目名稱:gama,代碼行數:24,代碼來源:CloseResourceAction.java

示例6: resourceChanged

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
/**
 * @see IResourceChangeListener#resourceChanged(IResourceChangeEvent)
 */
public void resourceChanged(IResourceChangeEvent event) {
	IResourceDelta root = event.getDelta();
	IResourceDelta[] projectDeltas = root.getAffectedChildren();
	for (int i = 0; i < projectDeltas.length; i++) {							
		IResourceDelta delta = projectDeltas[i];
		IResource resource = delta.getResource();
		if (delta.getKind() == IResourceDelta.ADDED) {
			newProject = (IProject)resource;
		}
	}
}
 
開發者ID:subclipse,項目名稱:subclipse,代碼行數:15,代碼來源:CheckoutUsingProjectWizardAction.java

示例7: flattenDelta

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
/**
 * Flattens the delta tree to a list of delta paths.
 *
 * @param delta
 *          the {@link IResourceDelta} to flatten, must not be {@code null}
 * @return the flattened delta tree, never {@code null} or empty
 */
private Collection<IResourceDelta> flattenDelta(final IResourceDelta delta) {
  final Set<IResourceDelta> result = Sets.newHashSet(delta);
  for (final IResourceDelta child : delta.getAffectedChildren()) {
    result.addAll(flattenDelta(child));
  }
  return result;
}
 
開發者ID:dsldevkit,項目名稱:dsl-devkit,代碼行數:15,代碼來源:ResourceChangeListener.java

示例8: findInfResource

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
private static IResource findInfResource(IResourceDelta delta) {
	if(delta.getResource().getName().endsWith(".inf") && delta.getKind() == IResourceDelta.CHANGED) {
		return delta.getResource();
	}
	
	for(IResourceDelta child : delta.getAffectedChildren()) {
		IResource infResource = findInfResource(child);
		if(infResource != null) {
			return infResource;
		}
	}
	
	return null;
}
 
開發者ID:ffmmjj,項目名稱:uefi_edk2_wizards_plugin,代碼行數:15,代碼來源:Edk2ModuleObservablesManager.java

示例9: collectRemovals

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
private void collectRemovals(Set<IAdaptable> removals, IResourceDelta delta) {
  if (delta.getKind() == IResourceDelta.REMOVED) removals.add(delta.getResource());
  else {
    IResourceDelta[] children = delta.getAffectedChildren();
    for (int i = 0; i < children.length; i++) {
      collectRemovals(removals, children[i]);
    }
  }
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:10,代碼來源:SearchResultUpdater.java

示例10: updateRootIndex

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
private void updateRootIndex(PackageFragmentRoot root, String[] pkgName, IResourceDelta delta) {
  Openable pkg = root.getPackageFragment(pkgName);
  updateIndex(pkg, delta);
  IResourceDelta[] children = (IResourceDelta[]) delta.getAffectedChildren();
  for (int i = 0, length = children.length; i < length; i++) {
    IResourceDelta child = children[i];
    IResource resource = child.getResource();
    if (resource instanceof IFolder) {
      String[] subpkgName = Util.arrayConcat(pkgName, resource.getName());
      updateRootIndex(root, subpkgName, child);
    }
  }
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:14,代碼來源:DeltaProcessor.java

示例11: iterateResourceDelta

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
/**
 * Recursive method called when some resource changes, it search for deleted resources inside
 * the delta hierarchy
 * 
 * @param delta actual level of the delta hierarchy
 * @param deleteResources the list of deleted resources actually found
 */
private void iterateResourceDelta(IResourceDelta delta, List<IFile> deleteResources){
	if (delta.getKind() == IResourceDelta.REMOVED && delta.getResource() instanceof IFile){
		deleteResources.add((IFile)delta.getResource());
	}
	for(IResourceDelta affectedResource : delta.getAffectedChildren()){
		iterateResourceDelta(affectedResource, deleteResources);
	}
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:16,代碼來源:DefaultManager.java

示例12: getChangedFiles

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
private Set<IFile> getChangedFiles(final IResourceDelta delta) {
  final Set<IFile> affectedFiles = Sets.newHashSet();
  final IResource resource = delta.getResource();
  if (resource instanceof IFile) {
    affectedFiles.add((IFile) resource);
  }
  else {
    for (final IResourceDelta childDelta : delta.getAffectedChildren()) {
      affectedFiles.addAll(getChangedFiles(childDelta));
    }
  }
  return affectedFiles;
}
 
開發者ID:sealuzh,項目名稱:PerformanceHat,代碼行數:14,代碼來源:FeedbackResourceDeltaImpl.java

示例13: processPostChangeDeltaChildren

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
private void processPostChangeDeltaChildren(IResourceDelta delta) {
	for (IResourceDelta child : delta.getAffectedChildren()) {
		this.processPostChangeDelta(child);  // recurse
	}
}
 
開發者ID:ShoukriKattan,項目名稱:ForgedUI-Eclipse,代碼行數:6,代碼來源:TitaniumProjectsManager.java

示例14: walkDelta

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
/**
 * Walks the {@link IResourceDelta} tree.
 * 
 * @param delta
 *            the root {@link IResourceDelta}
 * @param movedResources
 *            mapping of moved {@link IResource}
 * @param base
 *            the current {@link IBase}
 */
private void walkDelta(IResourceDelta delta, HashMap<IPath, IResource> movedResources, IBase base) {
	processDelta(delta, movedResources, base);
	for (IResourceDelta child : delta.getAffectedChildren()) {
		walkDelta(child, movedResources, base);
	}
}
 
開發者ID:ModelWriter,項目名稱:Source,代碼行數:17,代碼來源:ResourceLocationListener.java

示例15: walkDelta

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
/**
 * Walks the {@link IResourceDelta} tree.
 * 
 * @param delta
 *            the root {@link IResourceDelta}
 * @param movedResources
 *            mapping of moved {@link IResource}
 */
private void walkDelta(IResourceDelta delta, HashMap<IPath, IResource> movedResources) {
	processDelta(delta, movedResources);
	for (IResourceDelta child : delta.getAffectedChildren()) {
		walkDelta(child, movedResources);
	}
}
 
開發者ID:ModelWriter,項目名稱:Source,代碼行數:15,代碼來源:WorkspaceMappingBaseListener.java


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