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
Element 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, mayHaveChildrengetLongLabel, getShortLabel, getToolTipText, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAttributedLabel, getLongLabel, getShortLabel, getToolTipText, toStringpublic 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)
Observerpublic void refresh()
DefaultManageableFolderprotected 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)
SubjectSubject interface
changes.
Implementors should do nothing when the same observer is added more
than once.public void detach(Observer observer)
SubjectSubject
interface changes.
Implementors should do nothing when the same observer is removed more
than once.public void notifyObservers(java.lang.Object subject,
UpdateMessage change)
SubjectnotifyObservers in interface Subjectsubject - the subject whose state has changed.change - what changed.public java.lang.Object getData()
DefaultElementElement interface. This implementation returns
this.getData in interface ElementgetData in class DefaultElementElement
instance.Element.getData()public javax.swing.Icon getIcon()
DefaultDisplayablegetIcon in interface DisplayablegetIcon in class DefaultDisplayableIcon to be displayed for the
Displayable.Displayable.getIcon()public void fireStateChanged()
public void fireStructureChanged()
protected Element getParent()