use of org.jboss.tools.hibernate.jpt.core.internal.context.persistence.PackageInfoRef in project jbosstools-hibernate by jbosstools.
the class HibernatePersistenceUnitClassesComposite method buildLabelProvider.
private ILabelProvider buildLabelProvider() {
return new LabelProvider() {
@Override
public Image getImage(Object element) {
Image image = null;
if (element instanceof ClassRef) {
ClassRef classRef = (ClassRef) element;
JavaPersistentType persistentType = classRef.getJavaPersistentType();
if (persistentType != null) {
image = this.getImage(persistentType);
// image = JpaMappingImageHelper.imageForTypeMapping(persistentType.getMappingKey());
} else if (classRef instanceof PackageInfoRef) {
PackageInfoRef packageInfoRef = (PackageInfoRef) classRef;
if (packageInfoRef.getJavaPackageInfo() != null) {
image = JavaPlugin.getImageDescriptorRegistry().get(JavaPluginImages.DESC_OBJS_PACKAGE);
}
}
}
if (image != null) {
return image;
}
return HibernateJptUIPlugin.getDefault().getImage("warning");
}
@Override
public String getText(Object element) {
ClassRef classRef = (ClassRef) element;
String name = classRef.getClassName();
if (name == null) {
name = JptJpaUiPersistenceMessages.PERSISTENCE_UNIT_CLASSES_COMPOSITE_CLASS_REF_NO_NAME;
}
return name;
}
};
}
Aggregations