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.Table>

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

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.
 org.eclipse.swt.widgets.Table buildControl(InputContext context)
          Builds the Control.
 void clearBeans()
          Clears all the beans.
 List<B> getValue(org.eclipse.swt.widgets.Table 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.

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.Table buildControl(InputContext context)
Description copied from interface: Input
Builds the Control.

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

getValue

public List<B> getValue(org.eclipse.swt.widgets.Table 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.Table>
Parameters:
control - Control.
context - InputContext.
Returns:
Value.


Copyright © 2005-2012. All Rights Reserved.