public class ListItemRenderer extends AbstractGalleryItemRenderer
Alternate item renderer for the Gallery widget using a list style. Supports multi-line text, image, drop shadows and decorators.
Best with bigger width than height.
Decorator images can be set with Widget.setData(String, Object)
by using the following keys :
Supported types are org.eclipse.swt.Image for one single decorator and org.eclipse.swt.Image[] for multiple decorators.
NOTE: THIS WIDGET AND ITS API ARE STILL UNDER DEVELOPMENT.
OVERLAY_BOTTOM_LEFT, OVERLAY_BOTTOM_RIGHT, OVERLAY_TOP_LEFT, OVERLAY_TOP_RIGHT| Constructor | Description |
|---|---|
ListItemRenderer() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
dispose() |
|
void |
draw(org.eclipse.swt.graphics.GC gc,
GalleryItem item,
int index,
int x,
int y,
int width,
int height) |
Draws an item.
|
org.eclipse.swt.graphics.Color |
getBackgroundColor() |
|
org.eclipse.swt.graphics.Color |
getDescriptionColor() |
|
org.eclipse.swt.graphics.Font |
getDescriptionFont() |
Returns the font used for drawing item description or null if
system font is used.
|
int |
getDropShadowsSize() |
|
org.eclipse.swt.graphics.Color |
getForegroundColor() |
|
org.eclipse.swt.graphics.Color |
getSelectionBackgroundColor() |
|
org.eclipse.swt.graphics.Color |
getSelectionForegroundColor() |
|
org.eclipse.swt.graphics.Font |
getTextFont() |
Deprecated.
Use
Canvas.setFont(Font) or
GalleryItem.setFont(Font) instead. |
boolean |
isDropShadows() |
|
boolean |
isShowLabels() |
|
boolean |
isShowRoundedSelectionCorners() |
|
void |
preDraw(org.eclipse.swt.graphics.GC gc) |
This method is called before drawing the first item.
|
void |
setBackgroundColor(org.eclipse.swt.graphics.Color backgroundColor) |
|
void |
setDescriptionColor(org.eclipse.swt.graphics.Color descriptionColor) |
|
void |
setDescriptionFont(org.eclipse.swt.graphics.Font descriptionFont) |
Set the font for drawing item description or null to use system
font.
|
void |
setDropShadows(boolean dropShadows) |
|
void |
setDropShadowsSize(int dropShadowsSize) |
|
void |
setForegroundColor(org.eclipse.swt.graphics.Color foregroundColor) |
|
void |
setSelectionBackgroundColor(org.eclipse.swt.graphics.Color selectionColor) |
|
void |
setSelectionForegroundColor(org.eclipse.swt.graphics.Color selectionForegroundColor) |
|
void |
setShowLabels(boolean showLabels) |
|
void |
setShowRoundedSelectionCorners(boolean showRoundedSelectionCorners) |
|
void |
setTextFont(org.eclipse.swt.graphics.Font textFont) |
Deprecated.
Use
Canvas.setFont(Font) or
GalleryItem.setFont(Font) instead. |
getGallery, isSelected, postDraw, setGallery, setSelectedpublic boolean isShowLabels()
public void setShowLabels(boolean showLabels)
public void preDraw(org.eclipse.swt.graphics.GC gc)
AbstractGalleryItemRendererpreDraw in class AbstractGalleryItemRendererpublic void draw(org.eclipse.swt.graphics.GC gc,
GalleryItem item,
int index,
int x,
int y,
int width,
int height)
AbstractGalleryItemRendererdraw in class AbstractGalleryItemRendererpublic void setDropShadowsSize(int dropShadowsSize)
public boolean isDropShadows()
public void setDropShadows(boolean dropShadows)
public int getDropShadowsSize()
public void dispose()
dispose in class AbstractGalleryItemRendererpublic org.eclipse.swt.graphics.Color getSelectionBackgroundColor()
public void setSelectionBackgroundColor(org.eclipse.swt.graphics.Color selectionColor)
public org.eclipse.swt.graphics.Color getForegroundColor()
public void setForegroundColor(org.eclipse.swt.graphics.Color foregroundColor)
public org.eclipse.swt.graphics.Color getBackgroundColor()
public void setBackgroundColor(org.eclipse.swt.graphics.Color backgroundColor)
public org.eclipse.swt.graphics.Color getDescriptionColor()
public void setDescriptionColor(org.eclipse.swt.graphics.Color descriptionColor)
public org.eclipse.swt.graphics.Color getSelectionForegroundColor()
public void setSelectionForegroundColor(org.eclipse.swt.graphics.Color selectionForegroundColor)
public org.eclipse.swt.graphics.Font getTextFont()
Canvas.setFont(Font) or
GalleryItem.setFont(Font) instead.public void setTextFont(org.eclipse.swt.graphics.Font textFont)
Canvas.setFont(Font) or
GalleryItem.setFont(Font) instead.font - the font to setpublic org.eclipse.swt.graphics.Font getDescriptionFont()
public void setDescriptionFont(org.eclipse.swt.graphics.Font descriptionFont)
font - the font to setpublic boolean isShowRoundedSelectionCorners()
public void setShowRoundedSelectionCorners(boolean showRoundedSelectionCorners)