Forge - UI API 2.0.0.Alpha3

org.jboss.forge.ui.util
Class InputComponents

java.lang.Object
  extended by org.jboss.forge.ui.util.InputComponents

public final class InputComponents
extends Object

Utilities for InputComponent objects

Author:
George Gastaldi

Constructor Summary
InputComponents()
           
 
Method Summary
static org.jboss.forge.ui.hints.InputType getInputType(InputComponent<?,?> input)
           
static Converter<?,String> getItemLabelConverter(ConverterFactory converterFactory, SelectComponent<?,?> input)
          Returns the item label converter, that is
static Object getValueFor(InputComponent<?,?> component)
           
static boolean hasValue(InputComponent<?,?> input)
          Returns if there is a value set for this InputComponent
static void setValueFor(ConverterFactory converterFactory, InputComponent<?,Object> component, Object value)
          Sets the value in the provided InputComponent, making any necessary conversions
static String validateRequired(InputComponent<?,?> input)
          Validate if the input has a value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputComponents

public InputComponents()
Method Detail

getInputType

public static org.jboss.forge.ui.hints.InputType getInputType(InputComponent<?,?> input)
Returns:
the InputType object associated to this InputComponent

getValueFor

public static Object getValueFor(InputComponent<?,?> component)
Returns:
the value stored in this InputComponent

setValueFor

public static void setValueFor(ConverterFactory converterFactory,
                               InputComponent<?,Object> component,
                               Object value)
Sets the value in the provided InputComponent, making any necessary conversions

Parameters:
component -
value -

hasValue

public static boolean hasValue(InputComponent<?,?> input)
Returns if there is a value set for this InputComponent


validateRequired

public static String validateRequired(InputComponent<?,?> input)
Validate if the input has a value. If not, return the error message

Parameters:
input -
Returns:

getItemLabelConverter

public static Converter<?,String> getItemLabelConverter(ConverterFactory converterFactory,
                                                        SelectComponent<?,?> input)
Returns the item label converter, that is

Parameters:
converterFactory - May be null
input -
Returns:
the item label converter of a SelectComponent or a Converter instance from the ConverterFactory parameter if not null

Forge - UI API 2.0.0.Alpha3

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.