本文整理匯總了Java中org.eclipse.core.resources.IResourceDelta.accept方法的典型用法代碼示例。如果您正苦於以下問題:Java IResourceDelta.accept方法的具體用法?Java IResourceDelta.accept怎麽用?Java IResourceDelta.accept使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.core.resources.IResourceDelta
的用法示例。
在下文中一共展示了IResourceDelta.accept方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: handleChangeProject
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
private void handleChangeProject(IResourceDelta rootDelta) {
final boolean[] schemaChanged = new boolean[1];
try {
rootDelta.accept(delta -> {
if (schemaChanged[0]) {
return false;
}
// something other than just markers has changed
// check that it's our resource
if (delta.getFlags() != IResourceDelta.MARKERS &&
PgUIDumpLoader.isInProject(delta) &&
delta.getResource().getType() == IResource.FILE &&
delta.getResource().getProject().equals(proj.getProject())) {
schemaChanged[0] = true;
return false;
}
return true;
});
} catch (CoreException ex) {
Log.log(ex);
}
if (schemaChanged[0]) {
UiSync.exec(parent, this::notifyProjectChanged);
}
}
示例2: buildIncrement
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
private void buildIncrement(IResourceDelta delta, PgDbParser parser, IProgressMonitor monitor)
throws CoreException, InterruptedException, IOException {
List<IFile> files = new ArrayList<>();
delta.accept(d -> {
if (PgUIDumpLoader.isInProject(d)) {
IResource res = d.getResource();
if (res.getType() == IResource.FILE) {
switch (d.getKind()) {
case IResourceDelta.REMOVED:
case IResourceDelta.REMOVED_PHANTOM:
parser.removePathFromRefs(res.getLocation().toOSString());
break;
default:
files.add((IFile) res);
break;
}
}
}
return true;
});
parser.getObjFromProjFiles(files, monitor);
}
示例3: incrementalBuild
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
public static void incrementalBuild(IProject project, IResourceDelta delta, IProgressMonitor monitor) throws CoreException, IOException {
AsciidocConfiguration configuration = AsciidocConfiguration.getConfiguration(project);
if (delta == null) {
fullBuild(project, monitor);
return;
}
IFolder resourcesFolder = project.getFolder(new Path(configuration.getResourcesPath()));
IFolder sourcesFolder = project.getFolder(new Path(configuration.getSourcesPath()));
IFolder targetFolder = project.getFolder(new Path(configuration.getTargetPath()));
monitor.subTask("Locating resources to process...");
AsciidocResourceVisitor visitor = new AsciidocResourceVisitor(sourcesFolder, resourcesFolder);
delta.accept(visitor);
copy(resourcesFolder, visitor.getResourceFiles(), targetFolder, monitor);
generate(sourcesFolder, visitor.getSourceFiles(), targetFolder, configuration, monitor);
monitor.subTask("Refreshing target folder...");
}
示例4: handleResourceChanged
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的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));
}
}
示例5: resourceChanged
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的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: getChangedFiles
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
IFile[] getChangedFiles() throws CoreException {
IResourceDelta root = fDeltaFactory.getDelta();
final List result = new ArrayList();
root.accept(
new IResourceDeltaVisitor() {
public boolean visit(IResourceDelta delta) throws CoreException {
final IResource resource = delta.getResource();
if (resource.getType() == IResource.FILE) {
final int kind = delta.getKind();
if (isSet(kind, IResourceDelta.CHANGED)) {
result.add(resource);
} else if (isSet(kind, IResourceDelta.ADDED)
&& isSet(delta.getFlags(), IResourceDelta.CONTENT | IResourceDelta.MOVED_FROM)) {
final IFile movedFrom =
resource.getWorkspace().getRoot().getFile(delta.getMovedFromPath());
result.add(movedFrom);
}
}
return true;
}
});
return (IFile[]) result.toArray(new IFile[result.size()]);
}
示例7: build
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
@Override
protected IProject[] build ( final int kind, final Map<String, String> args, final IProgressMonitor monitor ) throws CoreException
{
final ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE );
try
{
logger.debug ( "Requested build" );
final Set<String> extensions = getExtensions ( args );
IResourceDelta delta = null;
if ( kind != FULL_BUILD )
{
delta = getDelta ( getProject () );
}
if ( delta == null || kind == FULL_BUILD )
{
if ( isInterestingProject ( getProject () ) )
{
validateAll ( getProject (), adapterFactory, extensions, monitor );
}
}
else
{
delta.accept ( new DeltaVisitor ( monitor, adapterFactory, extensions ) );
}
return null;
}
finally
{
adapterFactory.dispose ();
}
}
示例8: handleResourceDelta
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
private void handleResourceDelta(IResourceDelta delta)
{
try
{
delta.accept(this);
}
catch( CoreException e )
{
JPFClasspathLog.logError(e);
}
}
示例9: build
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
@Override
protected IProject[] build(int kind, Map<String, String> args, IProgressMonitor monitor) throws CoreException
{
IProject project = getProject();
IResourceDelta delta = getDelta(project);
boolean doValidate = false;
if( delta == null )
{
doValidate = true;
}
else
{
if( Boolean.TRUE.equals(project.getSessionProperty(JPFClasspathPlugin.TOUCH_PROJECT)) )
{
project.setSessionProperty(JPFClasspathPlugin.TOUCH_PROJECT, null);
doValidate = true;
}
else
{
manifestVisitor.reset();
delta.accept(manifestVisitor);
doValidate = manifestVisitor.manifestChanged;
}
}
if( doValidate )
{
validateManifest(project);
}
return null;
}
示例10: resourceChanged
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的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);
}
}
}
示例11: resourceChanged
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
public void resourceChanged(IResourceChangeEvent event) {
IResourceDelta delta = event.getDelta();
try {
if (delta != null)
delta.accept(this);
}
catch (CoreException exception) {
}
}
示例12: resourceChanged
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的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);
}
}
}
}
示例13: getChangedClassFiles
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的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;
}
示例14: resourceChanged
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的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);
}
}
}
示例15: checkForBuild
import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
protected void checkForBuild(IResourceDelta delta,
IProgressMonitor monitor) throws CoreException {
delta.accept(new JimpleDeltaVisitor());
if(executeBuild){
fullBuild(monitor);
executeBuild = false;
}
}