Methods Summary |
---|
private void | checkDestroyed()
if (is_destroyed) {throw new RuntimeException("object is destroyed, cannot be reused");}
|
public void | destroy()
try {
this_mon.enter();
this.is_visible = false;
this.listener = null;
this.image = null;
this.needs_disposing = true;
this.is_destroyed = true;
}
finally {
this_mon.exit();
}
|
void | onClick()
UISWTStatusEntryListener listener0 = listener; // Avoid race conditions.
if (listener0 != null) {listener.entryClicked(this);}
|
public void | setImage(int image_id)
String img_name;
switch (image_id) {
case IMAGE_LED_GREEN:
img_name = "greenled";
break;
case IMAGE_LED_RED:
img_name = "redled";
break;
case IMAGE_LED_YELLOW:
img_name = "yellowled";
break;
default:
img_name = "grayled";
break;
}
this.setImage(ImageRepository.getImage(img_name));
|
public void | setImage(org.eclipse.swt.graphics.Image image)
checkDestroyed();
this_mon.enter();
this.image = image;
this.needs_update = true;
this_mon.exit();
|
public void | setImageEnabled(boolean enabled)
checkDestroyed();
this_mon.enter();
this.image_enabled = enabled;
this.needs_update = true;
this_mon.exit();
|
public void | setListener(org.gudy.azureus2.ui.swt.plugins.UISWTStatusEntryListener listener)
checkDestroyed();
this.listener = listener;
|
public void | setText(java.lang.String text)
checkDestroyed();
this_mon.enter();
this.text = text;
this.needs_update = true;
this_mon.exit();
|
public void | setTooltipText(java.lang.String text)
checkDestroyed();
this_mon.enter();
this.tooltip = text;
this.needs_update = true;
this_mon.exit();
|
public void | setVisible(boolean visible)
checkDestroyed();
this_mon.enter();
this.is_visible = visible;
this.needs_update = true;
this_mon.exit();
|
public void | update(org.eclipse.swt.custom.CLabel label)
if (needs_disposing && !label.isDisposed()) {label.dispose(); return;}
if (!needs_update) {return;}
// This is where we do a big update.
try {
this_mon.enter();
update0(label);
}
finally {
this_mon.exit();
}
|
private void | update0(org.eclipse.swt.custom.CLabel label)
label.setText(text);
label.setToolTipText(tooltip);
label.setImage(image_enabled ? image : null);
label.setVisible(this.is_visible);
|