Java Code Examples for org.eclipse.jface.viewers.ILabelProvider#getImage()

The following examples show how to use org.eclipse.jface.viewers.ILabelProvider#getImage() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IndexViewLabelProvider.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public Image getImage(Object element)
{
	List<ILabelProvider> providers = this.getProcessors();
	Image result = null;

	for (ILabelProvider provider : providers)
	{
		result = provider.getImage(element);

		if (result != null)
		{
			break;
		}
	}

	return result;
}
 
Example 2
Source File: ServiceKarafRepositoryMavenSetting.java    From tesb-studio-se with Apache License 2.0 6 votes vote down vote up
@Override
protected RepositoryPreferenceNode createKarafFolderNode(String id, ILabelProvider labelProvider, RepositoryNode node) {
    ServicesKarafRepositorySettingNode servicesKarafNode = null;

    if (labelProvider == null) {
        servicesKarafNode = new ServicesKarafRepositorySettingNode(id, node);
    } else {
        String label = labelProvider.getText(node);
        ImageDescriptor imageDesc = null;
        Image image = labelProvider.getImage(node);
        if (image != null) {
            imageDesc = ImageDescriptor.createFromImageData(image.getImageData());
        }
        servicesKarafNode = new ServicesKarafRepositorySettingNode(id, label, imageDesc, node);
    }
    return servicesKarafNode;

}
 
Example 3
Source File: RoutesKarafRepositoryMavenSetting.java    From tesb-studio-se with Apache License 2.0 6 votes vote down vote up
@Override
protected RepositoryPreferenceNode createKarafFolderNode(String id, ILabelProvider labelProvider, RepositoryNode node) {
    RoutesKarafRepositorySettingNode routesKarafNode = null;

    if (labelProvider == null) {
        routesKarafNode = new RoutesKarafRepositorySettingNode(id, node);
    } else {
        String label = labelProvider.getText(node);
        ImageDescriptor imageDesc = null;
        Image image = labelProvider.getImage(node);
        if (image != null) {
            imageDesc = ImageDescriptor.createFromImageData(image.getImageData());
        }
        routesKarafNode = new RoutesKarafRepositorySettingNode(id, label, imageDesc, node);
    }
    return routesKarafNode;
}
 
Example 4
Source File: GlobalDescriptionLabelProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Image getImage(Object element) {
	ILabelProvider descriptionLabelProvider = lookupDescriptionLabelProvider(element);
	if (descriptionLabelProvider != null) {
		return descriptionLabelProvider.getImage(element);
	} else {
		return null;
	}
}
 
Example 5
Source File: CompositeOutlineLabelProvider.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
@Override
public Image getImage(Object element)
{
	if (element instanceof ILanguageNode)
	{
		String language = ((ILanguageNode) element).getLanguage();
		ILabelProvider provider = fProvidersByLanguage.get(language);
		if (provider != null)
		{
			return provider.getImage(element);
		}
	}
	return getDefaultImage(element);
}
 
Example 6
Source File: SearchLabelProvider.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
protected Image getParticipantImage(Object element) {
	ILabelProvider lp= getLabelProvider(element);
	if (lp == null)
		return null;
	return lp.getImage(element);
}