summaryrefslogtreecommitdiff
path: root/src/swing
diff options
context:
space:
mode:
authorIngo Maier <ingo.maier@epfl.ch>2009-08-22 11:56:57 +0000
committerIngo Maier <ingo.maier@epfl.ch>2009-08-22 11:56:57 +0000
commitd4c53a90db99bfdce6a622a6d1b6195deb1b92bf (patch)
treea4d6dfd6596e9b52e7d9c1bd8a72eaffd4afb701 /src/swing
parentd0024b6e996e294f790972a67b3dd47e2b02dff2 (diff)
downloadscala-d4c53a90db99bfdce6a622a6d1b6195deb1b92bf.tar.gz
scala-d4c53a90db99bfdce6a622a6d1b6195deb1b92bf.tar.bz2
scala-d4c53a90db99bfdce6a622a6d1b6195deb1b92bf.zip
Better scaladocs
Diffstat (limited to 'src/swing')
-rw-r--r--src/swing/scala/swing/UIElement.scala13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/swing/scala/swing/UIElement.scala b/src/swing/scala/swing/UIElement.scala
index f3d2d0d785..a557535627 100644
--- a/src/swing/scala/swing/UIElement.scala
+++ b/src/swing/scala/swing/UIElement.scala
@@ -27,8 +27,10 @@ object UIElement {
}
/**
- * Returns the wrapper for a given peer, null if there is no cached wrapper
- * for the given component of the given type. Should never throw an exception.
+ * Looks up the internal component cache for a wrapper of the given
+ * Java Swing peer. If this method finds one of the given type `C`,
+ * it will return that wrapper. Otherwise it returns `null`. This
+ * method never throws an exception.
*/
private[swing] def cachedWrapper[C<:UIElement](c: java.awt.Component): C = {
val w = c match {
@@ -39,8 +41,11 @@ object UIElement {
}
/**
- * Wraps a given AWT component in a UIElement. If there is no wrapper in the
- * cache, this method will create a new one.
+ * Returns a wrapper for a given Java Swing peer. If there is a
+ * compatible wrapper in use, this method will return it.
+ *
+ * `wrap` methods in companion objects of subclasses of UIElement have the
+ * same behavior, except that they return more specific wrappers.
*/
def wrap(c: java.awt.Component): UIElement = {
val w = cachedWrapper[UIElement](c)