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


Java IResourceDelta.getFlags方法代碼示例

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


在下文中一共展示了IResourceDelta.getFlags方法的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: isMarkerChangeForThisEditor

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的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

示例3: handleResource

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
protected boolean handleResource ( final IResourceDelta delta )
{
    if ( delta.getResource ().getType () != IResource.FILE )
    {
        return true;
    }

    if ( delta.getFlags () == IResourceDelta.MARKERS )
    {
        return false;
    }

    final URI uri = URI.createPlatformResourceURI ( delta.getFullPath ().toString (), true );
    if ( !this.loadedUris.contains ( uri ) )
    {
        return true;
    }

    fireResourceChange ();

    return true;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:23,代碼來源:PreviewEditorImpl.java

示例4: visit

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
@Override
public boolean visit(IResourceDelta delta) throws CoreException {
	boolean isAutomatic = getPreferenceStore().getBoolean(EvoSuitePreferencePage.AUTOMATIC_TEST_ON_SAVE);
	if (isAutomatic // && markersEnabled() 
			&& delta.getKind() == IResourceDelta.CHANGED 
			&& delta.getFlags() != IResourceDelta.MARKERS 
			&& delta.getResource() != null) {
		final IResource res = delta.getResource();
		
		if (res.getType() == IResource.FILE
				&& res.getName().toLowerCase().endsWith("java")
				&& !res.getName().endsWith(JUNIT_IDENTIFIER)
				&& !res.getName().endsWith(SCAFFOLDING_IDENTIFIER)) {
			System.out.println("Resetting Roaming Job for " + res.getName());
			FILE_QUEUE.addFile(res);
			FILE_QUEUE.update();
			resetRoamingJob(res);
		}
	}
	return true;
}
 
開發者ID:EvoSuite,項目名稱:evosuite,代碼行數:22,代碼來源:Activator.java

示例5: handleChangeDelta

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
/**
 * Update the view for the given resource delta. The delta is a resource
 * delta for the given build file in the view
 * 
 * @param delta
 *            a delta for a build file in the view
 * @param project
 *            the project node that has changed
 */
private void handleChangeDelta(IResourceDelta delta,
		final IJSBuildFile project) {
	IResource resource = delta.getResource();
	if (resource.getType() != IResource.FILE) {
		return;
	}
	if (delta.getKind() == IResourceDelta.REMOVED) {
		Display.getDefault().asyncExec(new Runnable() {
			public void run() {
				removeProject(project);
			}
		});
	} else if (delta.getKind() == IResourceDelta.CHANGED
			&& (delta.getFlags() & IResourceDelta.CONTENT) != 0) {
		handleBuildFileChanged(project);
	}
}
 
開發者ID:angelozerr,項目名稱:jsbuild-eclipse,代碼行數:27,代碼來源:JSBuildFileView.java

示例6: visit

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
public boolean visit(IResourceDelta delta) throws CoreException
{
	IResource resource = delta.getResource();
	if (resource instanceof IFile)
	{
		if (delta.getKind() == IResourceDelta.ADDED
				|| (delta.getKind() == IResourceDelta.CHANGED && ((delta.getFlags() & (IResourceDelta.CONTENT | IResourceDelta.ENCODING)) != 0)))
		{
			updatedFiles.add((IFile) resource);
		}
		else if (delta.getKind() == IResourceDelta.REMOVED)
		{
			removedFiles.add((IFile) resource);
		}
	}
	return true;
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:18,代碼來源:UnifiedBuilder.java

示例7: processChangedDelta

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
/**
 * Process {@link IResourceDelta} with {@link IResourceDelta#CHANGED changed}
 * {@link IResourceDelta#getKind() kind}.
 * 
 * @param delta
 *            the {@link IResourceDelta} with {@link IResourceDelta#CHANGED changed}
 *            {@link IResourceDelta#getKind() kind}
 */
private void processChangedDelta(IResourceDelta delta) {
	if ((delta.getFlags() & IResourceDelta.OPEN) != 0) {
		if (delta.getResource().isAccessible()) {
			register((IFile)delta.getResource());
		} else {
			unregister((IFile)delta.getResource());
		}
	} else if ((delta.getFlags() & IResourceDelta.DESCRIPTION) != 0) {
		// nothing to do here
	} else if ((delta.getFlags() & IResourceDelta.CONTENT) != 0) {
		if (resourceToBase.get(delta.getResource()) == null) {
			register((IFile)delta.getResource());
		}
	}
}
 
開發者ID:ModelWriter,項目名稱:Source,代碼行數:24,代碼來源:SemanticBaseListener.java

示例8: resourceChanged

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
@Override
public void resourceChanged(final IResourceChangeEvent event) {
	final IResourceDelta delta = event.getDelta().findMember(imageFile.getFullPath());
	if (delta != null) {
		// file deleted -- close the editor
		if (delta.getKind() == IResourceDelta.REMOVED) {
			final Runnable r = () -> getSite().getPage().closeEditor(ImageViewer.this, false);
			getSite().getShell().getDisplay().asyncExec(r);
		}
		// file changed -- reload image
		else if (delta.getKind() == IResourceDelta.CHANGED) {
			final int flags = delta.getFlags();
			if ((flags & IResourceDelta.CONTENT) != 0 || (flags & IResourceDelta.LOCAL_CHANGED) != 0) {
				startImageLoad();
			}
		}
	}
}
 
開發者ID:gama-platform,項目名稱:gama,代碼行數:19,代碼來源:ImageViewer.java

示例9: handleBundleManifestDelta

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
private void handleBundleManifestDelta(IFile file, IResourceDelta delta)
{
	int kind = delta.getKind();
	IProject project = file.getProject();
	IPluginModel model = getPluginModel(project);
	if( kind == IResourceDelta.REMOVED && model != null )
	{
		removeModel(project);
		// switch to legacy plugin structure, if applicable
		createModel(project, true);
	}
	else if( kind == IResourceDelta.ADDED || model == null )
	{
		createModel(project, true);
	}
	else if( kind == IResourceDelta.CHANGED && (IResourceDelta.CONTENT & delta.getFlags()) != 0 )
	{
		boolean wasFragment = model.isFragmentModel();
		model.reload();

		// Fragment-Host header was added or removed
		if( wasFragment != model.isFragmentModel() )
		{
			removeModel(project);
			createModel(project, true);
		}
		else
		{
			addChange(model, IModelProviderEvent.MODELS_CHANGED);
		}
	}
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:33,代碼來源:WorkspacePluginModelManager.java

示例10: resourceChanged

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的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

示例11: resourceChanged

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
@Override
public void resourceChanged(IResourceChangeEvent event) {
	if (event.getType() != IResourceChangeEvent.POST_CHANGE) {
		return;
	}
	IEditorInput editorInput = this.getEditorInput();
	if (!(editorInput instanceof FileEditorInput)) {
		return;
	}

	FileEditorInput fileInput = (FileEditorInput) editorInput;
	IFile file = fileInput.getFile();
	IResourceDelta candidate = event.getDelta().findMember(file.getFullPath());
	if (candidate == null) {
		return;
	}
	/* Changement de contenu. */
	if ((candidate.getFlags() & IResourceDelta.CONTENT) == 0) {
		return;
	}
	switch (candidate.getKind()) {
	case IResourceDelta.ADDED:
	case IResourceDelta.CHANGED:
		checkKsp(file);
		break;
	case IResourceDelta.REMOVED:
	default:
		break;
	}
}
 
開發者ID:sebez,項目名稱:vertigo-chroma-kspplugin,代碼行數:31,代碼來源:KspEditor.java

示例12: visit

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
@Override
public boolean visit(IResourceDelta delta) {
	if (delta == null) {
		return false;
	}
	if (0 != (delta.getFlags() & IResourceDelta.OPEN) && 0 == (delta.getFlags() & IResourceDelta.MOVED_FROM)) {
		handleProjectResourceOpenStateChange(delta.getResource());
		return false;
	}
	return true;
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:12,代碼來源:JimpleBreakpointManager.java

示例13: visit

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
@Override
public boolean visit(IResourceDelta delta) throws CoreException {
	IResource resource = delta.getResource();
	// Check if resource is accessible.
	// We do not deal with the markers for deleted files here
	// WorkspaceEventsHandler removes the diagnostics for deleted resources.
	if (resource == null || !resource.isAccessible()) {
		return false;
	}
	if (resource.getType() == IResource.FOLDER || resource.getType() == IResource.ROOT) {
		return true;
	}
	// ignore problems caused by standalone files
	if (resource.getType() == IResource.PROJECT) {
		return !JavaLanguageServerPlugin.getProjectsManager().getDefaultProject().equals(resource.getProject());
	}
	// No marker changes continue to visit
	if ((delta.getFlags() & IResourceDelta.MARKERS) == 0) {
		return false;
	}
	IFile file = (IFile) resource;
	String uri = JDTUtils.getFileURI(resource);
	IDocument document = null;
	IMarker[] markers = null;
	// Check if it is a Java ...
	if (JavaCore.isJavaLikeFileName(file.getName())) {
		markers = resource.findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_ONE);
		ICompilationUnit cu = (ICompilationUnit) JavaCore.create(file);
		document = JsonRpcHelpers.toDocument(cu.getBuffer());
	} // or a build file
	else if (projectsManager.isBuildFile(file)) {
		//all errors on that build file should be relevant
		markers = file.findMarkers(null, true, 1);
		document = JsonRpcHelpers.toDocument(file);
	}
	if (document != null) {
		this.connection.publishDiagnostics(new PublishDiagnosticsParams(ResourceUtils.toClientUri(uri), toDiagnosticsArray(document, markers)));
	}
	return false;
}
 
開發者ID:eclipse,項目名稱:eclipse.jdt.ls,代碼行數:41,代碼來源:WorkspaceDiagnosticsHandler.java

示例14: processChangedDelta

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
/**
 * Process {@link IResourceDelta} with {@link IResourceDelta#CHANGED changed}
 * {@link IResourceDelta#getKind() kind}.
 * 
 * @param delta
 *            the {@link IResourceDelta} with {@link IResourceDelta#CHANGED changed}
 *            {@link IResourceDelta#getKind() kind}
 * @param base
 *            the current {@link IBase}
 */
private void processChangedDelta(IResourceDelta delta, IBase base) {
	if ((delta.getFlags() & IResourceDelta.OPEN) != 0) {
		if (delta.getResource().isAccessible()) {
			updateLocation(base, delta.getResource());
		} else {
			// we can't track changes but the location is still valid for the moment
		}
	} else if ((delta.getFlags() & IResourceDelta.DESCRIPTION) != 0) {
		// nothing to do here
	} else if ((delta.getFlags() & IResourceDelta.CONTENT) != 0) {
		updateLocation(base, delta.getResource());
	}
}
 
開發者ID:ModelWriter,項目名稱:Source,代碼行數:24,代碼來源:ResourceLocationListener.java

示例15: handleMove

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
private void handleMove(IResourceDelta delta) {
  if ((delta.getFlags() & IResourceDelta.MOVED_TO) != 0) {
    movedRoots.add(delta.getResource());
  } else if ((delta.getFlags() & IResourceDelta.MOVED_FROM) != 0) {
    IResource source = createSourceResource(delta);
    ensureResourceCovered(source, movedRoots);
  }
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:9,代碼來源:ChangeDescription.java


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