Subversion Repository Public Repository

litesoft

Diff Revisions 947 vs 948 for /trunk/Java/GWT/Client/src/org/litesoft/GWT/client/view/AbstractViewManager.java

Diff revisions: vs.
  @@ -1,41 +1,37 @@
1 1 // This Source Code is in the Public Domain per: http://unlicense.org
2 2 package org.litesoft.GWT.client.view;
3 3
4 - import com.google.gwt.user.client.*;
5 4 import org.litesoft.commonfoundation.typeutils.Objects;
6 5 import org.litesoft.security.*;
7 6 import org.litesoft.uispecification.*;
8 7
8 + import com.google.gwt.user.client.*;
9 +
9 10 import java.util.*;
10 11
11 12 /**
12 13 * Controls which screen is showing. Coordinates w/ the GWT {@link History}
13 14 * mechanism.
14 15 */
15 - public abstract class AbstractViewManager implements ViewManager
16 - {
16 + public abstract class AbstractViewManager implements ViewManager {
17 17 protected final ViewAccessControlManager mAccessControlManager;
18 18 private final Map<String, ViewDef> mScreenDefs = new HashMap<String, ViewDef>();
19 19 private final Map<String, ViewFactory> mViewFactories = new HashMap<String, ViewFactory>();
20 20
21 - AbstractViewManager( ViewAccessControlManager pAccessControlManager, ViewFactory... pFactories )
22 - {
21 + AbstractViewManager( ViewAccessControlManager pAccessControlManager, ViewFactory... pFactories ) {
23 22 Objects.assertNotNull( "AccessControlManager", mAccessControlManager = pAccessControlManager );
24 23 add( pFactories );
25 24 }
26 25
27 26 @Override
28 - public ViewFactory getViewFactory( ViewDef pDef )
29 - {
30 - if ( pDef == null )
31 - {
27 + public ViewFactory getViewFactory( ViewDef pDef ) {
28 + if ( pDef == null ) {
32 29 return null;
33 30 }
34 31 return mAccessControlManager.allowAccessTo( pDef ) ? mViewFactories.get( pDef.getFragmentID() ) : ViewFactory.NO_ACCESS;
35 32 }
36 33
37 - protected ViewDef getViewDef( String pViewDefId )
38 - {
34 + protected ViewDef getViewDef( String pViewDefId ) {
39 35 ViewDef zDef = mScreenDefs.get( pViewDefId );
40 36 return mAccessControlManager.allowAccessTo( zDef ) ? zDef : null;
41 37 }
  @@ -46,14 +42,10 @@
46 42 * @param pFactories
47 43 */
48 44 @Override
49 - public void add( ViewFactory... pFactories )
50 - {
51 - if ( pFactories != null )
52 - {
53 - for ( ViewFactory zFactory : pFactories )
54 - {
55 - if ( zFactory != null )
56 - {
45 + public void add( ViewFactory... pFactories ) {
46 + if ( pFactories != null ) {
47 + for ( ViewFactory zFactory : pFactories ) {
48 + if ( zFactory != null ) {
57 49 ViewDef zDef = zFactory.getViewDef();
58 50 mViewFactories.put( zDef.getFragmentID(), zFactory );
59 51 mScreenDefs.put( zDef.getFragmentID(), zDef );
  @@ -68,14 +60,10 @@
68 60 * @param pViewDefs
69 61 */
70 62 @Override
71 - public void add( ViewDef... pViewDefs )
72 - {
73 - if ( pViewDefs != null )
74 - {
75 - for ( ViewDef zDef : pViewDefs )
76 - {
77 - if ( zDef != null )
78 - {
63 + public void add( ViewDef... pViewDefs ) {
64 + if ( pViewDefs != null ) {
65 + for ( ViewDef zDef : pViewDefs ) {
66 + if ( zDef != null ) {
79 67 mScreenDefs.put( zDef.getFragmentID(), zDef );
80 68 }
81 69 }