Java Code Examples for org.eclipse.core.resources.IResource#createMarker()

The following examples show how to use org.eclipse.core.resources.IResource#createMarker() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProblemMarkerBuilder.java    From CogniCrypt with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * addMarker Method that adds a Marker to a File, which can then be displayed as an error/warning in the IDE.
 *
 * @param file the IResource of the File to which the Marker is added
 * @param message the message the Marker is supposed to display
 * @param lineNumber the Line to which the Marker is supposed to be added
 * @param start the number of the start character for the Marker
 * @param end the number of the end character for the Marker
 */
private void addMarker(final IResource file, final String message, int lineNumber, final int start, final int end) {
	try {
		final IMarker marker = file.createMarker(Constants.MARKER_TYPE);
		marker.setAttribute(IMarker.MESSAGE, message);
		marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
		if (lineNumber == -1) {
			lineNumber = 1;
		}
		marker.setAttribute(IMarker.LINE_NUMBER, lineNumber);
		marker.setAttribute(IMarker.CHAR_START, start);
		marker.setAttribute(IMarker.CHAR_END, end);
		// IJavaModelMarker is important for the Quickfix Processor to work
		// correctly
		marker.setAttribute(IJavaModelMarker.ID, Constants.JDT_PROBLEM_ID);
	}
	catch (final CoreException e) {}
}
 
Example 2
Source File: MarkerUtil.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Add marker
 * 
 * @param resource
 * @param message
 * @param elementId
 * @param lineNumber
 * @param severity
 * @param priority
 * @throws CoreException
 */
public static void addMarker( IResource resource, String message,
		long elementId, int lineNumber, int severity, int priority )
		throws CoreException
{
	if ( resource != null )
	{
		IMarker marker = resource.createMarker( PROBLEMS_MARKER_ID );
		if ( message != null )
			marker.setAttribute( IMarker.MESSAGE, message );
		if ( lineNumber >= 0 )
			marker.setAttribute( IMarker.LINE_NUMBER, lineNumber );
		if ( elementId > 0 )
			marker
					.setAttribute( ELEMENT_ID,
							Integer.valueOf( (int) elementId ) );

		marker.setAttribute( IMarker.SEVERITY, severity );
		marker.setAttribute( IMarker.PRIORITY, priority );
	}
}
 
Example 3
Source File: SpellChecker.java    From texlipse with Eclipse Public License 1.0 6 votes vote down vote up
/**
     * Adds a spelling error marker to the given file.
     * 
     * @param file the resource to add the marker to
     * @param proposals list of proposals for correcting the error
     * @param charBegin  beginning offset in the file
     * @param wordLength length of the misspelled word
     */
    private void createMarker(IResource file, String[] proposals, int charBegin, String word, int lineNumber) {
        
        Map<String, ? super Object> attributes = new HashMap<String, Object>();
        attributes.put(IMarker.CHAR_START, Integer.valueOf(charBegin));
        attributes.put(IMarker.CHAR_END, Integer.valueOf(charBegin+word.length()));
        attributes.put(IMarker.LINE_NUMBER, Integer.valueOf(lineNumber));
        attributes.put(IMarker.SEVERITY, Integer.valueOf(IMarker.SEVERITY_WARNING));
        attributes.put(IMarker.MESSAGE, 
            MessageFormat.format(TexlipsePlugin.getResourceString("spellMarkerMessage"),
                new Object[] { word }));
        try {
            IMarker marker = file.createMarker(SPELLING_ERROR_MARKER_TYPE);
            marker.setAttributes(attributes);
            proposalMap.put(marker, proposals);
/*            MarkerUtilities.createMarker(file, attributes, SPELLING_ERROR_MARKER_TYPE);
            addProposal(file, charBegin, charBegin+word.length(), proposals);*/
            
        } catch (CoreException e) {
            TexlipsePlugin.log("Adding spelling marker", e);
        }
    }
 
