litesoft
@ 950
litesoft / trunk / GWT_Sandbox / FormEngine / src / com / temp / client / foundation / widget / input / fieldsupport / InputFieldAccessor.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
package com.temp.client.foundation.widget.input.fieldsupport; import com.google.gwt.user.client.ui.*; public class InputFieldAccessor<T> implements HasEnabled { protected final Widget inputWidget; protected final InputWidgetValueAdapter<T> valueAdapter; protected final InputWidgetValidator<T> validator; protected final InputWidgetChangeFilter<T> input; protected final Focusable[] focusables; public InputFieldAccessor( InputWidgetChangeFilter<T> input, InputWidgetValidator<T> validator, InputWidgetValueAdapter<T> valueAdapter, Widget inputWidget, Focusable... focusables ) { this.input = input; this.validator = validator; this.valueAdapter = valueAdapter; this.inputWidget = inputWidget; this.focusables = (focusables != null) ? focusables : new Focusable[0]; } @Override public boolean isEnabled() { return getEnableable().isEnabled(); } @Override public void setEnabled( boolean enabled ) { getEnableable().setEnabled( enabled ); } public Widget getInputWidget() { return inputWidget; } public InputWidgetValueAdapter<T> getValueAdapter() { return valueAdapter; } public InputWidgetValidator<T> getValidator() { return validator; } public InputWidgetChangeFilter<T> getInput() { return input; } public Focusable[] getFocusables() { return focusables; } private HasEnabled getEnableable() { return (inputWidget instanceof HasEnabled) ? (HasEnabled) inputWidget : ALWAYS_ENABLED; } private static final HasEnabled ALWAYS_ENABLED = new HasEnabled() { @Override public boolean isEnabled() { return true; } @Override public void setEnabled( boolean enabled ) { // Whatever } }; } |
Commits for litesoft/trunk/GWT_Sandbox/FormEngine/src/com/temp/client/foundation/widget/input/fieldsupport/InputFieldAccessor.java
Revision | Author | Commited | Message |
---|---|---|---|
950 Diff | GeorgeS | Thu 19 Jun, 2014 17:57:04 +0000 | New Lines |
948 Diff | GeorgeS | Sat 07 Jun, 2014 23:42:39 +0000 | Jusefuls Formatter Updated to New Code Format |
635 Diff | GeorgeS | Thu 19 Apr, 2012 18:20:49 +0000 | |
629 Diff | GeorgeS | Tue 17 Apr, 2012 05:47:55 +0000 | |
628 Diff | GeorgeS | Fri 13 Apr, 2012 03:53:33 +0000 | |
626 | GeorgeS | Wed 11 Apr, 2012 19:39:41 +0000 |