Package com.mvc4g.client

Examples of com.mvc4g.client.Controller


                }
        );

        bus.addSubscribeListener(this);
       
        Controller mainController = new com.mvc4g.client.Controller();
        Registry.set(Controller.class, mainController);

        // ------

        // setup base urls
        String proxyUrl = null;
        if (!GWT.isScript())
        {
            proxyUrl = GWT.getModuleBaseURL() + "xhp";
        }

        final ConsoleConfig config = new ConsoleConfig(proxyUrl);
        ConsoleLog.debug("Console server: " + config.getConsoleServerUrl());

        URLBuilder.configureInstance(config);

        // ------

        ApplicationContext appContext = new ApplicationContext()
        {

            public void displayMessage(String message, boolean isError)
            {
                if(isError)
                    MessageBox.error("Error", message);
                else
                    MessageBox.alert("Warn", message);
            }


            public Authentication getAuthentication()
            {
                return Registry.get(Authentication.class); // set in login view
            }


            public ConsoleConfig getConfig()
            {
                return config;
            }


            public void refreshView()
            {

            }
        };

        Registry.set(ApplicationContext.class, appContext);

        // ------

        registerGlobalViewsAndActions(mainController);

        mainController.addAction("login", new LoginAction());
        mainController.addAction(BootstrapAction.ID, new BootstrapAction());
        mainController.addView("loginView", new LoginView());

        // bootstrap and login
        mainController.handleEvent(
                new com.mvc4g.client.Event(BootstrapAction.ID, Boolean.TRUE)
        );

        mainController.handleEvent(new Event("login", null));
    }
View Full Code Here


  DefinitionListView definitionView;
  InstanceListView instanceView;

  public void provideWidget(ProvisioningCallback callback)
  {
    Controller controller = Registry.get(Controller.class);
   
    panel = new MosaicPanel();
    panel.setPadding(0);   
   
    definitionView = new DefinitionListView();
View Full Code Here

        callback.onSuccess(layout);
    }

    private void initController() {
        Controller controller = Registry.get(Controller.class);
        controller.addView(Explorer.class.getName(), this);
        controller.addAction(UpdateInstancesAction.ID, new UpdateInstancesAction());
        controller.addAction(StartNewInstanceAction.ID, new StartNewInstanceAction());
        controller.addAction(StateChangeAction.ID, new StateChangeAction());
        controller.addAction(DeleteDefinitionAction.ID, new DeleteDefinitionAction());
        controller.addAction(DeleteInstanceAction.ID, new DeleteInstanceAction());
        controller.addAction(UpdateDefinitionsAction.ID, new UpdateDefinitionsAction());
    }
View Full Code Here

  DefinitionHistoryListView definitionView;
  HistoryInstanceListView instanceView;

  public void provideWidget(ProvisioningCallback callback)
  {
    Controller controller = Registry.get(Controller.class);
   
    panel = new MosaicPanel();
    panel.setPadding(0);   
   
    definitionView = new DefinitionHistoryListView();
View Full Code Here

    panel = new MosaicPanel();
    panel.setWidgetSpacing(0);
    panel.setPadding(0);
   
    listBox = createListBox();
    final Controller controller = Registry.get(Controller.class);
    controller.addView(ID, this);

    controller.addAction(UpdateInstancesAction.ID, new UpdateInstancesAction());
    controller.addAction(StartNewInstanceAction.ID, new StartNewInstanceAction());
    controller.addAction(StateChangeAction.ID, new StateChangeAction());
    controller.addAction(DeleteDefinitionAction.ID, new DeleteDefinitionAction());
    controller.addAction(DeleteInstanceAction.ID, new DeleteInstanceAction());
    controller.addAction(UpdateDefinitionsAction.ID, new UpdateDefinitionsAction());

    initialize();

    Timer t = new Timer()
    {
      @Override
      public void run()
      {
        controller.handleEvent(
            new Event(UpdateDefinitionsAction.ID, null)
        );
      }
    };
View Full Code Here

    panel = new MosaicPanel();
    panel.setWidgetSpacing(0);
    panel.setPadding(0);
   
    listBox = createListBox();
    final Controller controller = Registry.get(Controller.class);
    controller.addView(ID, this);

    controller.addAction(UpdateHistoryDefinitionAction.ID, new UpdateHistoryDefinitionAction());
    controller.addAction(UpdateHistoryInstanceAction.ID, new UpdateHistoryInstanceAction());
    controller.addAction(LoadHistoryDiagramAction.ID, new LoadHistoryDiagramAction());
    controller.addAction(UpdateHistoryDefinitionsAction.ID, new UpdateHistoryDefinitionsAction());


    initialize();
   
    Timer t = new Timer()
    {
      @Override
      public void run()
      {
        controller.handleEvent(
            new Event(UpdateHistoryDefinitionsAction.ID, null)
        );
      }
    };
View Full Code Here

                }
        );

        bus.addSubscribeListener(this);
       
        Controller mainController = new com.mvc4g.client.Controller();
        Registry.set(Controller.class, mainController);

        // ------

        // setup base urls
        String proxyUrl = null;
        if (!GWT.isScript())
        {
            proxyUrl = GWT.getModuleBaseURL() + "xhp";
        }

        final ConsoleConfig config = new ConsoleConfig(proxyUrl);
        ConsoleLog.debug("Console server: " + config.getConsoleServerUrl());

        URLBuilder.configureInstance(config);

        // ------

        ApplicationContext appContext = new ApplicationContext()
        {

            public void displayMessage(String message, boolean isError)
            {
                if(isError)
                    MessageBox.error("Error", message);
                else
                    MessageBox.alert("Warn", message);
            }


            public Authentication getAuthentication()
            {
                return Registry.get(Authentication.class); // set in login view
            }


            public ConsoleConfig getConfig()
            {
                return config;
            }


            public void refreshView()
            {

            }
        };

        Registry.set(ApplicationContext.class, appContext);

        // ------

        registerGlobalViewsAndActions(mainController);

        mainController.addAction("login", new LoginAction());
        mainController.addAction(BootstrapAction.ID, new BootstrapAction());
        mainController.addView("loginView", new LoginView());

        // bootstrap
/*        mainController.handleEvent(
                new com.mvc4g.client.Event(BootstrapAction.ID, Boolean.TRUE)
        );*/
       
        //login
        mainController.handleEvent(new Event("login", null));
    }
View Full Code Here

    });
  }
 
  public void onModuleLoad2()
  {
    Controller mainController = new com.mvc4g.client.Controller();
    mainController.addAction("login", new LoginAction());
    mainController.addView("loginView", new LoginView());
    mainController.handleEvent(new Event("login", null));   
  }
View Full Code Here

TOP

Related Classes of com.mvc4g.client.Controller

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.