Advertisement
Guest User

DesktopActivity.java

a guest
Dec 26th, 2012
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.97 KB | None | 0 0
  1. public class DesktopActivity extends AbstractActivity<IsWidget> {
  2. .
  3. .
  4. .
  5.     public DesktopActivity() {
  6.         super("Desktop", null);
  7.         logger.info("create new DesktopActivity");
  8.  
  9.         AppController.getINSTANCE().getClientFactory().getEventBus()
  10.                 .addHandler(StartActivityDisplay.TYPE, new StartActivityDisplayEventHandler() {
  11.                     @Override
  12.                     public void onEvent(StartActivityDisplay event) {
  13.                         if (event.getWidget() != null) {
  14.                             DesktopActivity.getContentPanel().clear();
  15. // add view to center ....                          DesktopActivity.getContentPanel().setWidget(event.getWidget());
  16.  
  17.                         }
  18.                     }
  19.                 });
  20.     }
  21.  
  22.     private static void initView() {
  23.         Viewport p = AppController.getINSTANCE().getClientFactory().getViewport();
  24.         desktopView = new DesktopView();
  25.         p.add(desktopView.asWidget());
  26.         p.forceLayout();
  27.  
  28.     }
  29.  
  30.     public static ContentPanel getContentPanel() {
  31.         if (desktopView == null) {
  32.             initView();
  33.         }
  34.         return desktopView.getContentPanel();
  35.     }
  36. .
  37. .
  38. .
  39. .
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement