litesoft
Diff Revisions
947
vs
948
for /trunk/GWT_Sandbox/FormEngine/src/com/temp/client/foundation/pavment/PlaceIdExtractor.java
|
@@ -1,8 +1,7 @@ |
1 |
1 |
|
package com.temp.client.foundation.pavment; |
2 |
2 |
|
|
3 |
|
- |
import com.temp.shared.utils.StringUtils; |
4 |
|
- |
|
5 |
3 |
|
import com.google.gwt.place.shared.*; |
|
4 |
+ |
import com.temp.shared.utils.*; |
6 |
5 |
|
|
7 |
6 |
|
/** |
8 |
7 |
|
* Code to support extracting a PlaceId from either a PlaceTokenizer or a Place. |
|
@@ -10,26 +9,20 @@ |
10 |
9 |
|
* If the Place or PlaceTokenizer does NOT implement 'HasPlaceId', then class name magic is used |
11 |
10 |
|
* (the Place classes name must end with 'Place', and the Tokenizer(s) MUST be a static inner class of it's Place). |
12 |
11 |
|
*/ |
13 |
|
- |
public class PlaceIdExtractor |
14 |
|
- |
{ |
15 |
|
- |
public static String getPlaceId( PlaceTokenizer<? extends Place> pTokenizer ) |
16 |
|
- |
{ |
|
12 |
+ |
public class PlaceIdExtractor { |
|
13 |
+ |
public static String getPlaceId( PlaceTokenizer<? extends Place> pTokenizer ) { |
17 |
14 |
|
return extractPlaceId( pTokenizer ); |
18 |
15 |
|
} |
19 |
16 |
|
|
20 |
|
- |
public static String getPlaceId( Place pPlace ) |
21 |
|
- |
{ |
|
17 |
+ |
public static String getPlaceId( Place pPlace ) { |
22 |
18 |
|
return extractPlaceId( pPlace ); |
23 |
19 |
|
} |
24 |
20 |
|
|
25 |
|
- |
private static String extractPlaceId( Object pObject ) |
26 |
|
- |
{ |
27 |
|
- |
if ( pObject instanceof HasPlaceId ) |
28 |
|
- |
{ |
|
21 |
+ |
private static String extractPlaceId( Object pObject ) { |
|
22 |
+ |
if ( pObject instanceof HasPlaceId ) { |
29 |
23 |
|
return StringUtils.noEmpty( ((HasPlaceId) pObject).getPlaceId() ); |
30 |
24 |
|
} |
31 |
|
- |
if ( pObject == null ) |
32 |
|
- |
{ |
|
25 |
+ |
if ( pObject == null ) { |
33 |
26 |
|
return null; |
34 |
27 |
|
} |
35 |
28 |
|
String s = "." + pObject.getClass().getName() + "$"; // find the String between the last '.' and the first '$' |