Package com.biglybt.ui.swt.pifimpl
Class UISWTStatusEntryImpl
- java.lang.Object
-
- com.biglybt.ui.swt.pifimpl.UISWTStatusEntryImpl
-
- All Implemented Interfaces:
IMainStatusBar.CLabelUpdater
,UISWTStatusEntry
public class UISWTStatusEntryImpl extends java.lang.Object implements UISWTStatusEntry, IMainStatusBar.CLabelUpdater
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
check_scaled_image
private boolean
image_enabled
private java.lang.String
imageID
private java.util.concurrent.CopyOnWriteArrayList<java.lang.String>
imageIDstoDispose
private boolean
is_destroyed
private boolean
is_visible
private UISWTStatusEntryListener
listener
private org.eclipse.swt.widgets.Menu
menu
private MenuContextImpl
menu_context
private boolean
needs_disposing
private boolean
needs_layout
private boolean
needs_update
private org.eclipse.swt.graphics.Image
original_image
private org.eclipse.swt.graphics.Image
scaled_image
private java.lang.String
text
private AEMonitor
this_mon
private java.lang.String
tooltip
-
Fields inherited from interface com.biglybt.ui.swt.pif.UISWTStatusEntry
IMAGE_LED_GREEN, IMAGE_LED_GREY, IMAGE_LED_RED, IMAGE_LED_YELLOW
-
-
Constructor Summary
Constructors Constructor Description UISWTStatusEntryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
checkDestroyed()
void
created(MainStatusBar.CLabelPadding label)
void
destroy()
Destroys the status entry.MenuContext
getMenuContext()
Returns a menu context object to allow you to add menu items to the status entry.(package private) void
onClick()
private void
releaseOldImages()
void
setImage(int image_id)
Sets the image to display - the value here must be one of the IMAGE_ values defined above.void
setImage(org.eclipse.swt.graphics.Image image)
Sets the image to display.void
setImageEnabled(boolean enabled)
Indicates whether an image should be displayed or not.void
setListener(UISWTStatusEntryListener listener)
Sets a listener to be informed when the status entry has been clicked on.void
setText(java.lang.String text)
Sets the text to display in the status bar.void
setTooltipText(java.lang.String text)
Sets the tooltip text to associate with the status bar.void
setVisible(boolean visible)
Toggles the visibility of the entry in the status bar.boolean
update(MainStatusBar.CLabelPadding label)
private void
update0(MainStatusBar.CLabelPadding label)
-
-
-
Field Detail
-
this_mon
private AEMonitor this_mon
-
listener
private UISWTStatusEntryListener listener
-
menu_context
private MenuContextImpl menu_context
-
needs_update
private boolean needs_update
-
needs_layout
private boolean needs_layout
-
text
private java.lang.String text
-
tooltip
private java.lang.String tooltip
-
image_enabled
private boolean image_enabled
-
original_image
private org.eclipse.swt.graphics.Image original_image
-
check_scaled_image
private boolean check_scaled_image
-
scaled_image
private org.eclipse.swt.graphics.Image scaled_image
-
is_visible
private boolean is_visible
-
needs_disposing
private boolean needs_disposing
-
is_destroyed
private boolean is_destroyed
-
menu
private org.eclipse.swt.widgets.Menu menu
-
imageIDstoDispose
private java.util.concurrent.CopyOnWriteArrayList<java.lang.String> imageIDstoDispose
-
imageID
private java.lang.String imageID
-
-
Method Detail
-
checkDestroyed
private void checkDestroyed()
-
getMenuContext
public MenuContext getMenuContext()
Description copied from interface:UISWTStatusEntry
Returns a menu context object to allow you to add menu items to the status entry.- Specified by:
getMenuContext
in interfaceUISWTStatusEntry
- See Also:
MenuManager.addMenuItem(MenuContext, String)
-
update
public boolean update(MainStatusBar.CLabelPadding label)
- Specified by:
update
in interfaceIMainStatusBar.CLabelUpdater
-
releaseOldImages
private void releaseOldImages()
- Since:
- 4.0.0.5
-
update0
private void update0(MainStatusBar.CLabelPadding label)
-
onClick
void onClick()
-
destroy
public void destroy()
Description copied from interface:UISWTStatusEntry
Destroys the status entry.- Specified by:
destroy
in interfaceUISWTStatusEntry
-
setImage
public void setImage(int image_id)
Description copied from interface:UISWTStatusEntry
Sets the image to display - the value here must be one of the IMAGE_ values defined above. You must callUISWTStatusEntry.setImageEnabled(boolean)
to enable images to be displayed for this status entry.- Specified by:
setImage
in interfaceUISWTStatusEntry
-
setImage
public void setImage(org.eclipse.swt.graphics.Image image)
Description copied from interface:UISWTStatusEntry
Sets the image to display. You must callUISWTStatusEntry.setImageEnabled(boolean)
to enable images to be displayed for this status entry.- Specified by:
setImage
in interfaceUISWTStatusEntry
-
setImageEnabled
public void setImageEnabled(boolean enabled)
Description copied from interface:UISWTStatusEntry
Indicates whether an image should be displayed or not.- Specified by:
setImageEnabled
in interfaceUISWTStatusEntry
-
setListener
public void setListener(UISWTStatusEntryListener listener)
Description copied from interface:UISWTStatusEntry
Sets a listener to be informed when the status entry has been clicked on.- Specified by:
setListener
in interfaceUISWTStatusEntry
-
setText
public void setText(java.lang.String text)
Description copied from interface:UISWTStatusEntry
Sets the text to display in the status bar. If you want to prevent any text being displayed, pass null as a parameter.- Specified by:
setText
in interfaceUISWTStatusEntry
-
setTooltipText
public void setTooltipText(java.lang.String text)
Description copied from interface:UISWTStatusEntry
Sets the tooltip text to associate with the status bar. If you want to remove any tooltip text, pass null as a parameter.- Specified by:
setTooltipText
in interfaceUISWTStatusEntry
-
setVisible
public void setVisible(boolean visible)
Description copied from interface:UISWTStatusEntry
Toggles the visibility of the entry in the status bar.- Specified by:
setVisible
in interfaceUISWTStatusEntry
-
created
public void created(MainStatusBar.CLabelPadding label)
- Specified by:
created
in interfaceIMainStatusBar.CLabelUpdater
-
-