Revision a735bbbf
Added by Andreas Kohlbecker about 7 years ago
- ID a735bbbfccc284e24f355551d2496cd15e790243
- Parent a1dac6b2
src/main/java/eu/etaxonomy/cdm/vaadin/view/AuthenticationView.java | ||
---|---|---|
1 | 1 |
package eu.etaxonomy.cdm.vaadin.view; |
2 | 2 |
|
3 |
import org.springframework.beans.factory.annotation.Autowired; |
|
4 |
import org.springframework.context.annotation.Scope; |
|
3 | 5 |
import org.springframework.security.authentication.BadCredentialsException; |
4 | 6 |
|
5 | 7 |
import com.vaadin.annotations.AutoGenerated; |
... | ... | |
9 | 11 |
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; |
10 | 12 |
import com.vaadin.server.Page; |
11 | 13 |
import com.vaadin.server.VaadinServlet; |
14 |
import com.vaadin.spring.annotation.SpringComponent; |
|
12 | 15 |
import com.vaadin.ui.Alignment; |
13 | 16 |
import com.vaadin.ui.Button; |
14 | 17 |
import com.vaadin.ui.Button.ClickEvent; |
... | ... | |
21 | 24 |
import com.vaadin.ui.UI; |
22 | 25 |
import com.vaadin.ui.VerticalLayout; |
23 | 26 |
|
24 |
import eu.etaxonomy.cdm.vaadin.presenter.AuthenticationPresenter; |
|
25 | 27 |
import eu.etaxonomy.cdm.vaadin.ui.AbstractAuthenticatedUI; |
26 | 28 |
|
27 |
|
|
29 |
@SpringComponent |
|
30 |
@Scope("prototype") |
|
28 | 31 |
public class AuthenticationView extends CustomComponent implements IAuthenticationComponent, ClickListener , View { |
29 | 32 |
|
30 | 33 |
/*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */ |
... | ... | |
46 | 49 |
private PasswordField passwordField; |
47 | 50 |
@AutoGenerated |
48 | 51 |
private TextField userNameTF; |
52 |
|
|
53 |
@Autowired |
|
49 | 54 |
private AuthenticationComponentListener authListener; |
50 | 55 |
|
51 | 56 |
/** |
... | ... | |
63 | 68 |
userNameTF.setNullRepresentation(""); |
64 | 69 |
userNameTF.focus(); |
65 | 70 |
|
66 |
authListener = new AuthenticationPresenter(); |
|
67 |
|
|
68 | 71 |
loginBtn.addClickListener(this); |
69 | 72 |
loginBtn.setClickShortcut(KeyCode.ENTER, null); |
70 | 73 |
} |
Also available in: Unified diff
ref #5285 attempt to avoid using the CdmSpringContextHelper
using DI to get rid of CdmSpringContextHelper, but got stuck due to the complexity and variety of the 'design patterns' that have been used.