Examples of IMarker


Examples of org.eclipse.core.resources.IMarker

        final List<ICompletionProposal> result = Lists.newArrayList();
        while (iter.hasNext()) {
            final Annotation annotation = iter.next();
            if (annotation instanceof MarkerAnnotation) {
                final MarkerAnnotation markerAnnotation = (MarkerAnnotation) annotation;
                final IMarker marker = markerAnnotation.getMarker();
                try {
                    if (!marker.getType().equals(MarkerUtils.PROBLEM_MARKER)) {
                        continue;
                    }
                    final int invocationLine = sourceViewer.getDocument()
                            .getLineOfOffset(invocationContext.getOffset());
                    final int markerLine = marker.getAttribute(IMarker.LINE_NUMBER, -1) - 1;

                    if (invocationLine == markerLine) {
                        final IMarkerResolution[] qfixes = getResolutions(marker);
                        for (final IMarkerResolution qfix : qfixes) {
                            result.add(new MarkerResolutionProposal(qfix, marker));
View Full Code Here

Examples of org.eclipse.core.resources.IMarker

        }
    }

    private void showWithMarker(final IEditorPart editor, final IErlModule module,
            final int offset, final int length) throws PartInitException {
        IMarker marker = null;
        try {
            marker = MarkerUtils.createSearchResultMarker(module,
                    NewSearchUI.SEARCH_MARKER, offset, length);
            IDE.gotoMarker(editor, marker);
        } catch (final CoreException e) {
            throw new PartInitException("SearchMessages.FileSearchPage_error_marker", e);
        } finally {
            if (marker != null) {
                try {
                    marker.delete();
                } catch (final CoreException e) {
                    // ignore
                }
            }
        }
View Full Code Here

Examples of org.eclipse.core.resources.IMarker

public class RenameModuleQuickFix extends MarkerQuickFixExecutor {

    @Override
    public void run() throws Exception {
        final IMarker marker = getMarker();
        final List<String> margs = getQuickFix().getArgs();
        final String moduleName = margs.get(0);

        final IErlModel svc = ErlangEngine.getInstance().getModel();

        IErlModule newModule;
        newModule = svc.findModule(moduleName);
        if (newModule != null) {
            MessageDialog.openInformation(null, "Rename module quickfix",
                    "A module with name '" + moduleName + "' already exists.");
            newModule.dispose();
            return;
        }

        final IFile file = (IFile) marker.getResource();
        final IErlModule oldModule = svc.findModule(file);
        if (oldModule == null) {
            return;
        }
View Full Code Here

Examples of org.eclipse.core.resources.IMarker

public class RenameFileQuickFix extends MarkerQuickFixExecutor {

    @Override
    public void run() throws CoreException {
        final IMarker marker = getMarker();
        final List<String> margs = getQuickFix().getArgs();
        final IResource file = marker.getResource();
        final IPath path = file.getFullPath();
        final IPath newPath = path.removeLastSegments(1).append(margs.get(0) + ".erl");
        file.move(newPath, true, null);
    }
View Full Code Here

Examples of org.eclipse.core.resources.IMarker

            // line number
            markers = erlProject.getWorkspaceProject().findMarkers(
                    DialyzerMarkerUtils.DIALYZE_WARNING_MARKER, true,
                    IResource.DEPTH_INFINITE);
            assertEquals(1, markers.length);
            final IMarker marker = markers[0];
            assertEquals(moduleName, marker.getResource().getName());
            assertEquals(lineNumber, marker.getAttribute(IMarker.LINE_NUMBER));
            assertEquals(message, marker.getAttribute(IMarker.MESSAGE));
        } finally {
            if (erlProject != null) {
                deleteProject(erlProject);
            }
        }
View Full Code Here

Examples of org.eclipse.core.resources.IMarker

            severity = res.findMaxProblemSeverity(IMarker.PROBLEM, true, depth);
        } else {
            final IMarker[] markers = res.findMarkers(IMarker.PROBLEM, true, depth);
            if (markers != null && markers.length > 0) {
                for (int i = 0; i < markers.length && severity != IMarker.SEVERITY_ERROR; i++) {
                    final IMarker curr = markers[i];
                    if (isMarkerInRange(curr, sourceElement)) {
                        final int val = curr.getAttribute(IMarker.SEVERITY, -1);
                        if (val == IMarker.SEVERITY_WARNING
                                || val == IMarker.SEVERITY_ERROR) {
                            severity = val;
                        }
                    }
View Full Code Here

Examples of org.eclipse.core.resources.IMarker

        try {
            final IMarker[] markers = file.findMarkers(
                    "org.erlide.test_support.tracingmarker", true, IResource.DEPTH_ONE);
            if (markers.length == 0) {
                System.out.println("create");
                final IMarker m = file
                        .createMarker("org.erlide.test_support.tracingmarker");
                m.setAttribute(IMarker.LINE_NUMBER, 5);
                m.setAttribute(IMarker.LOCATION, "5");
                m.setAttribute(IMarker.MESSAGE, "msg");
            } else {
                System.out.println("delete");
                markers[0].delete();
            }
        } catch (final CoreException e) {
View Full Code Here

Examples of org.eclipse.core.resources.IMarker

    public static void addMarker(final IResource resource, final String path,
            final String message, final int lineNumber, final int severity,
            final String markerKind) {
        try {
            final IMarker marker = resource.createMarker(markerKind);
            marker.setAttribute(IMarker.MESSAGE, message);
            marker.setAttribute(IMarker.SEVERITY, severity);
            marker.setAttribute(IMarker.LINE_NUMBER, lineNumber);
            marker.setAttribute(PATH_ATTRIBUTE, path);
        } catch (final CoreException e) {
            ErlLogger.debug(e);
        }
    }
View Full Code Here

Examples of org.eclipse.core.resources.IMarker

    public static void addProblemMarker(final IResource resource, final String path,
            final IResource compiledFile, final String message, final int lineNumber,
            final int severity) {
        try {
            final IMarker marker = resource.createMarker(PROBLEM_MARKER);
            marker.setAttribute(IMarker.MESSAGE, message);
            marker.setAttribute(IMarker.SEVERITY, severity);
            if (path != null && !new Path(path).equals(resource.getLocation())) {
                marker.setAttribute(MarkerUtils.PATH_ATTRIBUTE, path);
            }
            if (compiledFile != null) {
                marker.setAttribute(IMarker.SOURCE_ID, compiledFile.getFullPath()
                        .toString());
            }
            marker.setAttribute(IMarker.LINE_NUMBER, lineNumber != -1 ? lineNumber : 1);
        } catch (final CoreException e) {
        }
    }
View Full Code Here

Examples of org.eclipse.core.resources.IMarker

    public void createMarker(final IResource resource, final int lineNumber)
            throws CoreException {
        final IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
            @Override
            public void run(final IProgressMonitor monitor) throws CoreException {
                final IMarker marker = DebugMarkerUtils.createErlangLineBreakpointMarker(
                        resource, lineNumber, getModelIdentifier());
                setMarker(marker);
                resetClauseHead(lineNumber - 1, resource);
            }
        };
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.