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


Java IProject.findMarkers方法代碼示例

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


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

示例1: deleteMarkers

import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
/**
 * Delete the markers for this project
 * @param file
 */
private void deleteMarkers(IProject project) {
	try {
		IMarker[] markers = project.findMarkers(GW4EBuilder.MARKER_TYPE, true, IResource.DEPTH_INFINITE);
		for (int i = 0; i < markers.length; i++) {
			IMarker m = markers[i];
			m.delete();
		}
	} catch (CoreException ce) {
	}
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:15,代碼來源:GW4EBuilder.java

示例2: testNoErrorsInWorkspace

import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
@Test
public void testNoErrorsInWorkspace(){
	IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
	
	for (IProject iProject : projects) {
		try {
			IMarker[] markers = iProject.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
			for (IMarker iMarker : markers) {
				assertFalse("Unexpected marker: " + iMarker.getAttribute(IMarker.MESSAGE), iMarker.getAttribute(IMarker.SEVERITY).equals(IMarker.SEVERITY_ERROR));
			}
		} catch (CoreException e) {
			e.printStackTrace();
		}
	}
}
 
開發者ID:eclipse,項目名稱:gemoc-studio,代碼行數:16,代碼來源:TFSM_PlainK3ExampleWizardTest.java

示例3: removeOldInstructionPointer

import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
private void removeOldInstructionPointer(String project) throws CoreException {
	IProject currentProject = ResourcesPlugin.getWorkspace().getRoot().getProject(project);
	IMarker[] instructionPointers = currentProject.findMarkers(JIMPLE_INSTRUCTIONPOINTER_MARKER, false, IResource.DEPTH_INFINITE);
	for (IMarker m : instructionPointers) {
		m.delete();
	}
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:8,代碼來源:JavaBreakpointListener.java

示例4: fix

import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
private void fix(IMarker marker,IWorkbenchWindow ww,IProgressMonitor monitor) {
	
	IResource resource = marker.getResource();
	if (resource instanceof IFile) {
		try {
			IFile file = (IFile) resource;
			buildFile = BuildPolicyManager.createBuildPoliciesFile(file,monitor);
			marker.delete();
			// remove all markers with this problem. The above
			// resolution fixes also all others of the same type
			IProject project = file.getProject();
			IMarker[] markers = project.findMarkers(GW4EBuilder.MARKER_TYPE, true, IResource.DEPTH_INFINITE);
			IContainer container = file.getParent();
			for (int i = 0; i < markers.length; i++) {
				IMarker m = markers[i];
				IResource r = m.getResource();
				if (r instanceof IFile) {
					IFile f = (IFile) resource;
					IContainer c = f.getParent();
					if (c.equals(container) && m.exists()) {
						Object attr = m.getAttribute(IJavaModelMarker.ID);
						Integer pbid = (Integer) attr;
						if (pbid == null)
							continue;
						if (pbid.equals(GW4EParser.MISSING_BUILD_POLICIES_FILE)) {
							m.delete();
						}
					}
				}
			}
			Display.getDefault().syncExec(new Runnable () {
				@Override
				public void run() {
					JDTManager.openEditor(buildFile, ww);
					ResourceManager.touchFolderResources(file);
				}
			});
		} catch (Exception e) {
			ResourceManager.logException(e);
		}
	}
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:43,代碼來源:MissingBuildPoliciesFileMarkerResolution.java


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