litesoft
Diff Revisions
947
vs
948
for /trunk/Java/GWT/Client/src/org/litesoft/GWT/client/UserAgent.java
|
@@ -5,14 +5,11 @@ |
5 |
5 |
|
|
6 |
6 |
|
import com.google.gwt.core.client.*; |
7 |
7 |
|
|
8 |
|
- |
public class UserAgent |
9 |
|
- |
{ |
|
8 |
+ |
public class UserAgent { |
10 |
9 |
|
private static UserAgent sInstance = null; |
11 |
10 |
|
|
12 |
|
- |
public static UserAgent getInstance() |
13 |
|
- |
{ |
14 |
|
- |
if ( sInstance == null ) |
15 |
|
- |
{ |
|
11 |
+ |
public static UserAgent getInstance() { |
|
12 |
+ |
if ( sInstance == null ) { |
16 |
13 |
|
sInstance = (UserAgent) GWT.create( UserAgent.class ); |
17 |
14 |
|
} |
18 |
15 |
|
return sInstance; |
|
@@ -24,8 +21,7 @@ |
24 |
21 |
|
private final String mReally; |
25 |
22 |
|
private final Integer mVersion; |
26 |
23 |
|
|
27 |
|
- |
protected UserAgent( BrowserFamily pFamily, String pReally, Integer pVersion ) |
28 |
|
- |
{ |
|
24 |
+ |
protected UserAgent( BrowserFamily pFamily, String pReally, Integer pVersion ) { |
29 |
25 |
|
String zLowercaseUserAgent = getBrowserUserAgent().toLowerCase(); |
30 |
26 |
|
mDeviceType = DeviceType.fromUserAgent( zLowercaseUserAgent ); |
31 |
27 |
|
mPlatform = Platform.fromUserAgent( mDeviceType, zLowercaseUserAgent ); |
|
@@ -34,48 +30,39 @@ |
34 |
30 |
|
mVersion = pVersion; |
35 |
31 |
|
} |
36 |
32 |
|
|
37 |
|
- |
protected UserAgent( BrowserFamily pFamily, String pReally ) |
38 |
|
- |
{ |
|
33 |
+ |
protected UserAgent( BrowserFamily pFamily, String pReally ) { |
39 |
34 |
|
this( pFamily, pReally, null ); |
40 |
35 |
|
} |
41 |
36 |
|
|
42 |
|
- |
protected UserAgent( BrowserFamily pFamily ) |
43 |
|
- |
{ |
|
37 |
+ |
protected UserAgent( BrowserFamily pFamily ) { |
44 |
38 |
|
this( pFamily, "" ); |
45 |
39 |
|
} |
46 |
40 |
|
|
47 |
|
- |
protected UserAgent() |
48 |
|
- |
{ |
|
41 |
+ |
protected UserAgent() { |
49 |
42 |
|
this( BrowserFamily.Other ); |
50 |
43 |
|
} |
51 |
44 |
|
|
52 |
|
- |
public DeviceType getDeviceType() |
53 |
|
- |
{ |
|
45 |
+ |
public DeviceType getDeviceType() { |
54 |
46 |
|
return mDeviceType; |
55 |
47 |
|
} |
56 |
48 |
|
|
57 |
|
- |
public Platform getPlatform() |
58 |
|
- |
{ |
|
49 |
+ |
public Platform getPlatform() { |
59 |
50 |
|
return mPlatform; |
60 |
51 |
|
} |
61 |
52 |
|
|
62 |
|
- |
public BrowserFamily getFamily() |
63 |
|
- |
{ |
|
53 |
+ |
public BrowserFamily getFamily() { |
64 |
54 |
|
return mFamily; |
65 |
55 |
|
} |
66 |
56 |
|
|
67 |
|
- |
public String getReally() |
68 |
|
- |
{ |
|
57 |
+ |
public String getReally() { |
69 |
58 |
|
return mReally; |
70 |
59 |
|
} |
71 |
60 |
|
|
72 |
|
- |
public Integer getVersion() |
73 |
|
- |
{ |
|
61 |
+ |
public Integer getVersion() { |
74 |
62 |
|
return mVersion; |
75 |
63 |
|
} |
76 |
64 |
|
|
77 |
|
- |
public boolean isLegacyIE() |
78 |
|
- |
{ |
|
65 |
+ |
public boolean isLegacyIE() { |
79 |
66 |
|
return false; |
80 |
67 |
|
} |
81 |
68 |
|
|
|
@@ -84,8 +71,7 @@ |
84 |
71 |
|
}-*/; |
85 |
72 |
|
|
86 |
73 |
|
@Override |
87 |
|
- |
public String toString() |
88 |
|
- |
{ |
|
74 |
+ |
public String toString() { |
89 |
75 |
|
StringBuilder sb = new StringBuilder(); |
90 |
76 |
|
sb.append( mDeviceType ).append( '-' ).append( mPlatform ); |
91 |
77 |
|
sb.append( '-' ).append( mFamily ).append( '-' ).append( mReally ); |