Skip to main content

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

The appearance of markers can be changed in the preferences (per marker type). I would think that you can also define the default appearence in the plugin.xml. Anyways, markers are provided by the eclipse platform, not by CDT.
 
Markus.


From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Gerhard H.Leonhartsberger
Sent: Sunday, August 24, 2008 10:45 PM
To: CDT General developers list.
Subject: [cdt-dev] Marker problem
Importance: Low

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