本文整理汇总了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;
}
示例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;
}
}
}
示例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));
}
}
示例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();
}
}
示例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;
}
}
}
}
}
}
示例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;
}
}
}
}
}
}
示例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);
}
});
}
}
}
示例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);
}
}
}
示例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) {
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}
}
示例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;
}
示例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);
}
}
}