// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) fieldsfirst 
// Source File Name:   IntEditor.java

package lt.ktu.gmj.propertySheet;


// Referenced classes of package lt.ktu.gmj.propertySheet:
//			StringablePropertyEditor, PropertyStringer, PropertyReader, InvalidPropertyException, 
//			PropertyWriter, PropertyNotifier, PropertyProvider

public class IntEditor extends StringablePropertyEditor
	implements PropertyStringer
{

	private PropertyProvider provider;

	public String getAsString()
	{
		return provider.get().toString();
	}

	public void setAsString(String s)
		throws InvalidPropertyException
	{
		try
		{
			provider.set(new Integer(s));
		}
		catch(NumberFormatException numberformatexception)
		{
			throw new InvalidPropertyException("Invalid number format");
		}
	}

	public IntEditor(PropertyProvider propertyprovider)
	{
		provider = propertyprovider;
		provider.addObserver(this);
		setStringer(this);
	}
}
