/*******************************************************************************
 * 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.model.widgets;

import static org.csstudio.display.builder.model.properties.CommonWidgetProperties.behaviorPVName;
import static org.csstudio.display.builder.model.properties.CommonWidgetProperties.runtimeValue;

import java.util.Arrays;
import java.util.List;

import org.csstudio.display.builder.model.BaseWidget;
import org.csstudio.display.builder.model.Messages;
import org.csstudio.display.builder.model.Widget;
import org.csstudio.display.builder.model.WidgetCategory;
import org.csstudio.display.builder.model.WidgetDescriptor;
import org.csstudio.display.builder.model.WidgetProperty;
import org.epics.vtype.VType;

/** Widget that displays a changing text
 *  @author Kay Kasemir
 */
@SuppressWarnings("nls")
public class TextUpdateWidget extends BaseWidget
{
    /** Widget descriptor */
    public static final WidgetDescriptor WIDGET_DESCRIPTOR
        = new WidgetDescriptor("textupdate", WidgetCategory.MONITOR,
                Messages.TextUpdateWidget_Name,
                "platform:/plugin/org.csstudio.display.builder.model/icons/textupdate.png",
                Messages.TextUpdateWidget_Description,
                Arrays.asList("org.csstudio.opibuilder.widgets.TextUpdate"))
        {
            @Override
            public Widget createWidget()
            {
                return new TextUpdateWidget();
            }
        };

    private WidgetProperty<String> pv_name;
    private WidgetProperty<VType> value;

    public TextUpdateWidget()
    {
        super(WIDGET_DESCRIPTOR.getType());
    }

    @Override
    protected void defineProperties(final List<WidgetProperty<?>> properties)
    {
        super.defineProperties(properties);
        pv_name = behaviorPVName.createProperty(this, "");
        runtimeValue.createProperty(this, null);
        properties.add(pv_name);
        properties.add(value);
    }

    /** @return Behavior 'pv_name' */
    public WidgetProperty<String> behaviorPVName()
    {
        return pv_name;
    }

    /** @return Runtime 'value' */
    public WidgetProperty<VType> runtimeValue()
    {
        return value;
    }
}

@@ -2230,16 +2230,31 @@
         
+properties.add(
 pv_name 
@@ -2294,16 +2294,17 @@
 his, %22%22)
+)
 ;%0D%0A     
@@ -2305,16 +2305,39 @@
 %0A       
+ properties.add(value =
  runtime
@@ -2372,73 +2372,8 @@
 ull)
-;%0D%0A        properties.add(pv_name);%0D%0A        properties.add(value
 );%0D%0A

Fix TextUpdate widget null value