當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。