public class InputHandler<T> extends Object implements InputContext
Input
.Constructor and Description |
---|
InputHandler(org.eclipse.swt.widgets.Composite parent,
Input<? extends org.eclipse.swt.widgets.Control> input)
Convenience constructor.
|
InputHandler(org.eclipse.swt.widgets.Composite parent,
Input<? extends org.eclipse.swt.widgets.Control> input,
InputListener listener)
Convenience constructor.
|
InputHandler(org.eclipse.swt.widgets.Composite parent,
Input<? extends org.eclipse.swt.widgets.Control> input,
Object initialValue)
Convenience constructor.
|
InputHandler(org.eclipse.swt.widgets.Composite parent,
Input<? extends org.eclipse.swt.widgets.Control> input,
Object initialValue,
InputListener listener)
Convenience constructor.
|
InputHandler(org.eclipse.swt.widgets.Composite parent,
Input<? extends org.eclipse.swt.widgets.Control> input,
Object initialValue,
ValueTranslator translator)
Initiate.
|
Modifier and Type | Method and Description |
---|---|
Object |
getAttribute(String name)
Obtains the attribute for the name.
|
org.eclipse.swt.widgets.Control |
getControl()
Obtains the
Control . |
Object |
getInitialValue()
Obtains the initial value.
|
Input<? extends org.eclipse.swt.widgets.Control> |
getInput()
Obtains the
Input . |
org.eclipse.swt.widgets.Composite |
getParent()
Obtains the
Composite . |
T |
getTrySafeValue()
Obtains the value defaulting to
null if failure obtaining. |
T |
getValue()
Obtains the value.
|
void |
notifyValueChanged(Object value)
Invoked by the
Input on the value changing. |
void |
notifyValueInvalid(String message)
Invoked by the
Input to indicate invalid. |
void |
setAttribute(String name,
Object value)
Adds an attribute to the context of the property.
|
void |
setInputListener(InputListener listener)
Specifies the
InputListener . |
public InputHandler(org.eclipse.swt.widgets.Composite parent, Input<? extends org.eclipse.swt.widgets.Control> input)
parent
- Parent Composite
.input
- Input
being handled.public InputHandler(org.eclipse.swt.widgets.Composite parent, Input<? extends org.eclipse.swt.widgets.Control> input, Object initialValue)
parent
- Parent Composite
.input
- Input
being handled.initialValue
- Initial value.public InputHandler(org.eclipse.swt.widgets.Composite parent, Input<? extends org.eclipse.swt.widgets.Control> input, InputListener listener)
parent
- Parent Composite
.input
- Input
being handled.listener
- InputListener
.public InputHandler(org.eclipse.swt.widgets.Composite parent, Input<? extends org.eclipse.swt.widgets.Control> input, Object initialValue, InputListener listener)
parent
- Parent Composite
.input
- Input
being handled.initialValue
- Initial value.listener
- InputListener
.public InputHandler(org.eclipse.swt.widgets.Composite parent, Input<? extends org.eclipse.swt.widgets.Control> input, Object initialValue, ValueTranslator translator)
parent
- Parent Composite
.input
- Input
being handled.initialValue
- Initial value.translator
- ValueTranslator
.public org.eclipse.swt.widgets.Control getControl()
Control
.Control
.public Input<? extends org.eclipse.swt.widgets.Control> getInput()
Input
.Input
.public T getValue() throws InvalidValueException
InvalidValueException
- If value is invalid.public T getTrySafeValue()
null
if failure obtaining.null
.public void setInputListener(InputListener listener)
InputListener
.listener
- InputListener
.public org.eclipse.swt.widgets.Composite getParent()
InputContext
Composite
.getParent
in interface InputContext
Composite
.public Object getInitialValue()
InputContext
getInitialValue
in interface InputContext
public Object getAttribute(String name)
InputContext
getAttribute
in interface InputContext
name
- Name of the attribute.null
if not specified.public void setAttribute(String name, Object value)
InputContext
setAttribute
in interface InputContext
name
- Name of the attribute.value
- Value of the attribute.public void notifyValueChanged(Object value)
InputContext
Invoked by the Input
on the value changing.
This allows for validation of the value to determine if value is valid.
notifyValueChanged
in interface InputContext
value
- New value.public void notifyValueInvalid(String message)
InputContext
Input
to indicate invalid.notifyValueInvalid
in interface InputContext
message
- Reason invalid.Copyright © 2005–2016. All rights reserved.