Example 4
Source File: TodoTaskMarkerManager.java    From xds-ide with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Creates and returns the "to do" task marker with the specified position 
 * on the given resource. 
 * 
 * @param project a project to operate on, must not be <tt>null</tt>
 * @param file a source file in which the task takes place or <tt>null</tt>
 * @param task instance of discovered task.
 * @param message text of the task
 * @param position a start position of the task
 * @param endOffset a end offset of the task
 * 
 * @return the handle of the new marker. 
 */
public static IMarker createMarker( IResource resource
                                  , TextPosition position, int endOffset 
                                  , TodoTask task, String message
                                  ) throws CoreException
{
    IMarker marker = resource.createMarker(IMarker.TASK);
    marker.setAttribute(IMarker.MESSAGE,     createMessage(task, message));
    marker.setAttribute(IMarker.PRIORITY,    task.priority.markerPriority);
    marker.setAttribute(IMarker.LINE_NUMBER, position.getLine());
    marker.setAttribute(IMarker.CHAR_START,  position.getOffset());
    marker.setAttribute(IMarker.CHAR_END,    endOffset);
    marker.setAttribute(IMarker.USER_EDITABLE, Boolean.FALSE);
    
    return marker;
}
 
Example 5
Source File: ErrorMarkerGenerator.java    From CogniCrypt with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Adds crypto-misuse error marker with message {@link message} into file {@link sourceFile} at Line {@link line}.
 *
 * @param markerType name of the error
 * @param id unique id of the error
 * @param sourceFile File the marker is generated into
 * @param line Line the marker is generated at
 * @param message Error Message
 * @param sev Severities type
 * @return <code>true</code>/<code>false</code> if error marker was (not) added successfully
 */
public boolean addMarker(final String markerType, final int id, final IResource sourceFile, final int line, final String message, final String crySLRuleName, final String jimpleCode, final Severities sev,
		final HashMap<String, String> additionalErrorInfos, boolean isSuppressed) {

	if (!sourceFile.exists() || !sourceFile.isAccessible()) {
		Activator.getDefault().logError(Constants.NO_RES_FOUND);
		return false;
	}

	IMarker marker;
	try {
		marker = sourceFile.createMarker(markerType);
		marker.setAttribute("errorType", markerType);
		marker.setAttribute(IMarker.LINE_NUMBER, line);
		marker.setAttribute(IMarker.MESSAGE, message);
		marker.setAttribute("crySLRuleName", crySLRuleName);
		marker.setAttribute("errorJimpleCode", jimpleCode);
		marker.setAttribute(IMarker.PRIORITY, IMarker.PRIORITY_HIGH);
		if (isSuppressed) {
			marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO);
		} else {
			marker.setAttribute(IMarker.SEVERITY,
					(sev == Severities.Error) ? IMarker.SEVERITY_ERROR : ((sev == Severities.Warning) ? IMarker.SEVERITY_WARNING : IMarker.SEVERITY_INFO));
		}
		marker.setAttribute(IMarker.SOURCE_ID, id);

		if (markerType.equals(Constants.REQUIRED_PREDICATE_MARKER_TYPE)) {
			marker.setAttribute("predicate", additionalErrorInfos.get("predicate"));
			marker.setAttribute("predicateParamCount", additionalErrorInfos.get("predicateParamCount"));
			marker.setAttribute("errorParam", additionalErrorInfos.get("errorParam"));
			marker.setAttribute("errorParamIndex", additionalErrorInfos.get("errorParamIndex"));
		}

	}
	catch (final CoreException e) {
		Activator.getDefault().logError(e);
		return false;
	}
	return this.markers.add(marker);
}
 
Example 6
Source File: XmlValidator.java    From google-cloud-eclipse with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a marker from a given {@link ElementProblem}
 */
static void createMarker(IResource resource, ElementProblem problem)
    throws CoreException {
  IMarker marker = resource.createMarker(problem.getMarkerId());
  marker.setAttribute(IMarker.SEVERITY, problem.getIMarkerSeverity());
  marker.setAttribute(IMarker.MESSAGE, problem.getMessage());
  int lineNumber = problem.getStart().getLineNumber();
  marker.setAttribute(IMarker.LOCATION, "line " + lineNumber);
  marker.setAttribute(IMarker.LINE_NUMBER, lineNumber);
}
 
