net.officefloor.eclipse.common.dialog.input.impl
Class BeanListInput<B>

java.lang.Object
  extended by net.officefloor.eclipse.common.dialog.input.impl.BeanListInput<B>
All Implemented Interfaces:
Input<org.eclipse.swt.widgets.Control>

public class BeanListInput<B>
extends Object
implements Input<org.eclipse.swt.widgets.Control>

Table to create and populate a list of beans.

Author:
Daniel Sagenschneider

Constructor Summary
BeanListInput(Class<B> beanType)
          Initiate.
BeanListInput(Class<B> beanType, boolean isIncludeButtons)
          Initiate.
 
Method Summary
 void addBean(B bean)
          Adds a bean.
 void addProperty(String propertyName, int weight)
           Adds property to be populated on the bean.
 void addProperty(String propertyName, int weight, String label)
           Adds property to be populated on the bean.
 org.eclipse.swt.widgets.Control buildControl(InputContext context)
          Builds the Control.
 void clearBeans()
          Clears all the beans.
 List<B> getValue(org.eclipse.swt.widgets.Control control, InputContext context)
           Obtains the value from the input Control.
 void removeBean(B bean)
          Removes a bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanListInput

public BeanListInput(Class<B> beanType)
Initiate.

Parameters:
beanType - Type of the bean.

BeanListInput

public BeanListInput(Class<B> beanType,
                     boolean isIncludeButtons)
Initiate.

Parameters:
beanType - Type of the bean.
isIncludeButtons - Indicates if should include the buttons.
Method Detail

addProperty

public void addProperty(String propertyName,
                        int weight)

Adds property to be populated on the bean.

This may NOT be called after buildControl(InputContext).

Parameters:
propertyName - Name of the property on the bean.
weight - Weight for the width.

addProperty

public void addProperty(String propertyName,
                        int weight,
                        String label)

Adds property to be populated on the bean.

This may NOT be called after buildControl(InputContext).

Parameters:
propertyName - Name of the property on the bean.
weight - Weight for the width.
label - Label for column header of property.

addBean

public void addBean(B bean)
Adds a bean.

Parameters:
bean - Bean.

removeBean

public void removeBean(B bean)
Removes a bean.

Parameters:
bean - Bean.

clearBeans

public void clearBeans()
Clears all the beans.


buildControl

public org.eclipse.swt.widgets.Control buildControl(InputContext context)
Description copied from interface: Input
Builds the Control.

Specified by:
buildControl in interface Input<org.eclipse.swt.widgets.Control>
Parameters:
context - InputContext.
Returns:
Control to input the value.

getValue

public List<B> getValue(org.eclipse.swt.widgets.Control control,
                        InputContext context)
Description copied from interface: Input

Obtains the value from the input Control.

The input Control will be the one created by Input.buildControl(InputContext).

Specified by:
getValue in interface Input<org.eclipse.swt.widgets.Control>
Parameters:
control - Control.
context - InputContext.
Returns:
Value.


Copyright © 2005-2013. All Rights Reserved.