Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Marker problem

Hi

I want to create markers for C/C++ resource. Here is the way I did it:

plugin.xml:
   <extension
         id="net.sf.ecut.cppunit.task"
         name="%Task.name"
         point="org.eclipse.core.resources.markers">
      <super
            type="org.eclipse.core.resources.taskmarker">
      </super>
      <persistent
            value="true">
      </persistent>
      <attribute
            name="%Task.name">
      </attribute>
   </extension>

source code:
IMarker marker = resource.createMarker("net.sf.ecut.cppunit.task"); //$NON-NLS-1$
marker.setAttribute(IMarker.PRIORITY, new Integer(IMarker.PRIORITY_NORMAL));
marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO);

String methodName = method.getElementName();
String message = WizardMessages.getFormattedString("NewTestClassWizardPageOne.marker.message", methodName); //$NON-NLS-1$
marker.setAttribute(IMarker.MESSAGE, message);

ISourceRange markerRange = ((IFunctionDeclaration) method).getSourceRange();
marker.setAttribute(IMarker.CHAR_START, new Integer(markerRange.getStartPos()));
marker.setAttribute(IMarker.CHAR_END, new Integer(markerRange.getStartPos() + markerRange.getLength()));

The problem I have is that the marker is not visible but present when I programmatically search for them. Any suggestions what's wrong here?

Cheers 
Gerhard

Back to the top