本文整理匯總了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;
}
示例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()]);
}
示例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());
}
}
}
}
示例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;
}
}
}
}
}
}
示例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;
}
}
}
}
}
}
示例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;
}
}
}
示例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;
}
示例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;
}
示例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]);
}
}
}
示例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);
}
}
}
示例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);
}
}
示例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;
}
示例13: processPostChangeDeltaChildren
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
private void processPostChangeDeltaChildren(IResourceDelta delta) {
for (IResourceDelta child : delta.getAffectedChildren()) {
this.processPostChangeDelta(child); // recurse
}
}
示例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);
}
}
示例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);
}
}