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
56
57
58
|
package com.example.mockapp.client;
import org.litesoft.GWT.client.*;
import org.litesoft.GWT.client.command.queue.*;
import org.litesoft.GWT.client.view.*;
import org.litesoft.core.*;
import org.litesoft.security.*;
import org.litesoft.uispecification.*;
import com.example.mockapp.client.ui.screens.dispensing.*;
import com.example.mockapp.client.ui.screens.home.*;
import com.example.mockapp.client.ui.screens.inventory.*;
import com.google.gwt.core.client.*;
import com.google.gwt.user.client.ui.*;
public class MockApp implements EntryPoint
{
private static final ViewDef[] sViews = new ViewDef[]{ViewDefs.HOME, ViewDefs.ORDERS, ViewDefs.OTHER, ViewDefs.CHECKIN, //
ViewDefs.CURRENTINVENTORY, ViewDefs.PHYSICALINVENTORY, ViewDefs.REPORTS};
public void onModuleLoad()
{
ViewAccessControlManager zACM = new ViewAccessControlManager.Only( sViews );
// pull in all the factories. This can be broken out into different modules if compile becomes too slow.
ViewManagerImpl vm = new ViewManagerImpl( zACM, //
new HomeFactory(), //
new DispensingFactory(), //
new InventoryFactory() );
// add in all the factory-less screens. This can be broken out into different modules if compile becomes too slow.
vm.add( sViews );
final RootPanel rootPanel = RootPanel.get( "AppPanel" );
ClientContext context = ClientContext.get();
context.set( CommandQueue.class, new CommandQueue() );
context.set( ScreenViewShower.class, vm );
context.set( DialogViewShower.class, vm );
context.set( ViewFactoryAccessor.class, vm );
context.set( ViewAccessControlManager.class, zACM );
context.set( SingleWidgetPanel.class, new SingleWidgetPanel()
{
public void setWidget( Widget w )
{
rootPanel.clear();
if ( w != null )
{
rootPanel.add( w );
}
}
} );
context.set(LoginPasswordResetAccessor.class, new LoginPasswordResetAccessor.Mock());
rootPanel.getElement().removeChild( rootPanel.getElement().getFirstChildElement() );
// DOM.setStyleAttribute(homeScreen.getElement(), "border", "solid black 1px");
}
}
|
Revision |
Author |
Commited |
Message |
162
|
GeorgeS
|
Fri 01 Apr, 2011 19:58:40 +0000 |
|