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


Java Navigator.addProvider方法代码示例

本文整理汇总了Java中com.vaadin.navigator.Navigator.addProvider方法的典型用法代码示例。如果您正苦于以下问题:Java Navigator.addProvider方法的具体用法?Java Navigator.addProvider怎么用?Java Navigator.addProvider使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vaadin.navigator.Navigator的用法示例。


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

示例1: init

import com.vaadin.navigator.Navigator; //导入方法依赖的package包/类
@Override
protected void init(VaadinRequest vaadinRequest) {
    final VerticalLayout contentArea = new VerticalLayout();
    contentArea.setMargin(false);
    setContent(contentArea);

    final Navigator navigator = new Navigator(this, contentArea);
    navigator.addProvider(viewProvider);
    navigator.setErrorView(InaccessibleErrorView.class);

    String defaultView = Page.getCurrent().getUriFragment();
    if (defaultView == null || defaultView.trim().isEmpty()) {
        defaultView = SecureView.VIEW_NAME;
    }

    if (isUserAuthenticated(vaadinRequest)) {
        navigator.navigateTo(defaultView);
    } else {
        navigator.navigateTo(LoginView.VIEW_NAME + "/" + defaultView);
    }
}
 
开发者ID:mrts,项目名称:vaadin-javaee-jaas-example,代码行数:22,代码来源:JaasExampleUI.java

示例2: init

import com.vaadin.navigator.Navigator; //导入方法依赖的package包/类
@Override
protected void init(VaadinRequest request) {
	log.info("Levanto la pagina UI");
	
	final VerticalLayout root = new VerticalLayout();
       root.setSizeFull();
       root.setMargin(true);
       root.setSpacing(true);
       setContent(root);
	
       final Panel viewContainer = new Panel();
       viewContainer.setSizeFull();
       root.addComponent(viewContainer);
       root.setExpandRatio(viewContainer, 1.0f);
       
       Navigator navigator = new Navigator(this, viewContainer);
       //Navigator navigator = new Navigator(this, this);
       navigator.addProvider(viewProvider);
       
       log.info("Termina de levantar la pagina UI");

}
 
开发者ID:damiancom,项目名称:garantia,代码行数:23,代码来源:LoginUI.java

示例3: init

import com.vaadin.navigator.Navigator; //导入方法依赖的package包/类
@Override
protected void init(VaadinRequest request) {
	final VerticalLayout mainLayout = new VerticalLayout();
	HorizontalLayout horizontalLayout = new HorizontalLayout();
	CssLayout viewLayout = new CssLayout();
	Page.getCurrent().setTitle("Vaadin Demo");
	mainLayout.setSizeFull();
	viewLayout.setSizeFull();
	mainLayout.setMargin(true);
	setContent(mainLayout);
	mainLayout.addComponent(horizontalLayout);
	mainLayout.addComponent(viewLayout);
	mainLayout.setExpandRatio(viewLayout, 1f);
	Navigator navigator = new Navigator(this, viewLayout);
	setNavigator(navigator);
	setupHeader(horizontalLayout);
	Map<String, Class<? extends MyView>> myViews = getViewProvider();
	navigator.addView("", new HomeView(myViews.keySet()));
	navigator.addProvider(new CachedViewProvider(myViews));
}
 
开发者ID:KrishnaPhani,项目名称:KrishnasSpace,代码行数:21,代码来源:VaadinUI.java

示例4: init

import com.vaadin.navigator.Navigator; //导入方法依赖的package包/类
@Override
protected void init(VaadinRequest vaadinRequest) {
    getPage().setTitle("Vaadin4Spring Side Bar Sample");
    final HorizontalLayout rootLayout = new HorizontalLayout();
    rootLayout.setSizeFull();
    setContent(rootLayout);

    final VerticalLayout viewContainer = new VerticalLayout();
    viewContainer.setSizeFull();

    final Navigator navigator = new Navigator(this, viewContainer);
    navigator.setErrorView(new ErrorView());
    navigator.addProvider(viewProvider);
    setNavigator(navigator);

    rootLayout.addComponent(getSideBar());
    rootLayout.addComponent(viewContainer);
    rootLayout.setExpandRatio(viewContainer, 1.0f);
}
 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:20,代码来源:AbstractSideBarUI.java

示例5: MainScreen

