/*******************************************************************************
 * Copyright (c) 2015 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.display.builder.representation;

import org.csstudio.display.builder.model.Widget;

/** Toolkit representation for a model widget
 *
 *  <p>Creates a toolkit item, for example a JavaFX Label,
 *  for the corresponding model widget, i.e. a LabelWidget.
 *
 *  @author Kay Kasemir
 *  @param <TWP> Toolkit widget parent class
 *  @param <TW> Toolkit widget base class
 *  @param <MW> Toolkit widget base class
 */
abstract public class WidgetRepresentation<TWP, TW, MW extends Widget>
{
    /** Toolkit helper */
    final protected ToolkitRepresentation<TWP, TW> toolkit;

    /** Model widget that is represented in toolkit */
    final protected MW model_widget;

    /** Construct representation for a model widget
     *  @param toolkit Toolkit helper
     *  @param model_widget Model widget
     */
    public WidgetRepresentation(final ToolkitRepresentation<TWP, TW> toolkit,
                                final MW model_widget)
    {
        this.toolkit = toolkit;
        this.model_widget = model_widget;
        model_widget.setUserData(Widget.USER_DATA_REPRESENTATION, this);
    }

    /** Initialize the toolkit item(s)
     *
     *  <p>If this widget is a container, it returns a
     *  new parent for its child widgets.
     *  Plain widgets return the same parent that's passed
     *  as an argument.
     *
     *  @param parent Toolkit parent for this item
     *  @return New parent to use for child items
     *  @throws Exception on error
     */
    abstract public TWP init(final TWP parent) throws Exception;

    /** Update toolkit representation to match model.
     *
     *  <p>Invoked by toolkit's update throttle after
     *  <code>ToolkitRepresentation.scheduleUpdate()</code>
     *  has requested an update.
     *
     *  <p>Ideally based on listeners and 'dirty' markers to only update
     *  aspects of model that really changed.
     *
     *  <p>Override must call base class.
     */
    abstract public void updateChanges();

    /** Remove toolkit items.
     *
     *  <p>Called when model widget has been removed.
     */
    abstract public void dispose();
}


@@ -518,16 +518,52 @@
 ion;%0D%0A%0D%0A
+import java.util.logging.Logger;%0D%0A%0D%0A
 import o
@@ -1020,16 +1020,95 @@
 et%3E%0D%0A%7B%0D%0A
+    protected final Logger logger = Logger.getLogger(getClass().getName());%0D%0A%0D%0A
     /** 
@@ -1122,38 +1122,32 @@
  helper */%0D%0A    
-final 
 protected Toolki
@@ -1140,16 +1140,22 @@
 otected 
+final 
 ToolkitR
@@ -1249,22 +1249,16 @@
 */%0D%0A    
-final 
 protecte
@@ -1259,16 +1259,22 @@
 otected 
+final 
 MW model

Add logger to WidgetRepresentation (base of all reps.)