Package com.vaadin.navigator

Examples of com.vaadin.navigator.Navigator$ClassBasedViewProvider


    @Autowired
    ErrorView errorView;

    @Override
    protected void init(VaadinRequest vaadinRequest) {
        Navigator navigator = new Navigator(this, this);
        navigator.setErrorView(errorView);
        navigator.addProvider(viewProvider);
        setNavigator(navigator);
    }
View Full Code Here


        setExpandRatio(viewContainer, 1f);
    }

    @Override
    public void attach() {
        final Navigator navigator = new Navigator(getUI(), viewContainer);
        navigator.addProvider(viewProvider);
        navigator.setErrorView(errorView);
    }
View Full Code Here

        final HorizontalSplitPanel rootLayout = new HorizontalSplitPanel();
        rootLayout.setStyleName(Reindeer.SPLITPANEL_SMALL);
        rootLayout.setSizeFull();
        setContent(rootLayout);

        final Navigator navigator = new Navigator(this, new ViewDisplay() {
            @Override
            public void showView(View view) {
                System.out.println("Showing view " + view);
                rootLayout.setSecondComponent((com.vaadin.ui.Component) view);
            }
        });
        navigator.setErrorView(new ErrorView());
        navigator.addProvider(viewProvider);
        setNavigator(navigator);

        rootLayout.setFirstComponent(sideBar);
        rootLayout.setSplitPosition(150, Unit.PIXELS);
    }
View Full Code Here

        setContent(root);
        root.setWidth("100%");

        root.addMenu(buildMenu());

        navigator = new Navigator(this, viewDisplay);

        navigator.addView("common", CommonParts.class);
        navigator.addView("labels", Labels.class);
        navigator.addView("buttons-and-links", ButtonsAndLinks.class);
        navigator.addView("textfields", TextFields.class);
View Full Code Here

    }

    @Override
    protected void setup(VaadinRequest request) {
        Layout navigatorLayout = new VerticalLayout();
        navigator = new Navigator(this, navigatorLayout);

        addComponent(navigatorLayout);

        navigator.addView(DEFAULT_VIEW_ID, new DefaultView());
View Full Code Here

    }

    public void testListener() {
        // create mocks
        IMocksControl control = EasyMock.createControl();
        Navigator navigator = control.createMock(Navigator.class);
        Page page = control.createMock(Page.class);

        UriFragmentManager manager = new UriFragmentManager(page);
        manager.setNavigator(navigator);

        EasyMock.expect(page.getUriFragment()).andReturn("!test");
        navigator.navigateTo("test");
        control.replay();

        UriFragmentChangedEvent event = new UriFragmentChangedEvent(page,
                "oldtest");
        manager.uriFragmentChanged(event);
View Full Code Here

        /*
         * Create a new instance of the navigator. The navigator will attach
         * itself automatically to this view.
         */
        new Navigator(this, this);

        /*
         * The initial log view where the user can login to the application
         */
        getNavigator().addView(SimpleLoginView.NAME, SimpleLoginView.class);
View Full Code Here

        return ui;
    }

    private static Navigator createNavigator(NavigationStateManager manager,
            ViewDisplay display) {
        return new Navigator(createMockUI(), manager, display);
    }
View Full Code Here

        EasyMock.expect(manager.getState()).andReturn("test1/params");

        control.replay();

        // create and test navigator
        Navigator navigator = createNavigator(manager, display);
        navigator.addProvider(provider);

        navigator.navigateTo("test1");
        assertEquals("test1", navigator.getState());

        navigator.navigateTo("test2/");
        assertEquals("test2", navigator.getState());

        navigator.navigateTo("test1/params");
        assertEquals("test1/params", navigator.getState());
    }
View Full Code Here

        manager.setState("test1/params");

        control.replay();

        // create and test navigator
        Navigator navigator = createNavigator(manager, display);
        navigator.addProvider(provider);

        navigator.navigateTo("test2");
        navigator.navigateTo("");
        navigator.navigateTo("test1/params");
    }
View Full Code Here

TOP

Related Classes of com.vaadin.navigator.Navigator$ClassBasedViewProvider

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.