Project

General

Profile

« Previous | Next » 

Revision 7f6f8587

Added by Andreas Kohlbecker over 2 years ago

ref #9884 refactoring UI enablement:

  • ui beans never are null
  • disabled beans have state.enabled=false
  • uis throw UIDisabledException
  • ErrorView to show UIDisabledException
  • UIDisabledErrorHandle delegates to the ErrorView

View differences:

src/main/java/eu/etaxonomy/vaadin/ui/navigation/NavigationManagerBean.java
57 57

  
58 58
	protected EventBus.UIEventBus uiEventBus;
59 59

  
60
	/**
61
	 * if set the navigator will block all other views
62
	 * and exclusively navigates to the error view to indicate that the
63
	 * UI is disabled.
64
	 */
65
	private String uiDisabledErrorViewName = null;
66

  
60 67
    @Autowired
61 68
    protected void setViewEventBus(EventBus.UIEventBus uiEventBus){
62 69
        this.uiEventBus = uiEventBus;
......
125 132
	}
126 133

  
127 134
	public void navigateTo(String navigationState, boolean fireNavigationEvent) {
135
	    if(getUiDisabledErrorView() != null) {
136
	        super.navigateTo(getUiDisabledErrorView());
137
	    }
128 138
	    if(StringUtils.isEmpty(navigationState)){
129 139
            navigationState = defaultViewName;
130 140
        }
......
137 147

  
138 148
	@Override
139 149
	public void navigateTo(String navigationState) {
150
	    if(getUiDisabledErrorView() != null) {
151
            super.navigateTo(getUiDisabledErrorView());
152
        }
140 153
	    if(StringUtils.isEmpty(navigationState)){
141 154
	        navigationState = defaultViewName;
142 155
	    }
......
294 307
        // by navigating to the default view
295 308
        navigateTo(defaultViewName);
296 309
    }
310

  
311
    public String getUiDisabledErrorView() {
312
        return uiDisabledErrorViewName;
313
    }
314

  
315
    public void setUiDisabledErrorView(String uiDisabledErrorViewName) {
316
        this.uiDisabledErrorViewName = uiDisabledErrorViewName;
317
    }
297 318
}

Also available in: Unified diff