dsto.dfc.swt.forms
Class LabelizerPipe
java.lang.Object
dsto.dfc.swt.forms.AbstractPipe
dsto.dfc.swt.forms.AbstractBiDiPipe
dsto.dfc.swt.forms.LabelizerPipe
- All Implemented Interfaces:
- Pipe, Disposable
public class LabelizerPipe
- extends AbstractBiDiPipe
A pipe that turns a value into a UI label and vice-versa. This can
be used as an in-between translator to turn enumerated values e.g.
["on", "off", null] into user-presentable ones like ["On", "Off",
"Invalid!"]. This control's label/value mapping is compatible with
RadioEndpoint
's.
- Author:
- Matthew Phillips
Method Summary |
void |
dispose()
Forwarded to the child pipe. |
boolean |
input(Object value)
Input a value into the pipe tree. |
boolean |
isDisposed()
Test if pipe has been disposed. |
boolean |
output(Object value)
Output a value from a child into the pipe (the reverse of input ()). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
hideShortcuts
public boolean hideShortcuts
- Set to true (default) to enable ignoring "&" in labels.
labelsAndValues
public ValueLabel[] labelsAndValues
LabelizerPipe
public LabelizerPipe(ValueLabel[] labelsAndValues)
- Create a new instance.
- Parameters:
labelsAndValues
- The control's mapping of labels to values.
eg {{"On", "on"}, {"Off", "off"}, {null, "[invalid]"}}.
This mapping is compatible with
RadioEndpoint
's. In
particular, the labels may have "&" in them which
will be ignored.- See Also:
RadioEndpoint
,
hideShortcuts
dispose
public void dispose()
- Description copied from class:
AbstractBiDiPipe
- Forwarded to the child pipe.
- Specified by:
dispose
in interface Pipe
- Specified by:
dispose
in interface Disposable
- Overrides:
dispose
in class AbstractBiDiPipe
isDisposed
public boolean isDisposed()
- Description copied from interface:
Pipe
- Test if pipe has been disposed.
input
public boolean input(Object value)
- Description copied from interface:
Pipe
- Input a value into the pipe tree.
- Returns:
- True if the operation completed successfully.
- See Also:
for more info on handling errors.
output
public boolean output(Object value)
- Description copied from interface:
Pipe
- Output a value from a child into the pipe (the reverse of input ()).
- Returns:
- True if the operation completed successfully.
- See Also:
for more info on handling errors.
Copyright © 2008 Commonwealth of Australia