package org.mg.javalib.gui.property;

import java.util.Properties;

import javax.swing.JComponent;

public class StringProperty extends AbstractProperty
{
	private String defaultValue;
	private String value;

	public StringProperty(String name, String value)
	{
		super(name);
		this.defaultValue = value;
		this.value = value;
	}

	@Override
	public JComponent getPropertyComponent()
	{
		return new StringPropertyComponent(this);
	}

	@Override
	public String getValue()
	{
		return value;
	}

	@Override
	public String getDefaultValue()
	{
		return defaultValue;
	}

	@Override
	public void load(Properties javaProperties)
	{
		String v = (String) loadVal(javaProperties);
		if (v != null)
			setValue(v);
	}

	@Override
	public void setValue(Object value)
	{
		if (!this.value.equals(value))
		{
			this.value = (String) value;
			valueChanged(this.value);
		}
	}

}

@@ -317,32 +317,182 @@
 ue = value;%0A%09%7D%0A%0A
+%09public StringProperty(String name, String uniqName, String value)%0A%09%7B%0A%09%09super(name, uniqName);%0A%09%09this.defaultValue = value;%0A%09%09this.value = value;%0A%09%7D%0A%0A
 %09@Override%0A%09publ

add new constructor for string property