import com.vaadin.navigator.Navigator; //导入方法依赖的package包/类
@Autowired
public MainScreen(final VaadinSecurity vaadinSecurity, SpringViewProvider springViewProvider, ValoSideBar sideBar) {
    HorizontalLayout layout = new HorizontalLayout();
    layout.setSizeFull();
    setCompositionRoot(layout);
    setSizeFull();

    // By adding a security item filter, only views that are accessible to the user will show up in the side bar.
    sideBar.setItemFilter(new VaadinSecurityItemFilter(vaadinSecurity));
    layout.addComponent(sideBar);

    CssLayout viewContainer = new CssLayout();
    viewContainer.setSizeFull();
    layout.addComponent(viewContainer);
    layout.setExpandRatio(viewContainer, 1f);

    Navigator navigator = new Navigator(UI.getCurrent(), viewContainer);
    // Without an AccessDeniedView, the view provider would act like the restricted views did not exist at all.
    springViewProvider.setAccessDeniedViewClass(AccessDeniedView.class);
    navigator.addProvider(springViewProvider);
    navigator.setErrorView(ErrorView.class);
    navigator.navigateTo(navigator.getState());
}
 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:24,代码来源:MainScreen.java

示例6: init

import com.vaadin.navigator.Navigator; //导入方法依赖的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

示例7: buildMain

import com.vaadin.navigator.Navigator; //导入方法依赖的package包/类
/**
 * Build application main window
 */
protected void buildMain() {
	this.root.removeAllComponents();
	this.top.setWidth(100, Unit.PERCENTAGE);
	this.top.setSpacing(false);
	this.top.setMargin(false);
	this.top.addComponent(buttonBar);
	this.root.addComponent(top);
	this.root.addComponent(mainView);
	this.root.setSpacing(false);
	this.root.setMargin(false);
	this.root.setExpandRatio(top, 0);
	this.root.setExpandRatio(mainView, 1);
	Navigator navigator = new Navigator(this, mainView);
	navigator.addProvider(viewProvider);
}
 
开发者ID:chelu,项目名称:jdal,代码行数:19,代码来源:SimpleApplicationUI.java

示例8: init

import com.vaadin.navigator.Navigator; //导入方法依赖的package包/类
@Override
protected void init(VaadinRequest request) {

    final VerticalLayout root = new VerticalLayout();
    root.setSizeFull();
    root.setMargin(new MarginInfo(false, false, false, true));
    root.setSpacing(true);
    setContent(root);

    HorizontalLayout topBar = new HorizontalLayout();
    topBar.setSpacing(true);

    Image logo = new Image(null, new ExternalResource("images/logo1.png"));
    logo.setHeight(31f, Unit.PIXELS);
    logo.setWidthUndefined();
    topBar.addComponent(logo);

    CssLayout navBar = new CssLayout();
    navBar.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
    navBar.addComponent(createNavButton(messages.get("usersNavigationLabel"), UsersViewImpl.VIEW_NAME));
    navBar.addComponent(createNavButton(messages.get("projectsNavigationLabel"), ProjectsViewImpl.VIEW_NAME));
    navBar.addComponent(createNavButton(messages.get("rolesNavigationLabel"), RolesViewImpl.VIEW_NAME));
    topBar.addComponent(navBar);

    root.addComponent(topBar);

    final Panel viewContainer = new Panel();
    viewContainer.setSizeFull();
    root.addComponent(viewContainer);
    root.setExpandRatio(viewContainer, 1.0f);

    Navigator navigator = new Navigator(this, viewContainer);
    navigator.addProvider(viewProvider);
    navigator.setErrorProvider(viewProvider);
    navigator.setErrorView(ErrorView.class);
}
 
开发者ID:limbr-management,项目名称:limbr,代码行数:37,代码来源:VaadinUI.java

示例9: init

import com.vaadin.navigator.Navigator; //导入方法依赖的package包/类
@Override
protected void init(final VaadinRequest request) {

    rootLayout.setSizeFull();

    final Panel viewContainer = new Panel();
    viewContainer.setSizeFull();
    rootLayout.addComponent(viewContainer);
    rootLayout.setExpandRatio(viewContainer, 1.0F);

    final Navigator navigator = new Navigator(this, viewContainer);
    navigator.addProvider(viewProvider);

    setContent(rootLayout);
}
 
开发者ID:eclipse,项目名称:hawkbit-examples,代码行数:16,代码来源:SimulatorUI.java

示例10: init

