/*******************************************************************************
 * Copyright (c) 2015-2016 Oak Ridge National Laboratory.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 ******************************************************************************/
package org.csstudio.javafx;

import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.layout.Pane;

/** Platform Info
 *  @author Kay Kasemir
 */
@SuppressWarnings("nls")
public class ChildCare
{
    /** Add a child node to a parent node in scene graph
     *
     *  @param parent {@link Parent}, must be a {@link Group} or {@link Pane} that allows adding child nodes
     *  @param child Child {@link Node} to add
     *  @throws IllegalArgumentException on error
     */
    public static void addChild(final Parent parent, final Node child)
    {
        if (parent instanceof Group)
            ((Group)parent).getChildren().add(child);
        else if (parent instanceof Pane)
            ((Pane)parent).getChildren().add(child);
        else
            throw new IllegalArgumentException("Cannot add " + child + " to " + parent);
    }

    /** Remove a child node from a parent node in scene graph
     *
     *  @param parent {@link Parent}, must be a {@link Group} or {@link Pane} that allows removing child nodes
     *  @param child Child {@link Node} to remove
     *  @return <code>true</code> if child node was found and removed, <code>false</code> if child wasn't held by parent
     *  @throws IllegalArgumentException on error
     */
    public static boolean removeChild(final Parent parent, final Node child)
    {
        if (parent instanceof Group)
            return ((Group)parent).getChildren().remove(child);
        else if (parent instanceof Pane)
            return ((Pane)parent).getChildren().remove(child);
        else
            throw new IllegalArgumentException("Cannot remove " + child + " from " + parent);
    }

}

@@ -103,9 +103,9 @@
 -201
-6
+7
  Oak
@@ -612,21 +612,179 @@
 /** 
-Platform Info
+Helper for handling parent/child lists%0A *%0A *  %3Cp%3EBoth %7B@link Group%7D and %7B@link Pane%7D%0A *  have child nodes, but different API.%0A *  This helps treating both the same way.%0A *
 %0A * 

Fix javadoc