You are currently browsing the tag archive for the ‘Eclipse’ tag.

If your plug-in runs flawlessly in your development environment (e.g., Eclipse PDE) but not in your production environment, you might suffer from a ClassDefNotFoundError.

The Problem:

First of all, you may consult the Eclipse Error Log in your production environment to confirm that there is actually a ClassDefNotFoundError thrown. Then, have a look into the JAR created by the Export Wizard: you won’t find the classes expected by your plug-in because the Export Wizard seems to miss some class files.

The Solution:

If you found that the Export Wizard is not exporting all class files but your plug-in works well in you development environment select the option Use class files compiled in the workspace (Options tab) in the Export Wizard.

Good luck!

Advertisements

As you know, recently, I started hacking on Eclipse. This time I needed to follow modifications made by a refactoring. Therefore, Eclipse introduced Refactoring Participants. After a while, I figured out how to participate in a Rename Refactoring (for fields and variables):

<extension
point="org.eclipse.ltk.core.refactoring.renameParticipants">
<renameParticipant id="a.b.c.MyParticipant" name="GraphSemanticsRenameParticipant">
<enablement>
    <with variable="affectedNatures">
        <iterate operator="or">
            <equals value="org.eclipse.jdt.core.javanature"></equals>
        </iterate>
    </with>
    <with variable="element">
        <or>
            <instanceof value="org.eclipse.jdt.core.IField"></instanceof>
            <instanceof value="org.eclipse.jdt.core.ILocalVariable"></instanceof>
        </or>
    </with>
</enablement>
</renameParticipant>
</extension>

I thought it would be as easy as this to hook into other refactorings but all the other Participators
(Copy, Create, Delete, Move in org.eclipse.ltk.core.refactoring.participants) never fired an event when I triggered other refactorings. After further investigations, I found a bug report telling me that there are still Refactoring Particaptors left to implement. At least I found a Participator for hooking into the Change Method Signature Refactoring:

<extension point="org.eclipse.jdt.core.manipulation.changeMethodSignatureParticipants">
<changeMethodSignatureParticipant
            id="a.b.c.MyChangeMethodSignatureParticipant"
            name="GraphSemanticsChangeMethodSignatureParticipant">
<enablement>
    <with variable="affectedNatures">
        <iterate operator="or">
            <equals value="org.eclipse.jdt.core.javanature"></equals>
        </iterate>
    </with>
    <with variable="element">
        <or>
            <instanceof value="org.eclipse.jdt.core.IMethod"></instanceof>
        </or>
    </with>
</enablement>
</changeMethodSignatureParticipant>
</extension>

Happy hacking! 🙂

Following this post, I had a hard time to figure out how to add a custom icon to my custom marker. But finally… . The only difference is that I removed the markerSeverity attribute from the annotationTypes extension point.

This “correction” may only be valid for Eclipse 3.7.1 (Indigo). Try it yourself and if you have any corrections just leave a comment. 🙂

<extension
 id="MyMarker"
 point="org.eclipse.core.resources.markers"
 name="MyMarker">
 <super type="org.eclipse.core.resources.textmarker" />
 <persistent value="false" />
</extension>

<extension point="org.eclipse.ui.editors.annotationTypes">
 <type
 super="org.eclipse.ui.workbench.texteditor.warning"
 markerType="a.b.c.MyMarker"
 name="a.b.c.MyMarkerAnnotation"/>
</extension>

<extension point="org.eclipse.ui.editors.markerAnnotationSpecification">
 <specification
 annotationType="a.b.c.MyMarkerAnnotation"
 icon="icons/myMarkerIcon.png" />
</extension>

Good luck!

Vellocet Club

A blog not only about my time in Sweden and Мiнск but also about the things I am concerned about.

RSS Dinge, die man so liest…

  • An error has occurred; the feed is probably down. Try again later.
October 2017
M T W T F S S
« Aug    
 1
2345678
9101112131415
16171819202122
23242526272829
3031