[SOLVED]: LabelProvider not working in exported plugin... [message #645716] |
Mon, 20 December 2010 07:39 |
Carl Knight 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
|
|
|
|
Powered by
FUDForum. Page generated in 0.04186 seconds