Example 7
Source File: CodewindEclipseApplication.java    From codewind-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
private void validationEvent(int severity, String filePath, String message, String quickFixId, String quickFixDescription) {
        // Create a marker and quick fix (if available) on the specific file if there is one or the project if not.
    	try {
        	IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
        	if (project != null && project.isAccessible()) {
	        	IResource resource = project;
	        	if (filePath != null && !filePath.isEmpty()) {
		        	IPath path = new Path(filePath);
		        	if (filePath.startsWith(project.getName())) {
		        		path = path.removeFirstSegments(1);
		        	}
		        	IFile file = project.getFile(path);
		        	if (file != null && file.exists()) {
		        		resource = file;
		        	}
	        	}
	            final IMarker marker = resource.createMarker(MARKER_TYPE);
	            marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
	            marker.setAttribute(IMarker.MESSAGE, message);
//	            if (quickFixId != null && !quickFixId.isEmpty()) {
//	            	marker.setAttribute(CONNECTION_URL, connection.baseUrl.toString());
//	            	marker.setAttribute(PROJECT_ID, projectID);
//	            	marker.setAttribute(QUICK_FIX_ID, quickFixId);
//	            	marker.setAttribute(QUICK_FIX_DESCRIPTION, quickFixDescription);
//	            }
        	}
        } catch (CoreException e) {
            Logger.logError("Failed to create a marker for the " + name + " application: " + message, e); //$NON-NLS-1$
        }
    }
 
