Package com.vaadin.navigator

Examples of com.vaadin.navigator.Navigator


      logger.info("Inicio AvanteSOUI");
      VaadinSession.getCurrent().setErrorHandler(this);
      // Notification.show(String.format("Session counter"));

      // Create a navigator to control the views
      Navigator navigator = new Navigator(this, this);
      navigator.getUI().getPage().setTitle("GOBIERNO AUTONOMO EL ORO");

      MainComponent mainComponent = new MainComponent(applicationContext);
      mainComponent.getMaintab().removeTab(
          mainComponent.getMaintab().getTab(0));
      mainComponent.getMaintab().addTab(new Label(), "Inicio");

      mainComponent.setWidth("100%");
      mainComponent.setHeight("100%");
      // Create and register the views

      navigator.addView("", mainComponent);
      setContent(mainComponent);
    } catch (Exception e) {
      setNavigator(null);
      getSession().close();
      getUI().getPage().setLocation("login");
View Full Code Here


      return invocation.proceed();
    }
    catch (AuthorizationException e)
    {
      final Navigator navigator = UI.getCurrent().getNavigator();
      Notification.show("Authentication Violation", Type.TRAY_NOTIFICATION);
      navigator.navigateTo(LoginView.NAME);
    }
    catch (AuthenticationException e)
    {
      final Navigator navigator = UI.getCurrent().getNavigator();
      Notification.show("Authorization Violation", Type.TRAY_NOTIFICATION);
      navigator.navigateTo(ApplicationView.NAME);
    }
    finally
    {
      final double duration = (System.nanoTime() - startTime) / 1000000.0;
      final String message = String.format("%s took %.3f ms to examine %s",
View Full Code Here

    @SuppressWarnings("serial")
    final Button login = new Button("Login", new Button.ClickListener()
    {
      public void buttonClick(ClickEvent event)
      {
        final Navigator navigator = UI.getCurrent().getNavigator();
        if (ApplicationSecurity.login(username.getValue(), password.getValue(), rememberMe.getValue()))
        {
          final String location = (fragmentAndParameters == null)
              ? ApplicationView.NAME
              : fragmentAndParameters;
         
          navigator.navigateTo(location);
        }
        else
        {
          navigator.navigateTo(LoginView.NAME);
        }
      }
    });
    addComponent(login);
  }
View Full Code Here

  public void init(VaadinRequest request)
  {
    logger.executionTrace();
    DatabaseUtil.getSessionFactory(); // Initialize...

    final Navigator navigator = new Navigator(this, getContent());
    setNavigator(navigator);
   
    navigator.addProvider(new ViewProvider()
    {
      private static final long serialVersionUID = -3308179049710571790L;

      @Override
      public String getViewName(String viewAndParameters)
      {
        if (viewAndParameters == null || viewAndParameters.length() == 0)
          return ApplicationView.class.getSimpleName();
       
        String[] parts = viewAndParameters.split("/");
        return parts[0];
      }
     
      @Override
      public View getView(String viewName)
      {
        final Injector injector = ApplicationFilter.getSecurityInjector();
        final String packageName = ApplicationView.class.getPackage().getName();
        Class<?> classType = ApplicationView.class;

        try
        {
          classType = Class.forName(packageName + "." + viewName);
        }
        catch (ClassNotFoundException e)
        {
        }
       
        return (View) injector.getInstance(classType);
      }
    });
   
    final String viewName = (ApplicationSecurity.isAuthenticated())
        ? ApplicationView.NAME
        : LoginView.NAME;

    navigator.navigateTo(viewName);
  }
View Full Code Here

        getPage().init(request);

        // Call the init overridden by the application developer
        init(request);

        Navigator navigator = getNavigator();
        if (navigator != null) {
            // Kickstart navigation if a navigator was attached in init()
            navigator.navigateTo(navigator.getState());
        }
    }
View Full Code Here

        getPage().init(request);

        // Call the init overridden by the application developer
        init(request);

        Navigator navigator = getNavigator();
        if (navigator != null) {
            // Kickstart navigation if a navigator was attached in init()
            navigator.navigateTo(navigator.getState());
        }
    }
View Full Code Here

        loginLayout.setComponentAlignment(loginPanel, Alignment.MIDDLE_CENTER);
    }

    private void buildMainView() {

        nav = new Navigator(this, content);

        for (String route : routes.keySet()) {
            nav.addView(route, routes.get(route));
        }
View Full Code Here

TOP

Related Classes of com.vaadin.navigator.Navigator

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.