com.vaadin.navigator.ViewChangeListener Java Examples

The following examples show how to use com.vaadin.navigator.ViewChangeListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ErrorView.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void enter(final ViewChangeListener.ViewChangeEvent event) {
    final DashboardMenuItem view = dashboardMenu.getByViewName(event.getViewName());
    if (view == null) {
        message.setValue(i18n.getMessage("message.error.view", event.getViewName()));
        return;
    }
    if (dashboardMenu.isAccessDenied(event.getViewName())) {
        final Notification nt = new Notification("Access denied",
                i18n.getMessage("message.accessdenied.view", event.getViewName()), Type.ERROR_MESSAGE, false);
        nt.setStyleName(SPUIStyleDefinitions.SP_NOTIFICATION_ERROR_MESSAGE_STYLE);
        nt.setPosition(Position.BOTTOM_RIGHT);
        nt.show(UI.getCurrent().getPage());
        message.setValue(i18n.getMessage("message.accessdenied.view", event.getViewName()));
    }
}
 
Example #2
Source File: MNavigator.java    From viritin with Apache License 2.0 5 votes vote down vote up
@Override
public boolean beforeViewChange(ViewChangeListener.ViewChangeEvent event) {
    View oldView = event.getOldView();
    if (oldView != null && oldView instanceof MView) {
        return ((MView) oldView).beforeViewChange(event);
    }
    return true;
}
 
Example #3
Source File: MNavigator.java    From viritin with Apache License 2.0 5 votes vote down vote up
@Override
public void afterViewChange(ViewChangeListener.ViewChangeEvent event) {
    View oldView = event.getOldView();
    if (oldView != null && oldView instanceof MView) {
        ((MView) oldView).afterViewChange(event);
    }
}
 
Example #4
Source File: ProductView.java    From jpa-invoicer with The Unlicense 4 votes vote down vote up
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
}
 
Example #5
Source File: InvoicesView.java    From jpa-invoicer with The Unlicense 4 votes vote down vote up
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
}
 
Example #6
Source File: AboutView.java    From jpa-invoicer with The Unlicense 4 votes vote down vote up
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
}
 
Example #7
Source File: MyAccount.java    From jpa-invoicer with The Unlicense 4 votes vote down vote up
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
}
 
Example #8
Source File: AboutView.java    From jpa-addressbook with The Unlicense 4 votes vote down vote up
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
}
 
Example #9
Source File: MainView.java    From jpa-addressbook with The Unlicense 4 votes vote down vote up
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
}
 
Example #10
Source File: GroupsView.java    From jpa-addressbook with The Unlicense 2 votes vote down vote up
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {

}
 
Example #11
Source File: MView.java    From viritin with Apache License 2.0 2 votes vote down vote up
/**
 * Invoked before the view is changed.
 * 
 * 
 * <p>
 * By returning {@code false} from this method the view change is 
 * denied. More information in {@link com.vaadin.navigator.ViewChangeListener#beforeViewChange(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent)}.
 *
 * 
 * @param event view change event
 * @return true if the view change should be allowed or this listener does
 *    not care about the view change, false to block the change
 * 
 * @see com.vaadin.navigator.ViewChangeListener#beforeViewChange(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent)
 * 
 */
public boolean beforeViewChange(ViewChangeListener.ViewChangeEvent event);
 
Example #12
Source File: MView.java    From viritin with Apache License 2.0 2 votes vote down vote up
/**
 * Invoked after the view is changed. If a {@code beforeViewChange} method blocked
 * the view change, this method is not called. Be careful of unbounded
 * recursion if you decide to change the view again in this class.
 *
 * <p> 
 * This is a logical place to deregister listeners that are owned
 * by the view.
 *
 * @param event view change event
 */
public void afterViewChange(ViewChangeListener.ViewChangeEvent event);