changeset 4960:dcce9cea3af1

Automated merge with ssh://
author Martin Sladecek <>
date Wed, 04 Sep 2013 15:07:25 +0200
parents 04f6adb4eada 520a712d8a10
children 128976a231a2 0b6186f39a8f
diffstat 1 files changed, 24 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/fxml/src/main/docs/javafx/fxml/doc-files/introduction_to_fxml.html	Wed Sep 04 14:03:27 2013 +0100
+++ b/modules/fxml/src/main/docs/javafx/fxml/doc-files/introduction_to_fxml.html	Wed Sep 04 15:07:25 2013 +0200
@@ -617,6 +617,30 @@
 <p><assert id="handler_method_signature" group="event_handlers">In general, a handler method should conform to the signature of a standard event handler; that is, it should take a single argument of a type that extends <span class="code">javafx.event.Event</span> and should return void (similar to an event delegate in C#). The event argument often carries important and useful information about the nature of the event;</assert> <assert id="handler_method_opt_arg" group="event_handlers">however, it is optional and may be omitted if desired</assert>.</p>
+<p> One exception to this rule are collections. <span class="code">ObservableList</span>, <span class="code">ObservableMap</span> or <span class="code">ObservableSet</span>
+ uses a special <span class="code">onChange</span> attribute that points to a handler method with a <span class="code">ListChangeListner.Change</span>, <span class="code">MapChangeListener.Change</span> or <span class="code">SetChangeListener.Change</span> parameter respectively.
+<pre class="code">
+&lt;VBox fx:controller=""
+    xmlns:fx=""&gt;
+    &lt;children onChange="#handleChildrenChange"/&gt;
+where the handler method looks like this:
+<pre class="code">
+import javafx.collections.ListChangeListener.Change;
+public class MyController {
+    public void handleChildrenChange(ListChangeListener.Change c) {
+        System.out.println("Children changed!");
+    }
 <p>Controllers are discussed in more detail in a later section.</p>
 <h2><a name="scripting">Scripting</a></h2>