Revision ff40fbae
Added by Andreas Kohlbecker over 2 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/ui/RegistrationUI.java | ||
---|---|---|
11 | 11 |
import org.springframework.beans.factory.annotation.Autowired; |
12 | 12 |
import org.springframework.beans.factory.annotation.Qualifier; |
13 | 13 |
|
14 |
import com.flowingcode.vaadin.addons.errorwindow.WindowErrorHandler; |
|
15 | 14 |
import com.vaadin.annotations.Theme; |
16 | 15 |
import com.vaadin.annotations.Title; |
17 | 16 |
import com.vaadin.annotations.Viewport; |
... | ... | |
19 | 18 |
import com.vaadin.navigator.ViewDisplay; |
20 | 19 |
import com.vaadin.server.FontAwesome; |
21 | 20 |
import com.vaadin.server.VaadinRequest; |
22 |
import com.vaadin.server.VaadinSession; |
|
23 | 21 |
import com.vaadin.spring.annotation.SpringUI; |
22 |
import com.vaadin.ui.Component; |
|
24 | 23 |
import com.vaadin.ui.Label; |
25 | 24 |
import com.vaadin.ui.themes.ValoTheme; |
26 | 25 |
|
27 |
import eu.etaxonomy.cdm.database.PermissionDeniedException; |
|
28 | 26 |
import eu.etaxonomy.cdm.vaadin.debug.EntityCacheDebugger; |
29 |
import eu.etaxonomy.cdm.vaadin.event.error.DelegatingErrorHandler; |
|
30 |
import eu.etaxonomy.cdm.vaadin.event.error.ErrorTypeErrorHandlerWrapper; |
|
31 |
import eu.etaxonomy.cdm.vaadin.event.error.PermissionDeniedErrorHandler; |
|
32 | 27 |
import eu.etaxonomy.cdm.vaadin.toolbar.Toolbar; |
33 | 28 |
import eu.etaxonomy.cdm.vaadin.view.name.TaxonNamePopupEditor; |
34 | 29 |
import eu.etaxonomy.cdm.vaadin.view.registration.DashBoardView; |
... | ... | |
77 | 72 |
|
78 | 73 |
public static final String INITIAL_VIEW = DashBoardView.NAME; |
79 | 74 |
|
80 |
protected static final String UI_STYLE_NAME = ValoTheme.UI_WITH_MENU; |
|
81 |
|
|
82 | 75 |
public RegistrationUI() { |
83 | 76 |
super(); |
84 | 77 |
} |
85 | 78 |
|
86 | 79 |
@Override |
87 | 80 |
protected void init(VaadinRequest request) { |
88 |
|
|
89 | 81 |
super.init(request); |
90 |
|
|
91 |
addStyleName(UI_STYLE_NAME); |
|
92 | 82 |
if(entityCacheDebugger != null){ |
93 | 83 |
addShortcutListener(entityCacheDebugger.getShortcutListener()); |
94 | 84 |
} |
... | ... | |
100 | 90 |
} |
101 | 91 |
|
102 | 92 |
@Override |
103 |
protected void initContent() { |
|
93 |
protected void initAdditionalContent() { |
|
94 |
setContent((Component) getViewDisplay()); |
|
104 | 95 |
Label phycoBankLogo = new Label("PhycoBank"); |
105 | 96 |
phycoBankLogo.addStyleName("phycobank-green"); |
106 | 97 |
phycoBankLogo.addStyleName(ValoTheme.LABEL_HUGE); |
... | ... | |
116 | 107 |
} |
117 | 108 |
} |
118 | 109 |
|
119 |
@Override |
|
120 |
protected void registerErrorHandlers() { |
|
121 |
DelegatingErrorHandler delegatingErrorHander = new DelegatingErrorHandler(); |
|
122 |
WindowErrorHandler errorHandler = new WindowErrorHandler(this, RegistrationUIDefaults.ERROR_CONTACT_MESSAGE_LINE + "</br></br>" |
|
123 |
+ "<i>To help analyzing the problem please describe your actions that lead to this error and provide the error details from below in your email. " |
|
124 |
+ "You also might want to add a sreenshot of the browser page in error.</i>"); |
|
125 |
delegatingErrorHander.registerHandler(new ErrorTypeErrorHandlerWrapper<PermissionDeniedException>(PermissionDeniedException.class, new PermissionDeniedErrorHandler(this))); |
|
126 |
delegatingErrorHander.registerHandler(new ErrorTypeErrorHandlerWrapper<Exception>(Exception.class, errorHandler)); |
|
127 |
setErrorHandler(delegatingErrorHander); |
|
128 |
VaadinSession.getCurrent().setErrorHandler(delegatingErrorHander); |
|
129 |
} |
|
130 |
|
|
131 | 110 |
@Override |
132 | 111 |
public <T extends AbstractPopupEditor> String defaultStatusMarkup(Class<T> popupEditorClass){ |
133 | 112 |
if(popupEditorClass.equals(TaxonNamePopupEditor.class)){ |
Also available in: Unified diff
ref #9859 Password Recovery UI and view implemented