public class StatusItem extends Object
hide() and unhidden using show().
The item can also be hidden by setting both image and text to null.
If the item displays text, then it is recommended to set the width hint to allow for the widest
string so that the item width stays constant. However, the CLabel control will elide text when
there is insuffient space to show the entire string and will place the text in a tooltip, if one
has been provided.CLabel| Modifier and Type | Class and Description |
|---|---|
static class |
LabelItem.Field |
| Modifier and Type | Field and Description |
|---|---|
protected org.eclipse.swt.graphics.Color |
bgColor |
protected org.eclipse.swt.graphics.Font |
font |
protected int |
id
Unique identity
|
protected org.eclipse.swt.graphics.Image |
image |
protected boolean |
isVisible
Visibility flag
|
protected String |
text |
protected String |
tooltip |
protected int |
width |
| Constructor and Description |
|---|
StatusItem(au.com.cybersearch2.controls.CustomLabelSpec itemConfiguration,
int id)
Create StatusItem object
|
| Modifier and Type | Method and Description |
|---|---|
int |
getId()
Returns identity
|
org.eclipse.swt.graphics.Image |
getImage() |
org.eclipse.swt.widgets.Menu |
getMenu() |
String |
getText() |
String |
getTooltip() |
protected boolean |
getVisibility()
Returns visibility status
|
int |
getWidth() |
void |
hide()
Hide this item.
|
boolean |
isVisible() |
org.eclipse.swt.custom.CLabel |
labelInstance(au.com.cybersearch2.controls.ControlFactory controlFactory,
org.eclipse.swt.widgets.Composite parent)
Return custom label initialized with values contained in this item
|
protected void |
setConfiguration(au.com.cybersearch2.controls.CustomLabelSpec itemConfiguration)
Set fields from given specification
|
void |
setEventListener(int eventType,
org.eclipse.swt.widgets.Listener listener)
Add listener
|
void |
setImage(org.eclipse.swt.graphics.Image image)
Set image
|
void |
setLabel(String text,
org.eclipse.swt.graphics.Image image)
Set both text and image
|
void |
setLabelItemListener(StatusItemListener statusItemListener)
Set listener to be called when this object is updated
|
void |
setLabelListener(LabelListener labelListener) |
void |
setMenu(org.eclipse.swt.widgets.Menu menu)
Set context menu, which will pop up when the item is right clicked
|
void |
setText(String text)
Set the text
|
void |
setTooltip(String tooltip)
Set tooltip
|
void |
setWidth(int width)
Set width hint
|
void |
show()
Show this item.
|
protected void |
signalRedraw()
Redraw entire status line
|
protected void |
signalUpdate(LabelItem.Field[] updateFields)
Update label only
|
void |
update(au.com.cybersearch2.controls.CustomLabelSpec updateSpec)
Update this object using given specification
|
protected boolean |
updateVisible(boolean isVisible)
Update isVisible flag if different from given value.
|
protected int id
protected boolean isVisible
protected org.eclipse.swt.graphics.Image image
protected String text
protected int width
protected org.eclipse.swt.graphics.Font font
protected org.eclipse.swt.graphics.Color bgColor
protected String tooltip
public StatusItem(au.com.cybersearch2.controls.CustomLabelSpec itemConfiguration,
int id)
itemConfiguration - Custom label data including width in number of charactersid - Unique identity with range starting from 0public int getId()
LabelItem.getId()public org.eclipse.swt.graphics.Image getImage()
LabelItem.getImage()public String getText()
LabelItem.getText()public int getWidth()
LabelItem.getWidth()public boolean isVisible()
LabelItem.isVisible()public void setImage(org.eclipse.swt.graphics.Image image)
image - Image objectLabelItem.setImage(org.eclipse.swt.graphics.Image)public void setText(String text)
text - StringLabelItem.setText(java.lang.String)public void setWidth(int width)
width - Width in number of charactersLabelItem.setWidth(int)public void setLabel(String text, org.eclipse.swt.graphics.Image image)
image - Image objectLabelItem.setLabel(java.lang.String, org.eclipse.swt.graphics.Image)public void hide()
public void show()
public void update(au.com.cybersearch2.controls.CustomLabelSpec updateSpec)
au.com.cybersearch2.statusbar.LabelItem#update(au.com.cybersearch2.statusbar.controls.ItemConfiguration)public void setLabelItemListener(StatusItemListener statusItemListener)
LabelItem.setLabelItemListener(au.com.cybersearch2.statusbar.StatusItemListener)public void setEventListener(int eventType,
org.eclipse.swt.widgets.Listener listener)
eventType - Listener event typelistener - Listener objectpublic void setLabelListener(LabelListener labelListener)
public void setTooltip(String tooltip)
tooltip - Text to appear on mouse over item - null or empty String disables featureLabelItem.setTooltip(java.lang.String)public String getTooltip()
LabelItem.getTooltip()public void setMenu(org.eclipse.swt.widgets.Menu menu)
menu - Menu objectLabelItem.setMenu(org.eclipse.swt.widgets.Menu)public org.eclipse.swt.widgets.Menu getMenu()
LabelItem.getMenu()public org.eclipse.swt.custom.CLabel labelInstance(au.com.cybersearch2.controls.ControlFactory controlFactory,
org.eclipse.swt.widgets.Composite parent)
controlFactory - SWT widget factoryparent - Parent compositeLabelItem.labelInstance(au.com.cybersearch2.controls.ControlFactory, org.eclipse.swt.widgets.Composite)protected void setConfiguration(au.com.cybersearch2.controls.CustomLabelSpec itemConfiguration)
itemConfiguration - The specificationprotected boolean updateVisible(boolean isVisible)
isVisible - booleanprotected boolean getVisibility()
protected void signalRedraw()
protected void signalUpdate(LabelItem.Field[] updateFields)
updateFields - Copyright © 2016. All rights reserved.