Examples of IMarker


Examples of org.eclipse.core.resources.IMarker

        while (iter.hasNext()) {
            Annotation annotation = (Annotation) iter.next();
            if (annotation instanceof MarkerAnnotation && canFix(annotation)) {
                Position position = model.getPosition(annotation);
                if (isAtPosition(context.getOffset(), position)) {
                    IMarker marker = ((MarkerAnnotation) annotation).getMarker();
                    String errorType = marker.getAttribute("$bndType", null);
                    if (errorType != null) {
                        BuildErrorDetailsHandler handler = BuildErrorDetailsHandlers.INSTANCE.findHandler(errorType);
                        if (handler != null) {
                            proposals.addAll(handler.getProposals(marker));
                        }
View Full Code Here

Examples of org.eclipse.core.resources.IMarker

                //                at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381)
                //                at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
                //                at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
                //                at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
                if (resource != null) {
                    IMarker marker = resource.createMarker(BndtoolsConstants.MARKER_BND_PROBLEM);
                    marker.setAttribute(IMarker.SEVERITY, severity);
                    marker.setAttribute("$bndType", type);
                    marker.setAttribute(BuildErrorDetailsHandler.PROP_HAS_RESOLUTIONS, markerData.hasResolutions());
                    for (Entry<String,Object> attrib : markerData.getAttribs().entrySet())
                        marker.setAttribute(attrib.getKey(), attrib.getValue());
                }
            }
        } else {
            IMarker marker = DefaultBuildErrorDetailsHandler.getDefaultResource(getProject()).createMarker(BndtoolsConstants.MARKER_BND_PROBLEM);
            marker.setAttribute(IMarker.SEVERITY, severity);
            marker.setAttribute(IMarker.MESSAGE, message);
        }
    }
View Full Code Here

Examples of org.eclipse.core.resources.IMarker

    }

    private void addClasspathMarker(String message, int severity) throws CoreException {
        IResource resource = DefaultBuildErrorDetailsHandler.getDefaultResource(getProject());

        IMarker marker = resource.createMarker(BndtoolsConstants.MARKER_BND_CLASSPATH_PROBLEM);
        marker.setAttribute(IMarker.SEVERITY, severity);
        marker.setAttribute(IMarker.MESSAGE, message);
    }
View Full Code Here

Examples of org.eclipse.core.resources.IMarker

        if (resource == null || !resource.exists())
            resource = project;

        project.deleteMarkers(BndtoolsConstants.MARKER_BND_CLASSPATH_PROBLEM, true, IResource.DEPTH_INFINITE);
        for (String error : errors) {
            IMarker marker = resource.createMarker(BndtoolsConstants.MARKER_BND_CLASSPATH_PROBLEM);
            marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
            marker.setAttribute(IMarker.MESSAGE, error);
        }
    }
View Full Code Here

Examples of org.eclipse.core.resources.IMarker

            String type = location.details != null ? location.details.getClass().getName() : null;
            BuildErrorDetailsHandler handler = BuildErrorDetailsHandlers.INSTANCE.findHandler(type);

            List<MarkerData> markers = handler.generateMarkerData(getProject(), model, location);
            for (MarkerData markerData : markers) {
                IMarker marker = markerData.getResource().createMarker(BndtoolsConstants.MARKER_BND_PROBLEM);
                marker.setAttribute(IMarker.SEVERITY, severity);
                marker.setAttribute("$bndType", type);
                marker.setAttribute(BuildErrorDetailsHandler.PROP_HAS_RESOLUTIONS, markerData.hasResolutions());
                for (Entry<String,Object> attrib : markerData.getAttribs().entrySet())
                    marker.setAttribute(attrib.getKey(), attrib.getValue());
            }
        } else {
            IMarker marker = DefaultBuildErrorDetailsHandler.getDefaultResource(getProject()).createMarker(BndtoolsConstants.MARKER_BND_PROBLEM);
            marker.setAttribute(IMarker.SEVERITY, severity);
            marker.setAttribute(IMarker.MESSAGE, message);
        }
    }
View Full Code Here

Examples of org.eclipse.core.resources.IMarker

    }

    private void addClasspathMarker(String message, int severity) throws CoreException {
        IResource resource = DefaultBuildErrorDetailsHandler.getDefaultResource(getProject());

        IMarker marker = resource.createMarker(BndtoolsConstants.MARKER_BND_CLASSPATH_PROBLEM);
        marker.setAttribute(IMarker.SEVERITY, severity);
        marker.setAttribute(IMarker.MESSAGE, message);
    }
View Full Code Here

Examples of org.eclipse.core.resources.IMarker

        if (resource == null || !resource.exists())
            resource = project;

        project.deleteMarkers(BndtoolsConstants.MARKER_BND_CLASSPATH_PROBLEM, true, IResource.DEPTH_INFINITE);
        for (String error : errors) {
            IMarker marker = resource.createMarker(BndtoolsConstants.MARKER_BND_CLASSPATH_PROBLEM);
            marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
            marker.setAttribute(IMarker.MESSAGE, error);
        }
    }
View Full Code Here

Examples of org.eclipse.core.resources.IMarker

      }
    }

    private static void createProblemMarker(final IFile file, final CategorizedProblem prob) throws CoreException
    {
      IMarker marker = file.createMarker(MARKER);
      marker.setAttribute(IMarker.TRANSIENT, true);
      marker.setAttribute(IMarker.MESSAGE, prob.getMessage());
      marker.setAttribute(IMarker.LINE_NUMBER, prob.getSourceLineNumber());
      marker.setAttribute(IMarker.CHAR_START, prob.getSourceStart());
      marker.setAttribute(IMarker.CHAR_END, prob.getSourceEnd());
      marker.setAttribute(IMarker.SEVERITY, prob.isError()?SEVERITY_ERROR:SEVERITY_WARNING);
    }
View Full Code Here

Examples of org.eclipse.core.resources.IMarker

        @SuppressWarnings("rawtypes")
        Iterator iter = sourceViewer.getAnnotationModel().getAnnotationIterator();
        while (iter.hasNext()) {
            Object annotation = iter.next();
            if (annotation instanceof MarkerAnnotation) {
                IMarker marker = ((MarkerAnnotation) annotation).getMarker();

                int markerLine = marker.getAttribute(IMarker.LINE_NUMBER, 0);
                // Hover line is zero-based and marker line is one-based. FML.
                if (markerLine == lineNum + 1) {
                    return marker.getAttribute(IMarker.MESSAGE, null);
                }
            }
        }

        return null;
View Full Code Here

Examples of org.eclipse.core.resources.IMarker

        return null;
    }

    public boolean canFix(Annotation annotation) {
        if (annotation instanceof MarkerAnnotation) {
            IMarker marker = ((MarkerAnnotation) annotation).getMarker();
            return marker.getAttribute(BuildErrorDetailsHandler.PROP_HAS_RESOLUTIONS, false);
        }
        return false;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.