Observer (class)
public abstract shared Observer
Package: CURL.UTIL.OBSERVER
Direct Known Subclasses: PieSet, DataSeriesAxis, ChartLayer, DelegatingLookAndFeel, StandardLookAndFeel, SkinnableBaseDropdownUI, TreeControl, SkinnableMenuPaneUI, StringDataModelRange, StandardMenuPaneUI, StandardDropdownHelper, StandardMenuBarUI, DelegatingCommand, GuiManager, CommandBinding

Use this abstract class as the super class for objects that would like to observe messages from other Observable objects.


Methods
handle-observer-message:This method is called by the observed object when it wants to send a message. An Observer must implement this method to perform an operation when a change occurs.
protected {Observer.handle-observer-message
    sender:Observable,
    message:any
}:void
observe:Start observing an object for messages.
public {Observer.observe
    o:Observable,
    error-if-present?:bool = false
}:void
stop-observing:Stop observing an object for messages.
public {Observer.stop-observing
    o:Observable,
    error-if-missing?:bool = true
}:void
Methods inherited from Object: object-describe, object-describe-for-debugging, object-serialize

Method Details
handle-observer-message (method)
protected {Observer.handle-observer-message
    sender:Observable,
    message:any
}:void

This method is called by the observed object when it wants to send a message. An Observer must implement this method to perform an operation when a change occurs.

sender: the Observable object that's changed
message: This contains more detailed information about the change from the Observer. If no more information is present, then this is null.


observe (method)
public {Observer.observe
    o:Observable,
    error-if-present?:bool = false
}:void

Start observing an object for messages.

o: the object to observe
error-if-present?: is a flag that indicates if this method generates an error when you try to add an observer that already exists. If error-if-present? is true, this method throws an Error when you try to add an observer that already exists. If error-if-present? is false, this method does not generate an error.


stop-observing (method)
public {Observer.stop-observing
    o:Observable,
    error-if-missing?:bool = true
}:void

Stop observing an object for messages.

o: the object to stop observing
error-if-missing?: is a flag that indicates if this method generates an error when you try to remove an element that does not exist. If error-if-missing? is true, this method throws an Error when you try to remove an observer that does not exist. By default, error-if-missing? is true. If error-if-missing? is false, this method does not generate an error.