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


Java Navigator类代码示例

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


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

示例1: init

import com.vaadin.navigator.Navigator; //导入依赖的package包/类
@Override
protected void init(VaadinRequest vaadinRequest) {
    setNavigator(new Navigator(this, (View view) -> {
        tabs.setSelectedTab((Component) view);
    }));

    registerExample(SvgInVaadin.class);
    registerExample(SimplyAsAnImageOrIcon.class);
    registerExample(FileExample.class);
    registerExample(AnimationExample.class);
    registerExample(Java2DExample.class);
    registerExample(JungExample.class);

    getNavigator().setErrorView(SvgInVaadin.class);
    tabs.addSelectedTabChangeListener(e -> {
        if (e.isUserOriginated()) {
            getNavigator().navigateTo(e.getTabSheet().getSelectedTab().getClass().getSimpleName());
        }
    });
    String state = getNavigator().getState();
    getNavigator().navigateTo(state);

    tabs.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR);
    setContent(tabs);
}
 
开发者ID:mstahv,项目名称:svgexamples,代码行数:26,代码来源:MyUI.java

示例2: selectSubMenuSheet

import com.vaadin.navigator.Navigator; //导入依赖的package包/类
/** Selection d'un element du sous menu
 * @param menu
 * @param vue
 */
public void selectSubMenuSheet(Menu menu, String vue,Navigator navigator, Boolean cleanListener){
	if (cleanListener){
		/*Suppression des listeners du tabSheet-->Sinon lorsqu'on ajoute un élément, il navigue donc boucle*/
		cleanTabSheetListener();
	}
	/*Suppression des listeners du tabSheet-->Sinon lorsqu'on ajoute un élément, il navigue donc boucle*/
	cleanTabSheetListener();
	menu.getSubMenu().forEach(s -> {
		if (s.getVue().equals(vue)){
			this.setSelectedTab(s.getLabel());
		}
	});
	/*Ajout du listener*/
	if (cleanListener){
		addTabSheetListener(navigator);
	}
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:22,代码来源:SubMenuBar.java

示例3: 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

示例4: 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

示例5: MainScreen

import com.vaadin.navigator.Navigator; //导入依赖的package包/类
public MainScreen(MyUI ui) {

        setStyleName("main-screen");

        CssLayout viewContainer = new CssLayout();
        viewContainer.addStyleName("valo-content");
        viewContainer.setSizeFull();

        //final Navigator navigator = new Navigator(ui, viewContainer);
        final Navigator navigator = new DiscoveryNavigator(ui, viewContainer);

        navigator.setErrorView(ErrorView.class);
        menu = new Menu(navigator);
        menu.addView(new SampleCrudView(), SampleCrudView.VIEW_NAME,
                SampleCrudView.VIEW_NAME, FontAwesome.EDIT);
        menu.addView(new AboutView(), AboutView.VIEW_NAME, AboutView.VIEW_NAME,
                FontAwesome.INFO_CIRCLE);

        navigator.addViewChangeListener(viewChangeListener);

        addComponent(menu);
        addComponent(viewContainer);
        setExpandRatio(viewContainer, 1);
        setSizeFull();
    }
 
开发者ID:jvalenciag,项目名称:VaadinSpringShiroMongoDB,代码行数:26,代码来源:MainScreen.java

示例6: present

import com.vaadin.navigator.Navigator; //导入依赖的package包/类
private void present() {
	context = new ClassPathXmlApplicationContext(new String[] { "./applicationContext.xml" });
	Set<Class<?>> pages = getAllPages();
	System.out.println("Pages found: " + pages.size());
	ArrayList<PageController> annotations = getAnnotations(pages);

	MetricsToGoVaadinUIController controler = new MetricsToGoVaadinUIController(context, pages);

	setContent(contentPane);
	Navigator navigator = new Navigator(this, centerContent);
	System.out.println("Annotations size:" + annotations.size());
	pages.forEach(System.out::println);
	annotations.forEach(System.out::println);
	annotations.stream()//
			.peek(System.out::println).forEach(page -> navigator.addView(page.id(), controler));

	initSidebar(navigator, annotations);
	contentPane.addComponent(centerContent);
	contentPane.setComponentAlignment(centerContent, Alignment.MIDDLE_CENTER);

	navigator.addView("main", controler);
	navigator.addView("", controler);
}
 
开发者ID:RosesTheN00b,项目名称:MetricsToGo,代码行数:24,代码来源:MetricsToGoUI.java

示例7: initSidebar

import com.vaadin.navigator.Navigator; //导入依赖的package包/类
private void initSidebar(Navigator navigator, ArrayList<PageController> pages) {
	Sidebar sidebar = context.getBean(Sidebar.class);

	ArrayList<Controller> controller = new ArrayList<>();
	pages.stream().map(page -> new Controller(page.id(), page.name())).forEach(controller::add);
	sidebar.setNavigator(navigator::navigateTo, controller);

	contentPane.addComponent((Component) sidebar);
	contentPane.setComponentAlignment((Component) sidebar, Alignment.TOP_LEFT);

	Label spacing = new Label();
	spacing.setWidth(2, Unit.REM);

	contentPane.addComponent(spacing);
	contentPane.setComponentAlignment(spacing, Alignment.TOP_LEFT);
}
 
开发者ID:RosesTheN00b,项目名称:MetricsToGo,代码行数:17,代码来源:MetricsToGoUI.java

示例8: 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

示例9: MainLayout

import com.vaadin.navigator.Navigator; //导入依赖的package包/类
public MainLayout() {
    Navigator navigator = new Navigator(UI.getCurrent(), contentPanel);
    navigator.addView(StatsView.VIEW_NAME, StatsView.class);
    navigator.addView(PluginsView.VIEW_NAME, PluginsView.class);
    navigator.addView(PermissionsView.VIEW_NAME, PermissionsView.class);

    menuButton1.addClickListener(event -> doNavigate(StatsView.VIEW_NAME));
    menuButton2
            .addClickListener(event -> doNavigate(PluginsView.VIEW_NAME));
    menuButton3.addClickListener(
            event -> doNavigate(PermissionsView.VIEW_NAME));

    if (navigator.getState().isEmpty()) {
        navigator.navigateTo(StatsView.VIEW_NAME);
    } else {
        navigator.navigateTo(navigator.getState());
    }
}
 
开发者ID:vaadin,项目名称:designer-tutorials,代码行数:19,代码来源:MainLayout.java

示例10: init

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

	Panel panel = new Panel();
	panel.setSizeFull();

	Navigator navigator = new Navigator(this, panel);
	navigator.addView(NavigationState.HOME, HomeView.class);
	navigator.addView(NavigationState.AIRPORT_LIST, AirportListView.class);
	navigator.addView(NavigationState.FLIGHT_MAINTENANCE, FlightMaintenanceView.class);
	navigator.addView(NavigationState.FLIGHT_BOOKING, FlightBookingView.class);
	navigator.addView(NavigationState.BOOKING_CANCELLATION, BookingCancellationView.class);
	navigator.navigateTo(NavigationState.HOME);

	VerticalLayout verticalLayout = new VerticalLayout();
	verticalLayout.setSizeFull();
	verticalLayout.addComponent(createMenu());
	verticalLayout.addComponent(panel);
	verticalLayout.setExpandRatio(panel, 1);
	setContent(verticalLayout);
}
 
开发者ID:sboe0705,项目名称:flightservice,代码行数:22,代码来源:FlightServiceUI.java

示例11: MainScreen

import com.vaadin.navigator.Navigator; //导入依赖的package包/类
public MainScreen(MockAppUI ui) {

        setStyleName("main-screen");

        CssLayout viewContainer = new CssLayout();
        viewContainer.addStyleName("valo-content");
        viewContainer.setSizeFull();

        final Navigator navigator = new Navigator(ui, viewContainer);
        navigator.setErrorView(ErrorView.class);
        menu = new Menu(navigator);
        menu.addView(new SampleCrudView(), SampleCrudView.VIEW_NAME,
                SampleCrudView.VIEW_NAME, FontAwesome.EDIT);
        menu.addView(new AboutView(), AboutView.VIEW_NAME, AboutView.VIEW_NAME,
                FontAwesome.INFO_CIRCLE);

        navigator.addViewChangeListener(viewChangeListener);

        addComponent(menu);
        addComponent(viewContainer);
        setExpandRatio(viewContainer, 1);
        setSizeFull();
    }
 
开发者ID:vaadin,项目名称:archetype-application-example,代码行数:24,代码来源:MainScreen.java

示例12: 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

示例13: 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

示例14: 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

示例15: 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


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