/** * Registers a view that is displayed when no other view matches the * navigation state. This implicitly sets an appropriate error view provider * and overrides any previous {@link #setErrorProvider(ViewProvider)} call. * * @param view * The View that should be used as the error view. */ public void setErrorView(final View view) { setErrorProvider(new ViewProvider() { @Override public View getView(String viewName) { return view; } @Override public String getViewName(String navigationState) { return navigationState; } }); }
/** * Registers a view class that is instantiated when no other view matches * the navigation state. This implicitly sets an appropriate error view * provider and overrides any previous * {@link #setErrorProvider(ViewProvider)} call. * <p> * Note that an error view should not be shared between UIs (for instance, * it should not be a static field in a UI subclass). * * @param viewClass * The View class whose instance should be used as the error * view. */ public void setErrorView(final Class<? extends View> viewClass) { setErrorProvider(new ViewProvider() { @Override public View getView(String viewName) { return ReflectTools.createInstance(viewClass); } @Override public String getViewName(String navigationState) { return navigationState; } }); }
@Override public B errorViewProvider(ViewProvider errorViewProvider) { navigator.setErrorProvider(errorViewProvider); return builder(); }