scala.swing

trait Publisher

[source: scala/swing/Publisher.scala]

trait Publisher
extends Reactor
Notifies registered reactions when an event is published. Publishers are also reactors and listen to themselves per default as a convenience. In order to reduce memory leaks, reactions are weakly referenced by default, unless they implement Reactions.StronglyReferenced. That way, the lifetime of reactions are more easily bound to the registering object, which are reactors in common client code and hold strong references to their reactions. As a result, reactors can be garbage collected even though they still have reactions registered at some publisher, but not vice versa since reactors (strongly) reference publishers they are interested in.
Direct Known Subclasses:
AbstractButton, Button, ComboBox.Editor, ComboBox, ComboBox.selection, Component, Frame, ListView.selection, Slider, TabbedPane, TabbedPane.selection, Table, Table.selection, TextComponent, TextComponent.Caret

Value Summary
protected val listeners : scala.swing.RefSet[PartialFunction]
Values and Variables inherited from Reactor
reactions
Method Summary
def publish (e : Event) : Unit
Notify all registered reactions.
def subscribe (listener : PartialFunction) : Unit
def unsubscribe (listener : PartialFunction) : Unit
Methods inherited from Reactor
listenTo, deafTo
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Value Details
protected val listeners : scala.swing.RefSet[PartialFunction]

Method Details
def subscribe(listener : PartialFunction) : Unit

def unsubscribe(listener : PartialFunction) : Unit

def publish(e : Event) : Unit
Notify all registered reactions.