当前位置: 首页>>代码示例>>Java>>正文


Java ViewDisplay类代码示例

本文整理汇总了Java中com.vaadin.navigator.ViewDisplay的典型用法代码示例。如果您正苦于以下问题:Java ViewDisplay类的具体用法?Java ViewDisplay怎么用?Java ViewDisplay使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ViewDisplay类属于com.vaadin.navigator包,在下文中一共展示了ViewDisplay类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import com.vaadin.navigator.ViewDisplay; //导入依赖的package包/类
@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);
    }
}
 
开发者ID:antoniomaria,项目名称:gazpachoquest,代码行数:20,代码来源:QuestionnairesUI.java

示例2: initNavigator

import com.vaadin.navigator.ViewDisplay; //导入依赖的package包/类
/**
 * Init actuator
 * @param ui Navigator UI
 * @param display Navigator ViewDisplay
 * @return ViewDisplay to use with concrete Navigator
 */
public ViewDisplay initNavigator(UI ui, ViewDisplay display) {
	this.defaultViewDisplay = display;
	// check Authenticate annotation on UI
	uiAuthenticate = ui.getClass().getAnnotation(Authenticate.class);
	return this;
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:13,代码来源:NavigatorActuator.java

示例3: MainLayout

import com.vaadin.navigator.ViewDisplay; //导入依赖的package包/类
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);
    }
}
 
开发者ID:vaadin,项目名称:designer-tutorials,代码行数:11,代码来源:MainLayout.java

示例4: SecuredNavigator

import com.vaadin.navigator.ViewDisplay; //导入依赖的package包/类
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);
}
 
开发者ID:markoradinovic,项目名称:Vaadin4Spring-MVP-Sample-SpringSecurity,代码行数:8,代码来源:SecuredNavigator.java

示例5: init

import com.vaadin.navigator.ViewDisplay; //导入依赖的package包/类
@Override
protected void init(VaadinRequest request) {
	setLocale(new Locale.Builder().setLanguage("sr").setScript("Latn").setRegion("RS").build());
	
    Navigator navigator = new Navigator(MainUI.this, (ViewDisplay)mainLayout);
    navigator.addProvider(springViewProvider);
    navigator.addViewChangeListener(mainLayout);
    
    setContent(mainLayout);
    
    /*
     * Handling redirections
     */        
    RequestAttributes attrs = RequestContextHolder.getRequestAttributes();        
    if (sessionStrategy.getAttribute(attrs, VaadinRedirectObject.REDIRECT_OBJECT_SESSION_ATTRIBUTE) != null) {        	
    	VaadinRedirectObject redirectObject = (VaadinRedirectObject) sessionStrategy.getAttribute(attrs, VaadinRedirectObject.REDIRECT_OBJECT_SESSION_ATTRIBUTE);
    	sessionStrategy.removeAttribute(attrs, VaadinRedirectObject.REDIRECT_OBJECT_SESSION_ATTRIBUTE);
    	 
    	navigator.navigateTo(redirectObject.getRedirectViewToken());
    	
    	if (redirectObject.getErrorMessage() != null) {
    		Notification.show("Error", redirectObject.getErrorMessage(), Type.ERROR_MESSAGE);
    	}
    	
    }
           
}
 
开发者ID:markoradinovic,项目名称:Vaadin4Spring-MVP-Sample-SpringSecuritySocial,代码行数:28,代码来源:MainUI.java

示例6: init

import com.vaadin.navigator.ViewDisplay; //导入依赖的package包/类
@Override
protected void init(VaadinRequest request) {
	setLocale(new Locale.Builder().setLanguage("sr").setScript("Latn").setRegion("RS").build());
	
    Navigator navigator = new Navigator(MyVaadinUI.this, (ViewDisplay)mainLayout);
    navigator.addProvider(springViewProvider);
    
    navigator.addViewChangeListener(mainLayout);
    setContent(mainLayout);
}
 
开发者ID:markoradinovic,项目名称:Vaadin4Spring-MVP-Sample,代码行数:11,代码来源:MyVaadinUI.java

示例7: init

