Subversion Repository Public Repository

litesoft

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
package com.temp.client.foundation.widget.input.fieldsupport;

import com.google.gwt.user.client.ui.*;
import com.temp.shared.utils.*;

public class InputFieldAccessor<T> implements Enableable
{
    private final Widget inputWidget;
    private final InputWidgetValidator<T> validator;
    private final InputWidgetChangeFilter<T> input;

    public InputFieldAccessor( InputWidgetChangeFilter<T> input, InputWidgetValidator<T> validator, Widget inputWidget )
    {
        this.input = input;
        this.validator = validator;
        this.inputWidget = inputWidget;
    }

    @Override
    public boolean isEnabled()
    {
        return getEnableable().isEnabled();
    }

    @Override
    public void setEnabled( boolean enabled )
    {
        getEnableable().setEnabled( enabled );
    }

    public Widget getInputWidget()
    {
        return inputWidget;
    }

    /**
     * Get the Validator or null if the InputWidget CAN'T have an Error (e.g. RadioGroups).
     *
     * @return Validator or null
     */
    public InputWidgetValidator<T> getValidator()
    {
        return validator;
    }

    public InputWidgetChangeFilter<T> getInput()
    {
        return input;
    }

    private Enableable getEnableable()
    {
        return (inputWidget instanceof Enableable) ? (Enableable)inputWidget : Enableable.ALWAYS_ENABLED;
    }
}

Commits for litesoft/trunk/GWT_Sandbox/FormEngine/src/com/temp/client/foundation/widget/input/fieldsupport/InputFieldAccessor.java

Diff revisions: vs.
Revision Author Commited Message
628 Diff Diff GeorgeS picture GeorgeS Fri 13 Apr, 2012 03:53:33 +0000
626 GeorgeS picture GeorgeS Wed 11 Apr, 2012 19:39:41 +0000