当前位置: 首页>>代码示例>>Java>>正文


Java IResourceChangeEvent.getDelta方法代码示例

本文整理汇总了Java中org.eclipse.core.resources.IResourceChangeEvent.getDelta方法的典型用法代码示例。如果您正苦于以下问题:Java IResourceChangeEvent.getDelta方法的具体用法?Java IResourceChangeEvent.getDelta怎么用?Java IResourceChangeEvent.getDelta使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.core.resources.IResourceChangeEvent的用法示例。


在下文中一共展示了IResourceChangeEvent.getDelta方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isMarkerChangeForThisEditor

import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的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.IResourceChangeEvent; //导入方法依赖的package包/类
@Override
public void resourceChanged(IResourceChangeEvent event) {
	if (event.getSource() instanceof IWorkspace) {
		switch (event.getType()) {
			case IResourceChangeEvent.POST_CHANGE:
				try {
					if (event.getDelta() != null && editor.isActiveOn(event.getResource())) {
						editor.getPageModel();
					}
				} catch (Exception e) {
					Log.error("Failed handing post_change of resource", e);
				}
				break;
		}
	}
}
 
开发者ID:grosenberg,项目名称:fluentmark,代码行数:17,代码来源:PageRoot.java

示例3: handleResourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
private void handleResourceChanged(IResourceChangeEvent event) {
	IResourceDelta delta = event.getDelta();
	if (delta == null) {
		return;
	}

	// Find resourced whose problems changed and report them to listeners
	Set<IResource> changedResources = new HashSet<>();
	try {
		delta.accept(new ProblemMarkerDeltaVisitor(changedResources));
	} catch (CoreException e) {
		TypeScriptCorePlugin.logError(e);
	}
	if (!changedResources.isEmpty()) {
		notifyListeners(Collections.unmodifiableSet(changedResources));
	}
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:18,代码来源:ProblemManager.java

示例4: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
@Override
public void resourceChanged(IResourceChangeEvent event) {
	try {
		IResourceDelta delta = event.getDelta();
		
		CMakeTouchDeltaVisitor touchVisitor = new CMakeTouchDeltaVisitor();
		
		delta.accept(touchVisitor);
		touchVisitor.postProcess();
		
		for(IResourceDeltaVisitor visitor : reusableVisitors) {
			delta.accept(visitor);
		}
	} catch (CoreException e) {
		e.printStackTrace();
	}
}
 
开发者ID:USESystemEngineeringBV,项目名称:cmake-eclipse-helper,代码行数:18,代码来源:CMakeProjectResourceChangeListener.java

示例5: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
public synchronized void resourceChanged(IResourceChangeEvent event) {
	if (event.getType() == IResourceChangeEvent.PRE_CLOSE)
		handleCloseEvent(event);

	IResourceDelta delta = event.getDelta();
	try {
		changedFiles.clear();
		if (delta != null)
			delta.accept(this);
		if (changedFiles.size() > 0) {
			handleHotModelReplacement();
		}

	} catch (CoreException e) {
		e.printStackTrace();
	}
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:18,代码来源:SCTHotModelReplacementManager.java

示例6: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的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

示例7: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的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

示例8: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的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

示例9: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
@Override
public void resourceChanged(IResourceChangeEvent event) {
	final IResourceDelta delta = event.getDelta();
	if (delta != null) {
		try {
			delta.accept(new NewProjectDetector());
		} catch (CoreException e) {
			Activator.error(e.getMessage(), e);
		}
	}
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:12,代码来源:NewProjectWorkspaceListener.java

示例10: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
public void resourceChanged(IResourceChangeEvent event) {
	IResourceDelta delta = event.getDelta();
	try {
		if (delta != null)
			delta.accept(this);

	}
	catch (CoreException exception) {
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:11,代码来源:ResourceChangeListener.java

示例11: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
@Override
public void resourceChanged(IResourceChangeEvent event) {
	if (event == null || event.getDelta() == null || event.getType() != IResourceChangeEvent.POST_CHANGE) {
		return;
	}

	try {
		event.getDelta().accept(new IResourceDeltaVisitor() {
			public boolean visit(IResourceDelta delta) throws CoreException {
				final IResource resource = delta.getResource();

				/* Visite le workspace. */
				if (resource instanceof IWorkspaceRoot) {
					return true;
				}

				/* Visite le projet. */
				if (resource instanceof IProject && delta.getKind() == IResourceDelta.CHANGED) {
					/* Cas d'un changement : potentiellement une ouverture de projet. */
					handleProject(resource.getProject());
				}

				return false;
			}
		});
	} catch (CoreException e) {
		ErrorUtils.handle(e);
	}
}
 
开发者ID:sebez,项目名称:vertigo-chroma-kspplugin,代码行数:30,代码来源:LegacyManager.java

示例12: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
@Override
public void resourceChanged(IResourceChangeEvent event) {
	if (event.getDelta() == null) {
		/* Evénement sans delta : on ne traite pas. */
		return;
	}

	/* Visite l'arborescence du delta. */
	try {
		event.getDelta().accept(new DeltaItemVisitor());
	} catch (CoreException e) {
		ErrorUtils.handle(e);
	}
}
 
开发者ID:sebez,项目名称:vertigo-chroma-kspplugin,代码行数:15,代码来源:ResourceStore.java

示例13: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
@Override
public void resourceChanged(IResourceChangeEvent event) {
	if (event.getType() == IResourceChangeEvent.POST_CHANGE) {
		IResourceDelta delta = event.getDelta();
		if (delta != null) {
			try {
				delta.accept(this);
			} catch (CoreException e) {
				EditorConfigPlugin.logError("Error while .editorconfig resource changed", e);
			}
		}
	}
}
 
开发者ID:angelozerr,项目名称:ec4e,代码行数:14,代码来源:IDEEditorConfigManager.java

示例14: getChangedClassFiles

import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
/**
 * Returns the class file visitor after visiting the resource change. The
 * visitor contains the changed class files and qualified type names. Returns
 * <code>null</code> if the visitor encounters an exception, or the delta is not
 * a POST_BUILD.
 */
private ChangedClassFilesVisitor getChangedClassFiles(IResourceChangeEvent event) {
    IResourceDelta delta = event.getDelta();
    if (event.getType() != IResourceChangeEvent.POST_BUILD || delta == null) {
        return null;
    }
    classFilesVisitor.reset();
    try {
        delta.accept(classFilesVisitor);
    } catch (CoreException e) {
        return null; // quiet failure
    }
    return classFilesVisitor;
}
 
开发者ID:Microsoft,项目名称:java-debug,代码行数:20,代码来源:JavaHotCodeReplaceProvider.java

示例15: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
@Override
public void resourceChanged(IResourceChangeEvent event) {
	IResourceDelta delta= event.getDelta();
	if (delta != null) {
		try {
			delta.accept(new BreakpointManagerVisitor());
		} catch (CoreException ce) {
			logger.error("Couldn't run visitor to restore breakpoints", ce);
		}
	}
}
 
开发者ID:VisuFlow,项目名称:visuflow-plugin,代码行数:12,代码来源:JimpleBreakpointManager.java


注:本文中的org.eclipse.core.resources.IResourceChangeEvent.getDelta方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。