public class DefaultManageableElement extends DefaultElement implements Subject, Observer
Modifier and Type | Class and Description |
---|---|
protected class |
DefaultManageableElement.TypeIterator<T>
Class to work around type-erasure.
|
Modifier and Type | Field and Description |
---|---|
protected Manageable |
manageable_ |
static int |
STATE_CHANGED |
static int |
STRUCTURE_CHANGED |
Constructor and Description |
---|
DefaultManageableElement(Manageable manageable) |
Modifier and Type | Method and Description |
---|---|
void |
attach(Observer observer)
Registers an observer interested in being notified when the internal
state of the class implementing the
Subject interface
changes. |
void |
detach(Observer observer)
Unregisters an observer that is not interested anymore in being notified
when the internal state of the class implementing the
Subject
interface changes. |
void |
fireStateChanged() |
void |
fireStructureChanged() |
java.lang.Object |
getData()
Part of the
Data interface. |
javax.swing.Icon |
getIcon()
This implementation returns a plain document icon.
|
Manageable |
getManageable() |
protected Element |
getParent() |
protected WaitCursor |
getWaitCursor()
Get the wait cursor associated with this elements.
|
protected boolean |
isWaitCursorEnabled() |
protected void |
moStateChanged(AsAdapterEvent e)
Called when the element detects that the MO it wraps has emitted a
state-changed event.
|
protected void |
moStructureChanged(StructureChangeEvent e)
Called when the element detects that the MO it wraps has emitted a
structure-change event.
|
void |
notifyObservers(java.lang.Object subject,
UpdateMessage change)
Notifies all observers that the state of the subject has changed.
|
void |
refresh()
Refresh the underlying model.
|
protected void |
setManageable(Manageable manageable) |
protected void |
setWaitCursorEnabled(boolean enabled)
Should the wait cursor be shown automatically.
|
void |
update(java.lang.Object observed,
UpdateMessage change)
Notification message.
|
getAttributes, getChildren, mayHaveChildren
getLongLabel, getShortLabel, getToolTipText, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getLongLabel, getShortLabel, getToolTipText, toString
public static final int STATE_CHANGED
public static final int STRUCTURE_CHANGED
protected Manageable manageable_
public DefaultManageableElement(Manageable manageable)
public Manageable getManageable()
protected void setManageable(Manageable manageable)
public void update(java.lang.Object observed, UpdateMessage change)
Observer
public void refresh()
DefaultManageableFolder
protected void moStructureChanged(StructureChangeEvent e)
protected void moStateChanged(AsAdapterEvent e)
protected WaitCursor getWaitCursor()
The wait cursor may be exclusive or shared with other elements
protected final void setWaitCursorEnabled(boolean enabled)
enabled
- protected final boolean isWaitCursorEnabled()
public void attach(Observer observer)
Subject
Subject
interface
changes.
Implementors should do nothing when the same observer is added more
than once.public void detach(Observer observer)
Subject
Subject
interface changes.
Implementors should do nothing when the same observer is removed more
than once.public void notifyObservers(java.lang.Object subject, UpdateMessage change)
Subject
notifyObservers
in interface Subject
subject
- the subject whose state has changed.change
- what changed.public java.lang.Object getData()
DefaultElement
Data
interface. This implementation returns
this
.getData
in interface Element
getData
in class DefaultElement
Element
instance.Data#getData()
public javax.swing.Icon getIcon()
DefaultDisplayable
getIcon
in interface Displayable
getIcon
in class DefaultDisplayable
Icon
to be displayed for the
Displayable
.Displayable.getIcon()
public void fireStateChanged()
public void fireStructureChanged()
protected Element getParent()