当前位置: 首页>>代码示例>>Java>>正文


Java CompositeImageDescriptor类代码示例

本文整理汇总了Java中org.eclipse.jface.resource.CompositeImageDescriptor的典型用法代码示例。如果您正苦于以下问题:Java CompositeImageDescriptor类的具体用法?Java CompositeImageDescriptor怎么用?Java CompositeImageDescriptor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CompositeImageDescriptor类属于org.eclipse.jface.resource包,在下文中一共展示了CompositeImageDescriptor类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: decorateImage

import org.eclipse.jface.resource.CompositeImageDescriptor; //导入依赖的package包/类
private Image decorateImage(final Image image, INSISInstallElement element)
{
    String name = Integer.toString(image.hashCode())+"$error"; //$NON-NLS-1$
    Image image2 = EclipseNSISPlugin.getImageManager().getImage(name);
    if(image2 == null) {
        EclipseNSISPlugin.getImageManager().putImageDescriptor(name,
                new CompositeImageDescriptor(){
                    @Override
                    protected void drawCompositeImage(int width, int height)
                    {
                        drawImage(image.getImageData(),0,0);
                        drawImage(cErrorImageData,0,getSize().y-cErrorImageData.height);
                    }

                    @Override
                    protected Point getSize()
                    {
                        return new Point(image.getBounds().width,image.getBounds().height);
                    }
                });
        image2 = EclipseNSISPlugin.getImageManager().getImage(name);
    }
    return image2;
}
 
开发者ID:henrikor2,项目名称:eclipsensis,代码行数:25,代码来源:NSISInstallElementLabelProvider.java

示例2: decorateImage

import org.eclipse.jface.resource.CompositeImageDescriptor; //导入依赖的package包/类
private Image decorateImage(NSISOutlineElement element)
{
    final Image image = (element.isRoot()?cRootImage:element.getIcon());
    final ImageData data;
    String hashCode;
    int severity = getElementSeverity(element);
    switch(severity) {
        case IMarker.SEVERITY_ERROR:
            hashCode = image.hashCode() + "$error"; //$NON-NLS-1$
            data = cErrorImageData;
            break;
        case IMarker.SEVERITY_WARNING:
            hashCode = image.hashCode() + "$warning"; //$NON-NLS-1$
            data = cWarningImageData;
            break;
        default:
            return image;
    }
    Image image2 = EclipseNSISPlugin.getImageManager().getImage(hashCode);
    if(image2 == null) {
        EclipseNSISPlugin.getImageManager().putImageDescriptor(hashCode,
                new CompositeImageDescriptor(){
                    @Override
                    protected void drawCompositeImage(int width, int height)
                    {
                        drawImage(image.getImageData(),0,0);
                        drawImage(data,0,getSize().y-data.height);
                    }

                    @Override
                    protected Point getSize()
                    {
                        return new Point(image.getBounds().width,image.getBounds().height);
                    }
                });
        image2 = EclipseNSISPlugin.getImageManager().getImage(hashCode);
    }
    return image2;
}
 
开发者ID:henrikor2,项目名称:eclipsensis,代码行数:40,代码来源:NSISOutlineLabelProvider.java


注:本文中的org.eclipse.jface.resource.CompositeImageDescriptor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。