本文整理匯總了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) {
}
}
示例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;
}
示例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);
}
示例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;
}