Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dynamic Languages Toolkit (DLTK) » [SOLVED]: LabelProvider not working in exported plugin...(LabelProvider works if the plugin is debugged or run from eclipse but then does not work from the exported plugin)
[SOLVED]: LabelProvider not working in exported plugin... [message #645716] Mon, 20 December 2010 07:39 Go to next message
Carl Knight is currently offline Carl KnightFriend
Messages: 13
Registered: December 2010
Junior Member
The IDE I'm developing using eclipse has an org.eclipse.dltk.ui.modelLabelProvider extension. The label provider class looks like this:

/**
 * @author carlk
 * Principally we wish to provide less confusing icons for the outline, etc.
 * i.e. a Circle with a D for a define; with an I for an instance and with a P for a property.
 */
public class ULabelProvider extends AppearanceAwareLabelProvider {

	private static Image defineImage = null; 
	private static Image instanceImage = null; 
	private static Image propertyImage = null; 
	private static Image eventImage = null;
	
	/**
	 * 
	 */
	public ULabelProvider() {
		super(UIDEPlugin.getDefault().getPreferenceStore());
		IStatus status = new Status(IStatus.INFO,
				UIDEPlugin.PLUGIN_ID, 0,
			      "Creating ULabelProvider", null);
		UIDEPlugin.getDefault().getLog().log(status);
	}

    @Override
    public String getText(Object element) {
        /*
         * Override this method and return null activate DLTK's default
         * behavior. Else way, parent class just returns toString(), which is
         * less convenient
         */
        return null;
    }
    
    /* (non-Javadoc)
	 * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
	 */
	@Override
	public Image getImage(Object element) {
		IStatus status = new Status(IStatus.INFO,
				UIDEPlugin.PLUGIN_ID, 0,
			      "Fetching image for object", null);
		UIDEPlugin.getDefault().getLog().log(status);
		
        IMember member = getMember(element);
        if (member != null){
	        try {
	            if (member.exists()) {
		            // Special icon for umajin type
		            if (member instanceof IType ){
			            int flags = member.getFlags();
			            if( (flags & IUModifiers.U_PROPERTY_MOD) != 0 )
			            	return getPropertyImage();
...


and works fine when I run the plugin from it's eclipse project (debug or run, both work fine) but if I then export the plugin and run eclipse (loading the exported plugin) my label provider does not appear to get loaded. I've added the logging of messages to the error log, and these messages (such as the creation of the label provider) only appear when the plugin is debugged/run from it's eclipse project.

This leads me to conclude that for some reason, the org.eclipse.dltk.ui.modelLabelProvider extension in the exported project is not being loaded. If I unzip the plugin jar file, everything appears to be intact.

Any ideas anyone?

Thanks.

- Carl.

[Updated on: Mon, 20 December 2010 20:47]

Report message to a moderator

[SOLVED]: LabelProvider not working in exported plugin... [message #645865 is a reply to message #645716] Mon, 20 December 2010 20:47 Go to previous message
Carl Knight is currently offline Carl KnightFriend
Messages: 13
Registered: December 2010
Junior Member
Turns out to be something with eclipse caching plugin information. eclipse -clean solved the problem.
Previous Topic:CompletionProposal.getCompletion() dead code?
Next Topic:Tcl: Syntax highlighting, package handling
Goto Forum:
  


Current Time: Fri Apr 19 08:25:46 GMT 2024

Powered by FUDForum. Page generated in 0.01997 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top