本文整理汇总了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;
}
示例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;
}