HowTo change the PHP CodeSniffer marker icon

  1. Choose a new icon, for example Example marker icon
  2. Copy this image icon to <path to your Eclipse>/plugins/org.phpsrc.eclipse.pti.tools.codesniffer_X.X.X.RXXXXXXXXXXXXXX/icons
  3. Open <path to your Eclipse>/plugins/org.phpsrc.eclipse.pti.tools.codesniffer_X.X.X.RXXXXXXXXXXXXXX/plugins.xml with a text editor
  4. Add the following code to the end of plugin.xml file, but before the closing plugin tag
    <extension point="org.eclipse.ui.editors.annotationTypes">
       <type
          name="org.phpsrc.eclipse.pti.tools.codesniffer.validator.phpToolCodeSnifferAnnotation" 
          super="org.eclipse.ui.workbench.texteditor.error" 
          markerType="org.phpsrc.eclipse.pti.tools.codesniffer.validator.phpToolCodeSnifferMarker" 
          markerSeverity="2">
       </type>
    </extension>
    
    <extension point="org.eclipse.ui.editors.markerAnnotationSpecification">
       <specification 
          annotationType="org.phpsrc.eclipse.pti.tools.codesniffer.validator.phpToolCodeSnifferAnnotation" 
          icon="icons/exc_catch.gif" 
          quickFixIcon="icons/exc_catch.gif" 
          textPreferenceKey="highlight.text" 
          colorPreferenceKey="highlight.color" 
          highlightPreferenceKey="highlight.background" 
          overviewRulerPreferenceKey="highlight.rulers.overview" 
          presentationLayer="4" 
          label="PHP_CodeSniffer Error" 
          textStylePreferenceKey="highlight.text.style"> 
       </specification>
    </extension>
    
  5. Change the icon and quickFixIcon attributes to your icon filename
  6. Save the plugin.xml file
  7. Restart your Eclipse with the -clean start-up flag

For more information about annotation specification options see http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_ui_editors_markerAnnotationSpecification.html

exc_catch.gif - Example marker icon (189 Bytes) Sven Kiera, 10/30/2010 09:55 am