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


Java IFile.findMarkers方法代碼示例

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


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

示例1: removeMarkerForAbstractContextUsed

import org.eclipse.core.resources.IFile; //導入方法依賴的package包/類
/**
 * @param project
 * @param file
 */
public static void removeMarkerForAbstractContextUsed (IFile file) {
	try {
		IMarker[] markers = file.findMarkers(GW4EBuilder.MARKER_TYPE, true, IResource.DEPTH_INFINITE);
		for (int i = 0; i < markers.length; i++) {
			IMarker m = markers[i];
			Integer pbId = (Integer)m.getAttribute(IJavaModelMarker.ID);
			if (pbId!=null) {
				if (GW4EParser.ABSTRACT_CONTEXT_USED==pbId.intValue()) {
					m.delete();
				}
			}
		}
	} catch (CoreException ce) {
	}
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:20,代碼來源:GW4EBuilder.java

示例2: createJimpleMarker

import org.eclipse.core.resources.IFile; //導入方法依賴的package包/類
private IMarker createJimpleMarker(IMarker marker) throws CoreException {
	String project = (String) marker.getAttribute("Jimple.project");
	String file = (String) marker.getAttribute("Jimple.file");
	IFile jimpleFile = getFile(project, file);

	IMarker jimpleMarker = null;
	IMarker[] markers = jimpleFile.findMarkers(IBreakpoint.BREAKPOINT_MARKER, true, IResource.DEPTH_INFINITE);
	if(markers != null) {
		List<IMarker> jimpleBreakpoints = filterJimpleChildBreakpoints(Arrays.asList(markers));
		if(!jimpleBreakpoints.isEmpty()) {
			jimpleMarker = jimpleBreakpoints.get(0);
		} else {
			jimpleMarker = jimpleFile.createMarker(IBreakpoint.BREAKPOINT_MARKER);
		}
	} else {
		jimpleMarker = jimpleFile.createMarker(IBreakpoint.BREAKPOINT_MARKER);
	}

	jimpleMarker.setAttribute(IMarker.LINE_NUMBER, marker.getAttribute("Jimple." + IMarker.LINE_NUMBER));
	jimpleMarker.setAttribute("Jimple.unit.charStart", marker.getAttribute("Jimple.unit.charStart"));
	jimpleMarker.setAttribute("Jimple.unit.charEnd", marker.getAttribute("Jimple.unit.charEnd"));
	jimpleMarker.setAttribute("Jimple.unit.fqn", marker.getAttribute("Jimple.unit.fqn"));
	jimpleMarker.setAttribute("Jimple.project", marker.getAttribute("Jimple.project"));
	jimpleMarker.setAttribute("Jimple.file", marker.getAttribute("Jimple.file"));
	return jimpleMarker;
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:27,代碼來源:JimpleBreakpointManager.java

示例3: assertNumberOfMarkers

import org.eclipse.core.resources.IFile; //導入方法依賴的package包/類
/***/
public static void assertNumberOfMarkers(IFile file, int numberOfMarkers) throws CoreException {
	IMarker[] markers = file.findMarkers(EValidator.MARKER, true, 1);
	assertEquals(printMarker(markers), numberOfMarkers, markers.length);
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:6,代碼來源:BuilderUtil.java

示例4: getMarkersInFile

import org.eclipse.core.resources.IFile; //導入方法依賴的package包/類
private IMarker[] getMarkersInFile() throws CoreException {
	IFile file = getFile();
	String markerType = JIMPLE_BREAKPOINT_MARKER;
	IMarker[] markers = file.findMarkers(markerType, true, IResource.DEPTH_ZERO);
	return markers;
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:7,代碼來源:ToggleJimpleBreakpointsTarget.java


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