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.
Modifier and Type | Field and Description |
---|---|
(package private) org.eclipse.swt.graphics.Color |
backgroundColor |
(package private) org.eclipse.swt.graphics.Color |
descriptionColor |
(package private) org.eclipse.swt.graphics.Font |
descriptionFont |
(package private) boolean |
dropShadows |
(package private) int |
dropShadowsAlphaStep |
protected java.util.ArrayList<org.eclipse.swt.graphics.Color> |
dropShadowsColors |
(package private) int |
dropShadowsSize |
(package private) org.eclipse.swt.graphics.Color |
foregroundColor |
(package private) org.eclipse.swt.graphics.Color |
selectionBackgroundColor |
(package private) org.eclipse.swt.graphics.Color |
selectionForegroundColor |
(package private) int |
selectionRadius |
(package private) boolean |
showLabels |
(package private) boolean |
showRoundedSelectionCorners |
(package private) org.eclipse.swt.graphics.Font |
textFont |
EMPTY_STRING, gallery, galleryBackgroundColor, galleryForegroundColor, OVERLAY_BOTTOM_LEFT, OVERLAY_BOTTOM_RIGHT, OVERLAY_TOP_LEFT, OVERLAY_TOP_RIGHT, selected
Constructor and Description |
---|
ListItemRenderer() |
Modifier and Type | Method and 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. |
drawAllOverlays, drawOverlayImages, getBackground, getFont, getForeground, getGallery, getImageOverlay, getOverlayRatio, getOverlaySize, isSelected, postDraw, setGallery, setSelected
protected java.util.ArrayList<org.eclipse.swt.graphics.Color> dropShadowsColors
boolean dropShadows
int dropShadowsSize
int dropShadowsAlphaStep
org.eclipse.swt.graphics.Color selectionBackgroundColor
org.eclipse.swt.graphics.Color selectionForegroundColor
org.eclipse.swt.graphics.Color foregroundColor
org.eclipse.swt.graphics.Color backgroundColor
org.eclipse.swt.graphics.Color descriptionColor
org.eclipse.swt.graphics.Font textFont
org.eclipse.swt.graphics.Font descriptionFont
boolean showLabels
boolean showRoundedSelectionCorners
int selectionRadius
public boolean isShowLabels()
public void setShowLabels(boolean showLabels)
public void preDraw(org.eclipse.swt.graphics.GC gc)
AbstractGalleryItemRenderer
preDraw
in class AbstractGalleryItemRenderer
(org.eclipse.swt.graphics.GC)
public void draw(org.eclipse.swt.graphics.GC gc, GalleryItem item, int index, int x, int y, int width, int height)
AbstractGalleryItemRenderer
draw
in class AbstractGalleryItemRenderer
org.eclipse.nebula.widgets.gallery.AbstractGalleryItemRenderer#draw(org
.eclipse.swt.graphics.GC,
org.eclipse.nebula.widgets.gallery.GalleryItem, int, int, int, int,
int)
public void setDropShadowsSize(int dropShadowsSize)
public boolean isDropShadows()
public void setDropShadows(boolean dropShadows)
public int getDropShadowsSize()
public void dispose()
dispose
in class AbstractGalleryItemRenderer
AbstractGalleryItemRenderer.dispose()
public 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)