@Override public Image getImage(Object object) { // Get the adapters from the factory. // IItemLabelProvider itemLabelProvider = (IItemLabelProvider) adapterFactory.adapt(object, IItemLabelProvider.class); IItemColorProvider itemColorProvider = (IItemColorProvider) adapterFactory.adapt(object, IItemColorProvider.class); Image image = itemLabelProvider != null ? getImageFromObject(itemLabelProvider.getImage(object)) : getDefaultImage(object); if (itemColorProvider != null) { RGB rgb = (RGB) itemColorProvider.getBackground(object); if (rgb != null) { return getImageOverlay(image, rgb); } } return image; }
/** * Return the background RGB value for the given object. * @param object * @return an RGB color descriptor */ private RGB getBackgroundRGB(Object object) { try { if (MissionExtender.hasMissionSpecificClass(ItemColorProvider.class)) { ItemColorProvider provider = MissionExtender.construct(ItemColorProvider.class); RGB background = (RGB) provider.getBackground(object); if (background != null) { return background; } } } catch (ConstructionException e) { LogUtil.error(e); } IItemColorProvider itemColorProvider = getAdapter(object, IItemColorProvider.class); RGB backgroundColor = (itemColorProvider != null) ? (RGB)itemColorProvider.getBackground(object) : null; return backgroundColor; }
/** * This constructs an instance. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public BtsviewmodelItemProviderAdapterFactory() { supportedTypes.add(IEditingDomainItemProvider.class); supportedTypes.add(IStructuredItemContentProvider.class); supportedTypes.add(ITreeItemContentProvider.class); supportedTypes.add(IItemLabelProvider.class); supportedTypes.add(IItemPropertySource.class); supportedTypes.add(ITableItemLabelProvider.class); supportedTypes.add(ITableItemColorProvider.class); supportedTypes.add(ITableItemFontProvider.class); supportedTypes.add(IItemColorProvider.class); supportedTypes.add(IItemFontProvider.class); supportedTypes.add(IItemStyledLabelProvider.class); }
/** * This constructs an instance. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public BtsmodelItemProviderAdapterFactory() { supportedTypes.add(IEditingDomainItemProvider.class); supportedTypes.add(IStructuredItemContentProvider.class); supportedTypes.add(ITreeItemContentProvider.class); supportedTypes.add(IItemLabelProvider.class); supportedTypes.add(IItemPropertySource.class); supportedTypes.add(ITableItemLabelProvider.class); supportedTypes.add(ITableItemColorProvider.class); supportedTypes.add(ITableItemFontProvider.class); supportedTypes.add(IItemColorProvider.class); supportedTypes.add(IItemFontProvider.class); supportedTypes.add(IItemStyledLabelProvider.class); }
/** * This constructs an instance. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public BtsCorpusModelItemProviderAdapterFactory() { supportedTypes.add(IEditingDomainItemProvider.class); supportedTypes.add(IStructuredItemContentProvider.class); supportedTypes.add(ITreeItemContentProvider.class); supportedTypes.add(IItemLabelProvider.class); supportedTypes.add(IItemPropertySource.class); supportedTypes.add(ITableItemLabelProvider.class); supportedTypes.add(ITableItemColorProvider.class); supportedTypes.add(ITableItemFontProvider.class); supportedTypes.add(IItemColorProvider.class); supportedTypes.add(IItemFontProvider.class); supportedTypes.add(IItemStyledLabelProvider.class); }
@Override protected IFigure createFigure() { BarFigure figure = (BarFigure) super.createFigure(); IItemColorProvider provider = EMFUtils.adapt(getModel(), IItemColorProvider.class); if (provider != null) { Color bg = (Color) provider.getBackground(getModel()); if (bg != null) { figure.setNormalColorPalette(bg); } } return figure; }
/** * This constructs an instance. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public PlanItemProviderAdapterFactory() { supportedTypes.add(IEditingDomainItemProvider.class); supportedTypes.add(IStructuredItemContentProvider.class); supportedTypes.add(ITreeItemContentProvider.class); supportedTypes.add(IItemLabelProvider.class); supportedTypes.add(IItemPropertySource.class); supportedTypes.add(ITableItemLabelProvider.class); supportedTypes.add(ITableItemColorProvider.class); supportedTypes.add(ITableItemFontProvider.class); supportedTypes.add(IItemColorProvider.class); supportedTypes.add(IItemFontProvider.class); }
/** * This constructs an instance. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated NOT */ public ClickWatchModelItemProviderAdapterFactory() { supportedTypes.add(IEditingDomainItemProvider.class); supportedTypes.add(IStructuredItemContentProvider.class); supportedTypes.add(ITreeItemContentProvider.class); supportedTypes.add(IItemLabelProvider.class); supportedTypes.add(IItemColorProvider.class); supportedTypes.add(IItemPropertySource.class); }
/** * This constructs an instance. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EmfFragItemProviderAdapterFactory() { supportedTypes.add(IEditingDomainItemProvider.class); supportedTypes.add(IStructuredItemContentProvider.class); supportedTypes.add(ITreeItemContentProvider.class); supportedTypes.add(IItemLabelProvider.class); supportedTypes.add(IItemPropertySource.class); supportedTypes.add(IItemColorProvider.class); }
/** * This constructs an instance. <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public WaqtSalatItemProviderAdapterFactory() { supportedTypes.add(IEditingDomainItemProvider.class); supportedTypes.add(IStructuredItemContentProvider.class); supportedTypes.add(ITreeItemContentProvider.class); supportedTypes.add(IItemLabelProvider.class); supportedTypes.add(IItemPropertySource.class); supportedTypes.add(ITableItemLabelProvider.class); supportedTypes.add(ITableItemColorProvider.class); supportedTypes.add(ITableItemFontProvider.class); supportedTypes.add(IItemColorProvider.class); supportedTypes.add(IItemFontProvider.class); }
/** * This constructs an instance. <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public LocationsProviderItemProviderAdapterFactory() { supportedTypes.add(IEditingDomainItemProvider.class); supportedTypes.add(IStructuredItemContentProvider.class); supportedTypes.add(ITreeItemContentProvider.class); supportedTypes.add(IItemLabelProvider.class); supportedTypes.add(IItemPropertySource.class); supportedTypes.add(ITableItemLabelProvider.class); supportedTypes.add(ITableItemColorProvider.class); supportedTypes.add(ITableItemFontProvider.class); supportedTypes.add(IItemColorProvider.class); supportedTypes.add(IItemFontProvider.class); }