import com.vaadin.navigator.Navigator; //导入方法依赖的package包/类
@Override
protected void init(VaadinRequest request) {

    final CssLayout root = new CssLayout();
    root.setSizeFull();
    setContent(root);

    Navigator navigator = new Navigator(this, root);
    navigator.addProvider(viewProvider);
}
 
开发者ID:fluoxa,项目名称:Iris,代码行数:11,代码来源:IrisUi.java

示例11: init

import com.vaadin.navigator.Navigator; //导入方法依赖的package包/类
@Override
protected void init(VaadinRequest vaadinRequest) {
    Navigator navigator = new Navigator(this, this);
    navigator.addProvider(viewProvider);
    setNavigator(navigator);
    navigator.addViewChangeListener(this);
}
 
开发者ID:rolandkrueger,项目名称:vaadin-bug-demos,代码行数:8,代码来源:MainUI.java

示例12: initialize

import com.vaadin.navigator.Navigator; //导入方法依赖的package包/类
@PostConstruct
public void initialize() {
    if (ui.getNavigator() == null) {
        Navigator navigator = new Navigator(ui, ui);
        navigator.addProvider(viewProvider);
        navigator.setErrorView(errorView);
    }
}
 
开发者ID:vaadin,项目名称:cdi-tutorial,代码行数:9,代码来源:NavigationServiceImpl.java

示例13: init

import com.vaadin.navigator.Navigator; //导入方法依赖的package包/类
@Override
protected void init(VaadinRequest request) {
    final VerticalLayout root = new VerticalLayout();
    root.setSizeFull();
    root.setMargin(true);
    root.setSpacing(true);
    setContent(root);

    final CssLayout navigationBar = new CssLayout();
    navigationBar.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
    navigationBar.addComponent(createNavigationButton("Prototype Scoped View", PrototypeScopedView.VIEW_NAME));
    navigationBar.addComponent(createNavigationButton("UI Scoped View", UIScopedView.VIEW_NAME));
    navigationBar.addComponent(createNavigationButton("View Scoped View", ViewScopedView.VIEW_NAME));
    navigationBar.addComponent(createNavigationButton("Access Control", AccessControlView.VIEW_NAME));
    root.addComponent(navigationBar);

    final Panel viewContainer = new Panel();
    viewContainer.setSizeFull();
    root.addComponent(viewContainer);
    root.setExpandRatio(viewContainer, 1.0f);

    viewProvider.setAccessDeniedViewClass(AccessDeniedView.class);

    Navigator navigator = new Navigator(this, viewContainer);
    navigator.setErrorView(new ErrorView()); // You can still create the error view yourself if you want to.
    navigator.addProvider(viewProvider);
}
 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:28,代码来源:NavigationUI.java

示例14: init

import com.vaadin.navigator.Navigator; //导入方法依赖的package包/类
@Override
protected void init(VaadinRequest request) {
    getPage().setTitle("Vaadin Shared Security Demo");
    // Let's register a custom error handler to make the 'access denied' messages a bit friendlier.
    setErrorHandler(new DefaultErrorHandler() {
        @Override
        public void error(com.vaadin.server.ErrorEvent event) {
            if (SecurityExceptionUtils.isAccessDeniedException(event.getThrowable())) {
                Notification.show("Sorry, you don't have access to do that.");
            } else {
                super.error(event);
            }
        }
    });
    HorizontalLayout layout = new HorizontalLayout();
    layout.setSizeFull();

    // By adding a security item filter, only views that are accessible to the user will show up in the side bar.
    sideBar.setItemFilter(new VaadinSecurityItemFilter(vaadinSecurity));
    layout.addComponent(sideBar);

    CssLayout viewContainer = new CssLayout();
    viewContainer.setSizeFull();
    layout.addComponent(viewContainer);
    layout.setExpandRatio(viewContainer, 1f);

    Navigator navigator = new Navigator(this, viewContainer);
    // Without an AccessDeniedView, the view provider would act like the restricted views did not exist at all.
    springViewProvider.setAccessDeniedViewClass(AccessDeniedView.class);
    navigator.addProvider(springViewProvider);
    navigator.setErrorView(ErrorView.class);
    navigator.navigateTo(navigator.getState());

    setContent(layout); // Call this here because the Navigator must have been configured before the Side Bar can be attached to a UI.
}
 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:36,代码来源:MainUI.java

示例15: init

import com.vaadin.navigator.Navigator; //导入方法依赖的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


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