Subversion Repository Public Repository

litesoft

Diff Revisions 629 vs 948 for /trunk/GWT_Sandbox/FormEngine/src/com/temp/client/foundation/widget/input/fieldsupport/StateInputField.java

Diff revisions: vs.
  @@ -7,66 +7,54 @@
7 7 * Errored
8 8 * Focused
9 9 */
10 - public class StateInputField
11 - {
10 + public class StateInputField {
12 11 public static final StateInputField BASE = new StateInputField( false, false, false );
13 12
14 13 private boolean mChanged, mErrored, mFocused;
15 14
16 - private StateInputField( boolean pChanged, boolean pErrored, boolean pFocused )
17 - {
15 + private StateInputField( boolean pChanged, boolean pErrored, boolean pFocused ) {
18 16 mChanged = pChanged;
19 17 mErrored = pErrored;
20 18 mFocused = pFocused;
21 19 }
22 20
23 - public boolean isChanged()
24 - {
21 + public boolean isChanged() {
25 22 return mChanged;
26 23 }
27 24
28 - public boolean isErrored()
29 - {
25 + public boolean isErrored() {
30 26 return mErrored;
31 27 }
32 28
33 - public boolean isFocused()
34 - {
29 + public boolean isFocused() {
35 30 return mFocused;
36 31 }
37 32
38 - public StateInputField changed( boolean pChanged )
39 - {
33 + public StateInputField changed( boolean pChanged ) {
40 34 return changeTo( pChanged, mErrored, mFocused );
41 35 }
42 36
43 - public StateInputField errored( boolean pErrored )
44 - {
37 + public StateInputField errored( boolean pErrored ) {
45 38 return changeTo( mChanged, pErrored, mFocused );
46 39 }
47 40
48 - public StateInputField focused( boolean pFocused )
49 - {
41 + public StateInputField focused( boolean pFocused ) {
50 42 return changeTo( mChanged, mErrored, pFocused );
51 43 }
52 44
53 - private StateInputField changeTo( boolean pChanged, boolean pErrored, boolean pFocused )
54 - {
55 - if ( (mChanged == pChanged) && (mErrored == pErrored) && (mFocused == pFocused) )
56 - {
45 + private StateInputField changeTo( boolean pChanged, boolean pErrored, boolean pFocused ) {
46 + if ( (mChanged == pChanged) && (mErrored == pErrored) && (mFocused == pFocused) ) {
57 47 return this;
58 48 }
59 49 return new StateInputField( pChanged, pErrored, pFocused );
60 50 }
61 51
62 52 @Override
63 - public boolean equals( Object o )
64 - {
53 + public boolean equals( Object o ) {
65 54 return (this == o) || ((o instanceof StateInputField) && equals( (StateInputField) o ));
66 55 }
67 56
68 - public boolean equals( StateInputField them )
69 - {
57 + public boolean equals( StateInputField them ) {
70 58 return (them != null) //
71 59 && (this.mChanged == them.mChanged) //
72 60 && (this.mErrored == them.mErrored) //
  @@ -74,8 +62,7 @@
74 62 }
75 63
76 64 @Override
77 - public int hashCode()
78 - {
65 + public int hashCode() {
79 66 int result = (mChanged ? 1 : 0);
80 67 result = (result << 1) + (mErrored ? 1 : 0);
81 68 result = (result << 1) + (mFocused ? 1 : 0);
  @@ -83,8 +70,7 @@
83 70 }
84 71
85 72 @Override
86 - public String toString()
87 - {
73 + public String toString() {
88 74 StringBuilder sb = new StringBuilder();
89 75 add( sb, "Changed", mChanged );
90 76 add( sb, "Errored", mErrored );
  @@ -92,15 +78,12 @@
92 78 return sb.toString();
93 79 }
94 80
95 - public String toCSS()
96 - {
81 + public String toCSS() {
97 82 return "IF_Box" + this;
98 83 }
99 84
100 - private void add( StringBuilder sb, String what, boolean flag )
101 - {
102 - if ( flag )
103 - {
85 + private void add( StringBuilder sb, String what, boolean flag ) {
86 + if ( flag ) {
104 87 sb.append( what );
105 88 }
106 89 }