Advertisement
Guest User

entrypoint

a guest
Dec 26th, 2012
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.22 KB | None | 0 0
  1. public class Ugyvitel implements EntryPoint {
  2.  
  3.     /**
  4.      * This is the entry point method.
  5.      */
  6.     public void onModuleLoad() {
  7.         final AppController appController = new AppController();
  8.         AppController.getINSTANCE().getClientFactory().getEventBus().fireEvent(new BusyEvent(AbstractActivity.class));
  9.  
  10.         GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
  11.             @Override
  12.             public void onUncaughtException(Throwable e) {
  13.                 AlertMessageBox alertMessageBox = new AlertMessageBox("Végzetes hiba", e.getMessage());
  14.                 alertMessageBox.show();
  15.                 e.printStackTrace();
  16.             }
  17.         });
  18.         Scheduler.get().scheduleDeferred(new ScheduledCommand() {
  19.             @Override
  20.             public void execute() {
  21.                 UgyvitelRequestFactory requestfactory = AppController.getINSTANCE().getRequestfactory();
  22.                 final UserRequest userRequest = requestfactory.createUserRequest();
  23.                 try {
  24.                     userRequest.isLogged().fire(new Receiver<Boolean>() {
  25.                         @Override
  26.                         public void onSuccess(Boolean response) {
  27.                             if (response.equals(true)) {
  28.                                 appController.config();
  29.                                 RootPanel.get().add(appController.getViewport());
  30.                             }
  31.                         }
  32.                     });
  33.  
  34.                 } catch (Throwable ex) {
  35.                     ex.printStackTrace();
  36.                 }
  37.             }
  38.         });
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement