本文整理汇总了Java中com.vaadin.navigator.Navigator.addView方法的典型用法代码示例。如果您正苦于以下问题:Java Navigator.addView方法的具体用法?Java Navigator.addView怎么用?Java Navigator.addView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.navigator.Navigator
的用法示例。
在下文中一共展示了Navigator.addView方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: 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));
}
示例3: 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());
}
}
示例4: 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);
}
示例5: MainScreen
import com.vaadin.navigator.Navigator; //导入方法依赖的package包/类
public MainScreen(UI ui) {
setSizeFull();
createHeader();
createMenuBar();
final Panel viewContainer = new Panel();
viewContainer.setSizeFull();
viewContainer.addStyleName(Reindeer.PANEL_LIGHT);
addComponent(viewContainer);
setExpandRatio(viewContainer, 1);
final Navigator navigator = new Navigator(ui, viewContainer);
navigator.setErrorView(ErrorView.class);
navigator.addView(SampleTableView.VIEW_NAME, new SampleTableView());
navigator.addView(SampleFormView.VIEW_NAME, SampleFormView.class);
navigator.addView(SampleChartView.VIEW_NAME, SampleChartView.class);
navigator.navigateTo(navigator.getState());
}
示例6: init
import com.vaadin.navigator.Navigator; //导入方法依赖的package包/类
@Override
protected void init(VaadinRequest request) {
navigator = new Navigator(this, this);
navigator.addView(MenuView.VIEW_NAME, MenuView.class);
navigator.addView(TestView.VIEW_NAME, TestView.class);
navigator.addView(SplitView.VIEW_NAME, SplitView.class);
navigator.addView(SimpleView.VIEW_NAME, SimpleView.class);
}
示例7: init
import com.vaadin.navigator.Navigator; //导入方法依赖的package包/类
public void init(AppUI ui, ComponentContainer container) {
navigator = new Navigator(ui, container);
navigator.setErrorView(new PageNotFoundView(this));
if (views != null) {
for (View view : views) {
TopBarLink menu = (TopBarLink) view.getClass().getAnnotation(TopBarLink.class);
if (menu != null && menu.uiClass().equals(AppUI.class)) {
navigator.addView(menu.id(), view);
}
}
}
}
示例8: init
import com.vaadin.navigator.Navigator; //导入方法依赖的package包/类
@Override
protected void init(VaadinRequest request) {
Navigator navigator = new Navigator(this, this);
setNavigator(navigator);
navigator.setErrorView(ErrorView.class);
navigator.addView(MenuView.VIEW_ID, MenuView.class);
navigator.addView(LazyVLView.VIEW_ID, LazyVLView.class);
navigator.addView(LazyWindowView.VIEW_ID, LazyWindowView.class);
navigator.addView(TabSheetView.VIEW_ID, TabSheetView.class);
navigator.addView(Issue7View.VIEW_ID, Issue7View.class);
}
示例9: init
import com.vaadin.navigator.Navigator; //导入方法依赖的package包/类
@Override
protected void init(VaadinRequest request) {
// Create a tracker for vaadin.com domain and "ga-demo" prefix
GoogleAnalyticsTracker tracker = new GoogleAnalyticsTracker(
"UA-658457-8", "none", "/ga-demo/");
// Use this if you still haven't upgraded to Universal tracking API
// tracker.setUniversalTracking(false);
// Example: Create a tracker for vaadin.com domain.
// GoogleAnalyticsTracker tracker = new GoogleAnalyticsTracker(
// "UA-658457-8", "vaadin.com");
tracker.setUserId("12345"); //optional: set the User-ID. Must also enable User-ID tracking within Google Analytics admin.
// attach the GA tracker to this UI
tracker.extend(this);
// simple view navigator sample
Navigator n = new Navigator(this, this);
n.addView("", MainView.class);
n.addView("second", SecondView.class);
n.addView("third", ThirdView.class);
// attach the tracker to the Navigator to automatically track all views
// To use the tracker without the Navigator, just call the
// tracker.trackPageview(pageId) separately when tracking is needed.
getNavigator().addViewChangeListener(tracker);
// Examples how to track page views. Note that the "trackingPrefix" is added to these.
tracker.trackPageview("mydemo/init");
tracker.trackPageview("edit/customer");
// Examples how to track events
tracker.trackEvent("GoogleAnalyticsTrackerDemo","init");
tracker.trackEvent("GoogleAnalyticsTrackerDemo","start", "Demo Campaign");
tracker.trackEvent("GoogleAnalyticsTrackerDemo","run", "Demo Campaign",3);
}
示例10: init
import com.vaadin.navigator.Navigator; //导入方法依赖的package包/类
@Override
protected void init(VaadinRequest request) {
Navigator navigator = new Navigator(this, this);
navigator.addView(MenuView.VIEW_NAME, MenuView.class);
navigator.addView(TestView.VIEW_NAME, TestView.class);
navigator.addView(AdjustView.VIEW_NAME, AdjustView.class);
}
示例11: init
import com.vaadin.navigator.Navigator; //导入方法依赖的package包/类
@Override
protected void init(final VaadinRequest request)
{
// VaadinSession.getCurrent().setConverterFactory(new
// ScoutmasterConverterFactory());
// styleConfirmDialog();
//
// SectionTypeDao daoSectionType = new DaoFactory().getSectionTypeDao();
// daoSectionType.cacheSectionTypes();
this.viewMap.add(new ViewMapping("", PublicCalendarView.class));
this.viewMap.add(new ViewMapping(PublicCalendarView.NAME, PublicCalendarView.class));
this.mainLayout = new VerticalLayout();
this.mainLayout.setMargin(false);
this.mainLayout.setSpacing(true);
this.mainLayout.setSizeFull();
final VerticalLayout viewContainer = new VerticalLayout();
viewContainer.setHeight("100%");
final Navigator navigator = new Navigator(this, viewContainer);
// Wire up the navigation
for (final ViewMapping viewmap : this.viewMap)
{
navigator.addView(viewmap.getViewName(), viewmap.getView());
}
this.mainLayout.addComponent(viewContainer);
this.mainLayout.setExpandRatio(viewContainer, 1.0f);
setContent(this.mainLayout);
}
示例12: init
import com.vaadin.navigator.Navigator; //导入方法依赖的package包/类
@Override
protected void init(VaadinRequest request) {
//System.out.println("init of MideeasUI is called");
navigator = new Navigator(this, this);
navigator.addView("", new LoginView(this, "lobby"));
navigator.addView("lobby", new LobbyView(this));
navigator.addProvider(new EditorViewProvider(this, settings));
//navigator.setErrorView(new LobbyView(this));
/*
// cutomizing System messages
VaadinService.getCurrent().setSystemMessagesProvider( new SystemMessagesProvider() {
@Override
public SystemMessages getSystemMessages(
SystemMessagesInfo systemMessagesInfo) {
// TODO Auto-generated method stub
CustomizedSystemMessages messages = new CustomizedSystemMessages();
//messages.setSessionExpiredCaption("farshad");
//messages.setSessionExpiredMessage("ahmadi");
//messages.setSessionExpiredNotificationEnabled(false);
//messages.setSessionExpiredURL("/mideaastest");
//messages.setSessionExpiredURL("/mideaas");
messages.setSessionExpiredNotificationEnabled(true);
return messages;
}
});
*/
}
示例13: init
import com.vaadin.navigator.Navigator; //导入方法依赖的package包/类
@Override
protected void init(VaadinRequest request) {
Messages.setLocaleProvider(VaadinSessionLocaleProvider.INSTANCE);
backgroundService = new UIBackgroundService(false);
// are we logged in?
if ((VaadinSession.getCurrent().getAttribute(SessionStorageKey.USER.name())) == null) {
//no, show login box then
setContent(new LoginPanel());
Page.getCurrent().setTitle(Messages.getString("DHConvalidatorServices.loginTitle")); //$NON-NLS-1$
}
else {
// add available services and navigation
Navigator navigator = new Navigator(this, this);
navigator.addView(
"", //$NON-NLS-1$
new ServiceSelectionPanel());
navigator.addView(
ServicesViewName.odt.name(),
new PaperSelectionPanel(new OdtInputConverter()));
navigator.addView(
ServicesViewName.docx.name(),
new PaperSelectionPanel(new DocxInputConverter()));
navigator.addView(
ServicesViewName.converter.name(),
new ConverterPanel());
navigator.addView(
ServicesViewName.templates.name(),
new TemplateGeneratorPanel());
navigator.addView(
ServicesViewName.conftoolupload.name(),
new ConfToolUploadPanel());
// the visual feedback may reference external resources like images
// the ExternalResourceRequestHandler serves those external resources from
// the ZipResult of the conversion process
try {
VaadinSession.getCurrent().addRequestHandler(
new ExternalResourceRequestHandler(
PropertyKey.tei_image_location.getValue()));
} catch (IOException e) {
throw new IllegalStateException(Messages.getString("DHConvalidatorServices.errorExampleFiles"), e); //$NON-NLS-1$
}
Page.getCurrent().setTitle(Messages.getString("DHConvalidatorServices.servicesTitle")); //$NON-NLS-1$
}
}