本文整理汇总了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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
示例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);
}
}
}
示例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);
}
示例7: init
import com.vaadin.navigator.ViewDisplay; //导入依赖的package包/类
@Override
public void init(UI ui, ViewDisplay display) {
init(ui, new UriFragmentManager(ui.getPage()), display);
}
示例8: setup
import com.vaadin.navigator.ViewDisplay; //导入依赖的package包/类
@Override
public void setup(UI ui, NavigationStateManager stateManager, ViewDisplay display) {
init(ui, stateManager, display);
}
示例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));
}
示例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());
}
示例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);
}
示例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);
}
示例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);
示例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);
}
示例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;
}