/** * Programmatically click on the anchor. */ public void click() { navigation.goTo(toPageWidgetType, this.state); }
@Override public void callback(Navigation navigation) { navigation.goTo(toPageWidgetType, state); } });
/** * Programmatically click on the anchor (with alternate page state). * @param state */ public void click(Multimap<String,String> state) { navigation.goTo(toPageWidgetType, state); }
/** * Programmatically click on the anchor. */ public void click() { navigation.goTo(toPageWidgetType, this.state); }
/** * Programmatically click on the anchor (with alternate page state). * @param state */ public void click(Multimap<String,String> state) { navigation.goTo(toPageWidgetType, state); }
@Override public void callback(Navigation navigation) { navigation.goTo(toPageWidgetType, state); } });
@Override public void navigateBackOrToPage(final Class<?> pageType, final Multimap<String, String> pageState) { if (lastPageCache != null) { navigation.goTo(lastPageCache.pageClass, lastPageCache.pageState); lastPageCache = null; } else { navigation.goTo(pageType, ImmutableListMultimap.<String, String>of()); } }
@Override public void navigateBackOrToPage(final Class<?> pageType, final Multimap<String, String> pageState) { if (lastPageCache != null) { navigation.goTo(lastPageCache.pageClass, lastPageCache.pageState); lastPageCache = null; } else { navigation.goTo(pageType, ImmutableListMultimap.<String, String>of()); } }
@Override public void handleInvalidPageNameError(Exception exception, String pageName) { if (pageName.equals("")) { throw new Error("Failed to initialize Default Page", exception); } else { logger.warn("Got invalid page name \"" + pageName + "\". Redirecting to default page.", exception); navigation.goTo(""); } }
@Override public void handleError(Exception exception, Class<? extends UniquePageRole> pageRole) { if (pageRole.equals(DefaultPage.class)) { throw new Error("Failed to initialize Default Page", exception); } else { logger.error("Got invalid page role \"" + pageRole + "\". Redirecting to default page.", exception); navigation.goTo(""); } }
@Override public void handleInvalidPageNameError(Exception exception, String pageName) { if (pageName.equals("")) { throw new Error("Failed to initialize Default Page", exception); } else { logger.warn("Got invalid page name \"" + pageName + "\". Redirecting to default page.", exception); navigation.goTo(""); } }
@Override public void handleError(Exception exception, Class<? extends UniquePageRole> pageRole) { if (pageRole.equals(DefaultPage.class)) { throw new Error("Failed to initialize Default Page", exception); } else { logger.error("Got invalid page role \"" + pageRole + "\". Redirecting to default page.", exception); navigation.goTo(""); } }
@Override public void handleInvalidURLError(Exception exception, String urlPath) { if (urlPath.equals("")) { throw new Error("Failed to initialize Default Page", exception); } else { logger.warn("Got invalid URL \"" + urlPath + "\". Redirecting to default page.", exception); navigation.goTo(""); } } }
@Override public void handleInvalidURLError(Exception exception, String urlPath) { if (urlPath.equals("")) { throw new Error("Failed to initialize Default Page", exception); } else { logger.warn("Got invalid URL \"" + urlPath + "\". Redirecting to default page.", exception); navigation.goTo(""); } } }
/** * Redirect to a given page safely. * * @param toPage page class annotated with {@link org.jboss.errai.ui.nav.client.local.Page}. * @param state Pages state map. */ public <C> void redirect(final Class<C> toPage, final Multimap<String, String> state) { if (!hasRun) { interrupt(); navigation.goTo(toPage, state); } else { throw new IllegalStateException("redirect() method can only be called once."); } }
/** * Redirect to a given page safely. * * @param toPage page class annotated with {@link org.jboss.errai.ui.nav.client.local.Page}. * @param state Pages state map. */ public <C> void redirect(final Class<C> toPage, final Multimap<String, String> state) { if (!hasRun) { interrupt(); navigation.goTo(toPage, state); } else { throw new IllegalStateException("redirect() method can only be called once."); } }
/** * @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent) */ @Override public void onClick(ClickEvent event) { if (isEnabled()) navigation.goTo(toPageWidgetType, this.state); event.stopPropagation(); event.preventDefault(); }
/** * @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent) */ @Override public void onClick(ClickEvent event) { if (isEnabled()) navigation.goTo(toPageWidgetType, this.state); event.stopPropagation(); event.preventDefault(); }