本文整理匯總了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;
}