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


Java IResourceDelta.getResource方法代碼示例

本文整理匯總了Java中org.eclipse.core.resources.IResourceDelta.getResource方法的典型用法代碼示例。如果您正苦於以下問題:Java IResourceDelta.getResource方法的具體用法?Java IResourceDelta.getResource怎麽用?Java IResourceDelta.getResource使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.core.resources.IResourceDelta的用法示例。


在下文中一共展示了IResourceDelta.getResource方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: handleResourceDelta

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
/**
 * Handles the given resource delta.
 *
 * Fires workspace repository changed event if a project was opened/closed or a project was added/removed.
 */
private boolean handleResourceDelta(IResourceDelta delta) {
	IResource affectedResource = delta.getResource();

	if (affectedResource instanceof IProject) {
		// check if kind is CHANGED
		if ((delta.getKind() & IResourceDelta.CHANGED) == IResourceDelta.CHANGED) {
			// if project was opened/closed
			if ((delta.getFlags() & IResourceDelta.OPEN) == IResourceDelta.OPEN) {
				fireWorkspaceRepositoriesChanged();
				return false;
			}
		}
		// check if kind is ADDED or REMOVED
		else if ((delta.getKind() & IResourceDelta.ADDED | IResourceDelta.REMOVED) != 0) {
			fireWorkspaceRepositoriesChanged();
			return false;
		}
	}
	return true;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:26,代碼來源:WorkspaceRepositoriesProvider.java

示例2: visit

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
public boolean visit(IResourceDelta delta) throws CoreException {
	IResource resource = delta.getResource();
	switch (delta.getKind()) {
	case IResourceDelta.ADDED:
		updateProjectPluginConfiguration(resource);
		checkConsistency(resource);
		break;
	case IResourceDelta.REMOVED:
		updateProjectPluginConfiguration(resource);
		checkConsistency(resource);
		break;
	case IResourceDelta.CHANGED:
		updateProjectPluginConfiguration(resource);
		checkConsistency(resource);
		break;
	}
	//return true to continue visiting children.
	return true;
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:20,代碼來源:GemocSequentialLanguageBuilder.java

示例3: handleFileDelta

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
@Override
protected void handleFileDelta(IResourceDelta delta)
{
	IFile file = (IFile) delta.getResource();
	JarPluginModelImpl existing = jarModels.get(file);
	if( delta.getKind() == IResourceDelta.REMOVED && existing != null )
	{
		removeJar(existing);
	}
	else if( delta.getKind() == IResourceDelta.ADDED )
	{
		if( isPluginJar(file) )
		{
			addJarModel(fModels.get(file.getProject()), file, true);
		}
	}
	else if( delta.getKind() == IResourceDelta.CHANGED && existing != null )
	{
		existing.reload();
		addChange(existing, IModelProviderEvent.MODELS_CHANGED);
	}
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:23,代碼來源:WorkspaceJarModelManager.java

示例4: visit

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
@Override
public boolean visit(IResourceDelta delta) throws CoreException
{
	IResource resource = delta.getResource();
	if( resource.isDerived() )
	{
		return false;
	}
	if( resource.getType() == IResource.FILE )
	{
		IFile file = (IFile) resource;
		IProject project = resource.getProject();
		if( file.equals(JPFProject.getManifest(project)) )
		{
			manifestChanged = true;
			return false;
		}
	}
	return true;
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:21,代碼來源:JPFManifestBuilder.java

示例5: visit

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
public boolean visit(IResourceDelta delta) throws CoreException {
	IResource resource = delta.getResource();
	if (!PreferenceManager.isBuildEnabled(resource.getProject().getName())) {
		if (resource instanceof IFile) {
			deleteMarkers((IFile)resource);
		}
		return true;
	}
	switch (delta.getKind()) {
	case IResourceDelta.ADDED:
		checkResource(resource);
		break;
	case IResourceDelta.REMOVED:
		checkRemovedResource(resource);
		break;
	case IResourceDelta.CHANGED:
		checkResource(resource);
		break;
	}
	// return true to continue visiting children.
	return true;
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:23,代碼來源:GW4EBuilder.java

示例6: visit

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
@Override
public boolean visit(IResourceDelta delta) throws CoreException {
	IResource resource = delta.getResource();
	if (resource == null) {
		return false;
	}
	switch (resource.getType()) {
	case IResource.ROOT:
	case IResource.PROJECT:
	case IResource.FOLDER:
		return true;
	case IResource.FILE:
		IFile file = (IFile) resource;
		if (EditorConfigConstants.EDITORCONFIG.equals(file.getName())
				&& delta.getKind() == IResourceDelta.CHANGED) {
			entries.remove(new FileResource(file));
		}
	}
	return false;
}
 
開發者ID:angelozerr,項目名稱:ec4e,代碼行數:21,代碼來源:IDEEditorConfigManager.java

示例7: visit

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
public boolean visit(IResourceDelta delta) throws CoreException {
	IResource resource = delta.getResource();
	if (resource.getFileExtension() != null){
	switch (delta.getKind()) {
	case IResourceDelta.ADDED:
		if(resource.getFileExtension().equals("java")){
			executeBuild = true;
			return false;
		}
		break;
	case IResourceDelta.REMOVED:
		if(resource.getFileExtension().equals("java")){
			executeBuild = true;
			return false;
		}
		break;
	case IResourceDelta.CHANGED:
		if( resource.getFileExtension().equals("java")){
			executeBuild = true;
			return false;
		}
		break;
	}
	}
	return true;
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:27,代碼來源:JimpleBuilder.java

示例8: visit

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
@Override
public boolean visit(final IResourceDelta delta) throws CoreException {
    final IResource iResource = delta.getResource();
    final String fileExtension = iResource.getFileExtension();
    final boolean isMonitoredResource = VitruviusEmfBuilder.this.getMonitoredFileTypes().contains(fileExtension);
    if (isMonitoredResource) {
        switch (delta.getKind()) {
        case IResourceDelta.ADDED:
            LOGGER.debug("Importing to Vitruvius: " + iResource);
            VitruviusEmfBuilder.this.importToVitruvius(iResource);
            break;
        case IResourceDelta.REMOVED:
            LOGGER.debug("Removing from Vitruvius: " + iResource);
            VitruviusEmfBuilder.this.removeFromVitruvius(iResource);
            break;
        case IResourceDelta.CHANGED:
            // LOGGER.debug("Resource changed: " + iResource);
            VitruviusEmfBuilder.this.triggerSynchronisation(iResource);
            break;
        default:
            LOGGER.debug("No action for change kind: '" + delta.getKind() + "' executed.");
        }
    }
    // return true to continue visiting children.
    return true;
}
 
開發者ID:vitruv-tools,項目名稱:Vitruv,代碼行數:27,代碼來源:VitruviusEmfBuilder.java

示例9: visit

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
public boolean visit(IResourceDelta delta) throws CoreException {
	IResource resource = delta.getResource();
	switch (delta.getKind()) {
	case IResourceDelta.ADDED:
		checkABAP(resource);
		break;
	case IResourceDelta.REMOVED:
		break;
	case IResourceDelta.CHANGED:
		checkABAP(resource);
		break;
    default: // do nothing
        break;				
	}
	return true;
}
 
開發者ID:larshp,項目名稱:abaplint-eclipse,代碼行數:17,代碼來源:AbaplintBuilder.java

示例10: handleFileDelta

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
@Override
protected void handleFileDelta(IResourceDelta delta) {
	IFile file = (IFile) delta.getResource();
	IProject project = file.getProject();

	if (ProductSupport.isProductFile(file)) {
		Object model = getSingleModel(file);
		int kind = delta.getKind();
		if (kind == IResourceDelta.REMOVED && model != null) {
			removeSingleModel(project, model);
		} else if (kind == IResourceDelta.ADDED && model == null) {
			createSingleModel(project, file, true);
		} else if (kind == IResourceDelta.CHANGED && (IResourceDelta.CONTENT & delta.getFlags()) != 0) {
			loadModel((IProductModel) model, true);
			addChange(model, IModelProviderEvent.MODELS_CHANGED);
		}
	}
}
 
開發者ID:secondfiddle,項目名稱:pep-tools,代碼行數:19,代碼來源:WorkspaceProductModelManager.java

示例11: visit

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
/**
 * @see org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta)
 */
public boolean visit(IResourceDelta delta) throws CoreException {
	IResource resource = delta.getResource();
	switch (delta.getKind()) {
	case IResourceDelta.ADDED:
		// handle added resource
              System.out.println("RBE DELTA added");
		checkBundleResource(resource);
		break;
	case IResourceDelta.REMOVED:
              System.out.println("RBE DELTA Removed"); //$NON-NLS-1$
		// handle removed resource
		break;
	case IResourceDelta.CHANGED:
              System.out.println("RBE DELTA changed");
		// handle changed resource
		checkBundleResource(resource);
		break;
	}
	//return true to continue visiting children.
	return true;
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:25,代碼來源:Builder.java

示例12: visit

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
@Override
public boolean visit(IResourceDelta delta) throws CoreException {
	IResource resource = delta.getResource();
	if (resource == null) {
		return false;
	}
	switch (resource.getType()) {
	case IResource.ROOT:
	case IResource.PROJECT:
	case IResource.FOLDER:
		return true;
	case IResource.FILE:
		IFile file = (IFile) delta.getResource();
		if (fViewer != null
				&& JSBuildFileFactoryManager.findFactoryId(file) != null) {
			// refresh the tasks for the Build file (Gruntfile.js,
			// gulpfile.js) inside the Project Explorer
			if (!fViewer.isBusy()) {
				fViewer.refresh(file);
			}
		}
		return false;
	}
	return false;

}
 
開發者ID:angelozerr,項目名稱:jsbuild-eclipse,代碼行數:27,代碼來源:NavigatorJSBuildFileContentProvider.java

示例13: processDelta

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
/**
 * Processes the given {@link IResourceDelta} by
 * {@link WorkspaceListener#fireChange(fr.obeo.dsl.workspace.listener.change.IChange) firing}
 * {@link fr.obeo.dsl.workspace.listener.change.IChange IChange}.
 * 
 * @param delta
 *            the {@link IResourceDelta} to process
 * @param movedResources
 *            mapping of moved {@link IResource}
 */
private void processDelta(IResourceDelta delta, HashMap<IPath, IResource> movedResources) {
	if (delta.getResource() instanceof IFile) {
		switch (delta.getKind()) {
			case IResourceDelta.ADDED:
				processAddedDelta(delta, movedResources);
				break;

			case IResourceDelta.REMOVED:
				processRemovedDelta(delta, movedResources);
				break;

			case IResourceDelta.CHANGED:
				processChangedDelta(delta);
				break;

			default:
				break;
		}
	}
}
 
開發者ID:ModelWriter,項目名稱:Source,代碼行數:31,代碼來源:SemanticBaseListener.java

示例14: processAdded

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
private boolean processAdded(IResourceDelta delta) {
	try {

		SwiperUtil.logTrace("Processing Added");

		if ((delta.getResource() instanceof IFolder)) {
			IFolder folder = (IFolder) delta.getResource();

			if (SyncUtil.isSharedAction(folder.getParent().getProjectRelativePath())) {
				processSharedAction(folder);
				return false;
			}
		} else if (delta.getResource() instanceof IFile) {

			IFile designerFile = (IFile) delta.getResource();
			processDesignerFile(designerFile);

		}

	} catch (CoreException e) {
		e.printStackTrace();
	}
	return true;
}
 
開發者ID:camac,項目名稱:Swiper,代碼行數:25,代碼來源:SwiperPostVisitor.java

示例15: visit

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
@Override
public boolean visit(IResourceDelta delta) throws CoreException {
	IResource resource = delta.getResource();

	if(isWorkspace(resource)) {
		return true;
	}
	
	if(isProject(resource)) {
		IProject project = (IProject)resource;
		if(!CMakeNature.isCMakeProject(project)) {
			return false;
		}
		CMakeNature.scheduleIntegrityCheck(project);
	}
	
	CMakeListsContainer container = addOrGetContainer(resource);
	if(container == null) {
		return false;
	}
	return container.process(resource, delta.getKind());
}
 
開發者ID:USESystemEngineeringBV,項目名稱:cmake-eclipse-helper,代碼行數:23,代碼來源:CMakeTouchDeltaVisitor.java


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