import com.vaadin.navigator.ViewDisplay; //导入依赖的package包/类
@Override
public void init(UI ui, ViewDisplay display) {
	init(ui, new UriFragmentManager(ui.getPage()), display);
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:5,代码来源:DefaultSpringViewNavigator.java

示例8: setup

import com.vaadin.navigator.ViewDisplay; //导入依赖的package包/类
@Override
public void setup(UI ui, NavigationStateManager stateManager, ViewDisplay display) {
	init(ui, stateManager, display);
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:5,代码来源:DefaultSpringViewNavigator.java

示例9: init

import com.vaadin.navigator.ViewDisplay; //导入依赖的package包/类
@Override
protected void init(UI ui, NavigationStateManager stateManager, ViewDisplay display) {
	super.init(ui, stateManager, actuator.initNavigator(ui, display));
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:5,代码来源:DefaultViewNavigator.java

示例10: init

import com.vaadin.navigator.ViewDisplay; //导入依赖的package包/类
/**
 * {@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());
}
 
开发者ID:viritin,项目名称:viritin,代码行数:9,代码来源:MNavigator.java

示例11: createHistoryApiNavigator

import com.vaadin.navigator.ViewDisplay; //导入依赖的package包/类
/**
 * Creates a navigator that is tracking the active view using the HTML5 History API
 * of the {@link Page} containing the given UI.
 * <p>
 * Navigation is automatically initiated after {@code UI.init()} if a
 * navigator was created. If at a later point changes are made to the
 * navigator, {@code navigator.navigateTo(navigator.getState())} may need to
 * be explicitly called to ensure the current view matches the navigation
 * state.
 *
 * @param ui
 *            The UI to which this Navigator is attached.
 * @param display
 *            The ViewDisplay used to display the views.
 */
public static Navigator createHistoryApiNavigator(final UI ui, final ViewDisplay display){
    return new Navigator(
        ui,
        new HistoryApiNavigationStateManager(
            ui.getPage(),
                contextPath()),
        display);
}
 
开发者ID:apm78,项目名称:history-api-navigation,代码行数:24,代码来源:HistoryApiNavigatorFactory.java

示例12: DefaultSpringViewNavigator

import com.vaadin.navigator.ViewDisplay; //导入依赖的package包/类
/**
 * Creates a navigator.
 * <p>
 * When a custom navigation state manager is not needed, use one of the other constructors which use a URI fragment
 * based state manager.
 * </p>
 * @param ui The UI to which this Navigator is attached.
 * @param stateManager The NavigationStateManager keeping track of the active view and enabling bookmarking and
 *        direct navigation or null to use the default implementation
 * @param display The ViewDisplay used to display the views handled by this navigator
 */
public DefaultSpringViewNavigator(UI ui, NavigationStateManager stateManager, ViewDisplay display) {
	this();
	init(ui, stateManager, display);
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:16,代码来源:DefaultSpringViewNavigator.java

示例13: init

import com.vaadin.navigator.ViewDisplay; //导入依赖的package包/类
/**
 * Initializes an injected navigator and registers {@link SpringViewProvider} for it.
 * <p>
 * The default navigation state manager (based on URI fragments) is used.
 * </p>
 * <p>
 * Navigation is automatically initiated after {@code UI.init()} if a navigator was created. If at a later point
 * changes are made to the navigator, {@code navigator.navigateTo(navigator.getState())} may need to be explicitly
 * called to ensure the current view matches the navigation state.
 * </p>
 * @param ui The UI to which this Navigator is attached
 * @param viewDisplay The ViewDisplay used to display the views handled by this navigator
 */
void init(UI ui, ViewDisplay viewDisplay);
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:15,代码来源:SpringViewNavigator.java

示例14: DefaultViewNavigator

import com.vaadin.navigator.ViewDisplay; //导入依赖的package包/类
/**
 * Creates a navigator that is tracking the active view using URI fragments of the {@link Page} containing the given
 * UI.
 * @param ui The UI to which this Navigator is attached.
 * @param display The ViewDisplay used to display the views.
 */
public DefaultViewNavigator(UI ui, ViewDisplay display) {
	this(ui, new UriFragmentManager(ui.getPage()), display);
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:10,代码来源:DefaultViewNavigator.java

示例15: getDefaultViewDisplay

import com.vaadin.navigator.ViewDisplay; //导入依赖的package包/类
/**
 * Default view display, i.e. the ViewDisplay to use to display Views when is not requested to display View in a
 * Window
 * @return the defaultViewDisplay Default ViewDisplay
 */
public ViewDisplay getDefaultViewDisplay() {
	return defaultViewDisplay;
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:9,代码来源:NavigatorActuator.java


注:本文中的com.vaadin.navigator.ViewDisplay类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。