Example 8
Source File: AddMarkerHandler.java    From codeexamples-eclipse with Eclipse Public License 1.0 5 votes vote down vote up
private void writeMarkers(IResource resource) {
	try {
		IMarker marker = resource.createMarker(IMarker.TASK);
		marker.setAttribute(IMarker.MESSAGE, "This is a task");
		marker.setAttribute(IMarker.PRIORITY, IMarker.PRIORITY_HIGH);
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
Example 9
Source File: MarkerReporter.java    From spotbugs with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void addMarker(MarkerParameter mp) throws CoreException {
    Map<String, Object> attributes = createMarkerAttributes(mp);
    if (attributes.isEmpty()) {
        collection.remove(mp.bug);
        return;
    }
    IResource markerTarget = mp.resource.getMarkerTarget();
    IMarker[] existingMarkers = markerTarget.findMarkers(mp.markerType, true, IResource.DEPTH_ZERO);

    // XXX Workaround for bug 2785257 (has to be solved better)
    // see
    // http://sourceforge.net/tracker/?func=detail&atid=614693&aid=2785257&group_id=96405
    // currently we can't run FB only on a subset of classes related to the
    // specific
    // source folder if source folders have same class output directory.
    // In this case the classes from BOTH source folders are examined by FB
    // and
    // new markers can be created for issues which are already reported.
    // Therefore here we check if a marker with SAME bug id is already
    // known,
    // and if yes, delete it (replacing with newer one)
    if (existingMarkers.length > 0) {
        IMarker oldMarker = findSameBug(attributes, existingMarkers);
        if (oldMarker != null) {
            oldMarker.delete();
        }
    }
    IMarker newMarker = markerTarget.createMarker(mp.markerType);
    newMarker.setAttributes(attributes);
}
 
Example 10
Source File: RadlValidatingVisitor.java    From RADL with Apache License 2.0 5 votes vote down vote up
private void validateRadl(IResource resource) throws CoreException {
  if ("radl".equals(resource.getFileExtension()) && resource instanceof IFile) {
    IFile file = (IFile)resource;
    Collection<Issue> issues = new ArrayList<>();
    validator.validate(file.getContents(), issues);
    for (Issue issue : issues) {
      IMarker marker = resource.createMarker(MARKER_TYPE);
      marker.setAttribute(IMarker.SEVERITY, levelToSeverity(issue.getLevel()));
      marker.setAttribute(IMarker.LINE_NUMBER, issue.getLine());
      marker.setAttribute(IMarker.MESSAGE, issue.getMessage());
    }
  }
}
 
Example 11
Source File: EditorUtil.java    From tlaplus with MIT License 5 votes vote down vote up
/**
 * Signals using a marker that the module should be read-only
 * if isReadOnly is true or not read-only if isReadOnly is false.
 * 
 * @param module
 * @param isReadOnly
 * @throws CoreException 
 */
public static void setReadOnly(IResource module, boolean isReadOnly)
{
    try
    {

        if (module.exists())
        {
            IMarker marker;
            // Try to find any existing markers.
            IMarker[] foundMarkers = module.findMarkers(READ_ONLY_MODULE_MARKER, false, IResource.DEPTH_ZERO);

            // There should only be one such marker at most.
            // In case there is more than one existing marker,
            // remove extra markers.
            if (foundMarkers.length > 0)
            {
                marker = foundMarkers[0];
                // remove trash if any
                for (int i = 1; i < foundMarkers.length; i++)
                {
                    foundMarkers[i].delete();
                }
            } else
            {
                // Create a new marker if no existing ones.
                marker = module.createMarker(READ_ONLY_MODULE_MARKER);
            }

            // Set the boolean attribute to indicate if the marker is running.
            marker.setAttribute(IS_READ_ONLY_ATR, isReadOnly);
        }
    } catch (CoreException e)
    {
        Activator.getDefault().logError("Error setting module " + module + " to read only.", e);
    }

}
 
Example 12
Source File: TypeScriptResourceUtil.java    From typescript.java with MIT License 5 votes vote down vote up
public static IMarker addTscMarker(IResource resource, String message, int severity, int lineNumber)
		throws CoreException {
	IMarker marker = resource.createMarker(TSC_MARKER_TYPE);
	marker.setAttribute(IMarker.MESSAGE, message);
	marker.setAttribute(IMarker.SEVERITY, severity);
	marker.setAttribute(IMarker.LINE_NUMBER, lineNumber);
	return marker;
}
 
Example 13
Source File: MarkerUtilities.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Create a marker with the given markerID on a resource.
 */
public static IMarker createMarker(String markerID, IResource resource,
    String message, int severity) throws CoreException {
  IMarker marker = resource.createMarker(markerID);
  marker.setAttribute(IMarker.SEVERITY, severity);
  marker.setAttribute(IMarker.MESSAGE, message);
  return marker;
}
 
Example 14
Source File: ReviewMarkerManager.java    From git-appraise-eclipse with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Adds a marker for the given comment, assuming it has a location attached.
 */
private void markComment(
    TaskRepository taskRepository, TaskAttribute commentAttr, String taskId) {
  IProject project = AppraisePluginUtils.getProjectForRepository(taskRepository);

  String filePath = getFilePath(commentAttr);
  IResource resource = project;
  if (filePath != null) {
    resource = project.getFile(filePath);
    if (resource == null || !resource.exists()) {
      return;
    }
  }

  try {
    IMarker marker = resource.createMarker(AppraiseUiPlugin.REVIEW_TASK_MARKER_ID);
    marker.setAttribute(IMarker.MESSAGE, getMessage(commentAttr));
    marker.setAttribute(IMarker.TRANSIENT, true);
    if (filePath != null) {
      marker.setAttribute(IMarker.LINE_NUMBER, getLineNumber(commentAttr));
    }
    marker.setAttribute(IMarker.USER_EDITABLE, false);
    TaskAttribute authorAttribute = commentAttr.getMappedAttribute(TaskAttribute.COMMENT_AUTHOR);
    if (authorAttribute != null) {
      marker.setAttribute(
          ReviewMarkerAttributes.REVIEW_AUTHOR_MARKER_ATTRIBUTE, authorAttribute.getValue());
    }
    marker.setAttribute(
        ReviewMarkerAttributes.REVIEW_DATETIME_MARKER_ATTRIBUTE,
        commentAttr.getMappedAttribute(TaskAttribute.COMMENT_DATE).getValue());
    marker.setAttribute(
        ReviewMarkerAttributes.REVIEW_ID_MARKER_ATTRIBUTE, getCommentId(commentAttr));
    marker.setAttribute(
        ReviewMarkerAttributes.REVIEW_RESOLVED_MARKER_ATTRIBUTE,
        getResolvedDisplayText(commentAttr));
    marker.setAttribute("TaskId", taskId);
  } catch (CoreException e) {
    AppraiseUiPlugin.logError("Failed to create marker at " + filePath, e);
  }
}
 
Example 15
Source File: Animator.java    From txtUML with Eclipse Public License 1.0 5 votes vote down vote up
private void addAnimationMarker(EObject eobject) {
	IResource resource = null;
	IWorkspace workspace = ResourcesPlugin.getWorkspace(); 
	if (workspace != null) {
		URI uri = eobject.eResource().getURI();
		if (uri.isPlatform()) {
			resource = workspace.getRoot().getFile(new Path(uri.toPlatformString(true)));
		} else {
			IPath fs = new Path(uri.toFileString());
			for (IProject proj : workspace.getRoot().getProjects()) {
				if (proj.getLocation().isPrefixOf(fs)) {
					IPath relative = fs.makeRelativeTo(proj.getLocation());
					resource = proj.findMember(relative);
				}
			}
		}
	}
	if (resource != null && resource.exists()) {
		IMarker imarker = null;
		try {
			imarker = resource.createMarker(AnimationConfig.TXTUML_ANIMATION_MARKER_ID);
			imarker.setAttribute(EValidator.URI_ATTRIBUTE, URI.createPlatformResourceURI(resource.getFullPath().toString(), true) + "#" + EcoreUtil.getURI(eobject).fragment());
		} catch (CoreException e) {
			e.printStackTrace();
		}
		if (imarker != null) {
			IPapyrusMarker marker = PapyrusMarkerAdapter.wrap(eobject.eResource(), imarker);
			eobjectToMarker.put(eobject, marker);
		}
	}
}
 
Example 16
Source File: ToolMarkersHelper.java    From goclipse with Eclipse Public License 1.0 4 votes vote down vote up
public void addErrorMarker(IResource resource, ToolSourceMessage toolMessage, String markerType)
		throws CoreException {
	if(!resource.exists())
		return;
	
	// TODO: check if marker already exists?
	IMarker marker = resource.createMarker(markerType);
	
	marker.setAttribute(IMarker.SEVERITY, markerSeverityFrom(toolMessage.getSeverity()));
	marker.setAttribute(IMarker.MESSAGE, toolMessage.getMessage());
	
	if(!(resource instanceof IFile)) {
		return;
	}
	
	IFile file = (IFile) resource;
	
	int line = toolMessage.getFileLineNumber();
	if(line >= 0) {
		marker.setAttribute(IMarker.LINE_NUMBER, line);
	}
	
	SourceLineColumnRange range = toolMessage.range;
	
	SourceRange messageSR;
	
	try {
		Document doc = getDocumentForLocation(file);
		messageSR = getMessageRangeUsingDocInfo(range, doc);
	} catch(IOException e) {
		return;
	}
	
	if(messageSR != null) {
		try {
			marker.setAttribute(IMarker.CHAR_START, messageSR.getStartPos());
			marker.setAttribute(IMarker.CHAR_END, messageSR.getEndPos());
		} catch (CoreException ce) {
			EclipseCore.logStatus(ce);
		}
	}
	
}
 
Example 17
Source File: GotoMatchingParenHandler.java    From tlaplus with MIT License 4 votes vote down vote up
/**
 * The method called when the user executes the Goto Matching Paren command.
 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
 */
public Object execute(ExecutionEvent event) throws ExecutionException {
    TLAEditor tlaEditor = EditorUtil.getTLAEditorWithFocus();
    document = tlaEditor.publicGetSourceViewer().getDocument();
    
    try {
        ITextSelection selection = (ITextSelection) tlaEditor
                .getSelectionProvider().getSelection();
        Region selectedRegion = new Region(selection.getOffset(),
                selection.getLength());
        
        int selectedParenIdx = getSelectedParen(selectedRegion);
        
        int lineNumber = selection.getStartLine();
          // Note: if the selection covers multiple lines, then 
          // selectParenIdx should have thrown an exception.
        if (lineNumber < 0) {
            throw new ParenErrorException("Toolbox bug: bad selected line computed", null, null);
        }
        
        setLineRegions(lineNumber);
        setRegionInfo();
        
        if (selectedParenIdx < PCOUNT) {
            findMatchingRightParen(selectedParenIdx);
        } 
        else {
            findMatchingLeftParen(selectedParenIdx);
        }
        tlaEditor.selectAndReveal(currLoc, 0);            
    } catch (ParenErrorException e) {
        /*
         * Report the error.
         */
        IResource resource = ResourceHelper
                .getResourceByModuleName(tlaEditor.getModuleName());
        ErrorMessageEraser listener = new ErrorMessageEraser(tlaEditor,
                resource);
        tlaEditor.getViewer().getTextWidget().addCaretListener(listener);
        tlaEditor.getEditorSite().getActionBars().getStatusLineManager().setErrorMessage(e.message);
        
        Region[] regions = e.regions;
        if (regions[0] != null) {
            try {
                // The following code was largely copied from the The
                // ShowUsesHandler class.
                Spec spec = ToolboxHandle.getCurrentSpec();
                spec.setMarkersToShow(null);
                IMarker[] markersToShow = new IMarker[2];
                for (int i = 0; i < 2; i++) {
                    IMarker marker = resource
                            .createMarker(PAREN_ERROR_MARKER_TYPE);
                    Map<String, Integer> markerAttributes = new HashMap<String, Integer>(
                            2);
                    markerAttributes.put(IMarker.CHAR_START, new Integer(
                            regions[i].getOffset()));
                    markerAttributes.put(
                            IMarker.CHAR_END,
                            new Integer(regions[i].getOffset()
                                    + regions[i].getLength()));
                    marker.setAttributes(markerAttributes);

                    markersToShow[i] = marker;
                }
                spec.setMarkersToShow(markersToShow);
            } catch (CoreException exc) {
                System.out
                        .println("GotoMatchingParenHandler.execute threw CoreException");
            }
        }
    }
    return null;
}
 
Example 18
Source File: SolidityBuilder.java    From uml2solidity with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Create the marker from the compiler output.
 * 
 * @param error
 */
private void createMarker(String error) {
	String[] errors = error.trim().split(MESSAGE_SPLITTER);
	Pattern pattern = Pattern.compile(ERROR_PARSER, Pattern.DOTALL | Pattern.MULTILINE);
	IPath location = getProject().getLocation();

	for (String errorMessage : errors) {
		Matcher matcher = pattern.matcher(errorMessage.trim());
		if (!matcher.matches())
			continue;

		String filename = matcher.group(1).trim();
		String lineNumber = matcher.group(2);
		String errorType = matcher.group(4).trim();
		String errorM = matcher.group(5).trim();

		Path path = new Path(filename);
		if (location.isPrefixOf(path)) {
			IPath filePath = path.removeFirstSegments(location.segmentCount());
			IResource resource = getProject().findMember(filePath);
			if (!resource.exists())
				continue;

			try {
				int lineN = Integer.parseInt(lineNumber);
				IMarker marker = resource.createMarker(SOLIDITY_MARKER_ID);
				Map<String, Object> attributes = new HashMap<String, Object>();

				attributes.put(IMarker.MESSAGE, errorM);
				attributes.put(IMarker.LINE_NUMBER, lineN);
				if ("Error".equalsIgnoreCase(errorType))
					attributes.put(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
				else if ("Warning".equalsIgnoreCase(errorType))
					attributes.put(IMarker.SEVERITY, IMarker.SEVERITY_WARNING);
				else
					attributes.put(IMarker.SEVERITY, IMarker.SEVERITY_INFO);

				marker.setAttributes(attributes);
			} catch (Exception e) {
				Activator.logError("Error creating marker for: " + filename, e);
			}
		}
	}
}
 
Example 19
Source File: MarkerCreator.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void createMarker(Issue issue, IResource resource, String markerType) throws CoreException {
	IMarker marker = resource.createMarker(markerType);
	setMarkerAttributes(issue, resource, marker);
}
 
Example 20
Source File: TaskMarkerCreator.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void createMarker(Task task, IResource resource, String markerType) throws CoreException {
	IMarker marker = resource.createMarker(markerType);
	setMarkerAttributes(task, resource, marker);
}