com.vaadin.navigator.ViewDisplay Java Examples

The following examples show how to use com.vaadin.navigator.ViewDisplay. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: QuestionnairesUI.java    From gazpachoquest with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void init(VaadinRequest request) {
    logger.info("New Vaadin UI created");
    String invitation = request.getParameter("invitation");
    logger.info("Invitation: {} of sessions : {}", invitation);
    setSizeFull();
    GazpachoViewDisplay viewDisplay = new GazpachoViewDisplay();
    setContent(viewDisplay);

    navigator = new Navigator(this, (ViewDisplay) viewDisplay);
    navigator.addProvider(viewProvider);
    navigator.setErrorProvider(new GazpachoErrorViewProvider());

    if (isUserSignedIn()) {
        navigator.navigateTo(QuestionnaireView.NAME);
    } else {
        navigator.navigateTo(LoginView.NAME);
    }
}
 
Example #2
Source File: MainLayout.java    From designer-tutorials with Apache License 2.0 5 votes vote down vote up
public MainLayout() {
    navigator = new Navigator(UI.getCurrent(), (ViewDisplay) this);
    addNavigatorView(DashboardView.VIEW_NAME, DashboardView.class,
            menuButton1);
    addNavigatorView(OrderView.VIEW_NAME, OrderView.class, menuButton2);
    addNavigatorView(AboutView.VIEW_NAME, AboutView.class, menuButton3);
    if (navigator.getState().isEmpty()) {
        navigator.navigateTo(DashboardView.VIEW_NAME);
    }
}
 
Example #3
Source File: SecuredNavigator.java    From Vaadin4Spring-MVP-Sample-SpringSecurity with Apache License 2.0 5 votes vote down vote up
public SecuredNavigator(UI ui, ViewDisplay display, SpringViewProvider viewProvider, Security security, EventBus eventBus) {
	super(ui, display);		
	this.security = security;
	this.viewProvider = viewProvider;
	this.eventBus = eventBus;
	addProvider(this.viewProvider);
}
 
Example #4
Source File: MNavigator.java    From viritin with Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc} Generally shouldn't be called directly.
 */
@Override
protected void init(UI ui, NavigationStateManager stateManager, ViewDisplay display) {
    super.init(ui, stateManager, display);
    addViewChangeListener(new MViewChangeListener());
}
 
Example #5
Source File: MNavigator.java    From viritin with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a navigator.
 *
 * <p>
 * This constructor is exactly similar to
 * {@link com.vaadin.navigator.Navigator#Navigator(com.vaadin.ui.UI, com.vaadin.navigator.NavigationStateManager, com.vaadin.navigator.ViewDisplay)}
 *
 * @param ui the UI for which the Navigator is to be created
 * @param stateManager the NavigationStateManager to be used by this
 * Navigator
 * @param display the ViewDisplay that will be used for showing the views
 * @see com.vaadin.navigator.Navigator#Navigator(com.vaadin.ui.UI,
 * com.vaadin.navigator.NavigationStateManager,
 * com.vaadin.navigator.ViewDisplay)
 */
public MNavigator(UI ui, NavigationStateManager stateManager, ViewDisplay display) {
    super(ui, stateManager, display);
}
 
Example #6
Source File: MNavigator.java    From viritin with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a navigator that is tracking the active view using URI fragments
 * of the {@link com.vaadin.server.Page} containing the given UI.
 *
 * <p>
 * This constructor is exactly similar to
 * {@link com.vaadin.navigator.Navigator#Navigator(com.vaadin.ui.UI, com.vaadin.navigator.ViewDisplay)}
 *
 * @param ui the UI for which the Navigator is to be created
 * @param display the ViewDisplay that will be used for showing the views
 * @see com.vaadin.navigator.Navigator#Navigator(com.vaadin.ui.UI,
 * com.vaadin.navigator.ViewDisplay)
 */
public MNavigator(UI ui, ViewDisplay display) {
    super(ui, display);
}