當前位置: 首頁>>代碼示例>>Java>>正文


Java IResourceDelta.accept方法代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:pgcodekeeper,項目名稱:pgcodekeeper,代碼行數:27,代碼來源:ProjectEditorDiffer.java

示例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);
}
 
開發者ID:pgcodekeeper,項目名稱:pgcodekeeper,代碼行數:23,代碼來源:ProjectBuilder.java

示例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...");

}
 
開發者ID:awltech,項目名稱:eclipse-asciidoctools,代碼行數:21,代碼來源:AsciidocBuildHelper.java

示例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));
	}
}
 
開發者ID:angelozerr,項目名稱:typescript.java,代碼行數:18,代碼來源:ProblemManager.java

示例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();
	}
}
 
開發者ID:Yakindu,項目名稱:statecharts,代碼行數:18,代碼來源:SCTHotModelReplacementManager.java

示例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()]);
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:24,代碼來源:ResourceChangeChecker.java

示例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 ();
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:36,代碼來源:ProjectBuilder.java

示例8: handleResourceDelta

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
private void handleResourceDelta(IResourceDelta delta)
{
	try
	{
		delta.accept(this);
	}
	catch( CoreException e )
	{
		JPFClasspathLog.logError(e);
	}
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:12,代碼來源:WorkspaceModelManager.java

示例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;
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:31,代碼來源:JPFManifestBuilder.java

示例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);
		}
	}
}
 
開發者ID:eclipse,項目名稱:gemoc-studio,代碼行數:12,代碼來源:NewProjectWorkspaceListener.java

示例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) {
	}
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:11,代碼來源:ResourceChangeListener.java

示例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);
			}
		}
	}
}
 
開發者ID:angelozerr,項目名稱:ec4e,代碼行數:14,代碼來源:IDEEditorConfigManager.java

示例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;
}
 
開發者ID:Microsoft,項目名稱:java-debug,代碼行數:20,代碼來源:JavaHotCodeReplaceProvider.java

示例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);
		}
	}
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:12,代碼來源:JimpleBreakpointManager.java

示例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;
	}
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:9,代碼來源:JimpleBuilder.java


注:本文中的org.eclipse.core.resources.IResourceDelta.accept方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。