net.officefloor.eclipse.common.dialog.input
Class PropertyInputHandler

java.lang.Object
  extended by net.officefloor.eclipse.common.dialog.input.PropertyInputHandler

public class PropertyInputHandler
extends Object

Handler for the Input that populates a property on a bean.

Author:
Daniel Sagenschneider

Constructor Summary
PropertyInputHandler(org.eclipse.swt.widgets.Composite parent, Input<? extends org.eclipse.swt.widgets.Control> input, String propertyName, Object bean, ValueTranslatorRegistry valueTranslatorRegistry, ValueTranslator translator)
          Initialise.
 
Method Summary
 org.eclipse.swt.widgets.Control getControl()
          Obtains the Control.
 boolean populatePropertyOnBean()
          Populates the value on the property of the bean.
 void setInputListener(InputListener listener)
          Specifies the InputListener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyInputHandler

public PropertyInputHandler(org.eclipse.swt.widgets.Composite parent,
                            Input<? extends org.eclipse.swt.widgets.Control> input,
                            String propertyName,
                            Object bean,
                            ValueTranslatorRegistry valueTranslatorRegistry,
                            ValueTranslator translator)
Initialise.

Parameters:
parent - Parent Composite.
input - Input.
propertyName - Name of the property.
bean - Bean to be populated.
valueTranslatorRegistry - ValueTranslatorRegistry.
translator - ValueTranslator to use or null to source from ValueTranslatorRegistry.
Method Detail

getControl

public org.eclipse.swt.widgets.Control getControl()
Obtains the Control.

Returns:
Control.

setInputListener

public void setInputListener(InputListener listener)
Specifies the InputListener.

Parameters:
listener - InputListener.

populatePropertyOnBean

public boolean populatePropertyOnBean()
                               throws InvalidValueException
Populates the value on the property of the bean.

Returns:
true if non-null value populated (or if String that is not empty).
Throws:
InvalidValueException - If invalid value or failure populating the property value.


Copyright © 2005-2013. All Rights Reserved.