Revision a7612c19
Added by Andreas Kohlbecker over 5 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/StartRegistrationViewBean.java | ||
---|---|---|
24 | 24 |
import com.vaadin.ui.CssLayout; |
25 | 25 |
import com.vaadin.ui.HorizontalLayout; |
26 | 26 |
import com.vaadin.ui.Label; |
27 |
import com.vaadin.ui.OptionGroup; |
|
27 | 28 |
import com.vaadin.ui.VerticalLayout; |
28 | 29 |
import com.vaadin.ui.themes.ValoTheme; |
29 | 30 |
|
30 | 31 |
import eu.etaxonomy.cdm.model.reference.Reference; |
32 |
import eu.etaxonomy.cdm.persistence.query.MatchMode; |
|
31 | 33 |
import eu.etaxonomy.cdm.ref.TypedEntityReference; |
32 | 34 |
import eu.etaxonomy.cdm.vaadin.event.ReferenceEditorAction; |
33 | 35 |
import eu.etaxonomy.cdm.vaadin.event.RegistrationEditorAction; |
34 | 36 |
import eu.etaxonomy.cdm.vaadin.permission.AccessRestrictedView; |
37 |
import eu.etaxonomy.cdm.vaadin.theme.EditValoTheme; |
|
35 | 38 |
import eu.etaxonomy.cdm.vaadin.view.AbstractPageView; |
36 | 39 |
import eu.etaxonomy.vaadin.event.EditorActionType; |
37 | 40 |
|
... | ... | |
53 | 56 |
|
54 | 57 |
private LazyComboBox<TypedEntityReference<Reference>> referenceCombobox; |
55 | 58 |
|
59 |
private OptionGroup searchModeOptions = new OptionGroup("Search mode"); |
|
60 |
|
|
56 | 61 |
private Button newPublicationButton; |
57 | 62 |
|
58 | 63 |
private Button removeNewPublicationButton; |
... | ... | |
104 | 109 |
continueButton.setEnabled(isValueSelected); |
105 | 110 |
}); |
106 | 111 |
|
112 |
searchModeOptions.addItems(MatchMode.BEGINNING, MatchMode.ANYWHERE); |
|
113 |
searchModeOptions.setValue(MatchMode.BEGINNING); |
|
114 |
searchModeOptions.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL); |
|
115 |
searchModeOptions.addStyleName(EditValoTheme.OPTIONGROUP_CAPTION_FIX); |
|
116 |
searchModeOptions.addValueChangeListener(e -> getPresenter().updateReferenceSearchMode((MatchMode)e.getProperty().getValue())); |
|
117 |
|
|
107 | 118 |
newPublicationButton = new Button("New"); |
108 | 119 |
newPublicationButton.addClickListener( e -> getViewEventBus().publish(this, |
109 | 120 |
new ReferenceEditorAction(EditorActionType.ADD, newPublicationButton, null, this) |
... | ... | |
128 | 139 |
labelLeft.setWidth(ELEMENT_WIDTH); |
129 | 140 |
labelRight.setWidth(ELEMENT_WIDTH); |
130 | 141 |
|
131 |
CssLayout leftContainer = new CssLayout(labelLeft, referenceCombobox); |
|
142 |
CssLayout leftContainer = new CssLayout(labelLeft, referenceCombobox, searchModeOptions);
|
|
132 | 143 |
CssLayout rightContainer = new CssLayout(labelRight, newPublicationButton, removeNewPublicationButton, newPublicationLabel); |
133 | 144 |
leftContainer.setWidth(ELEMENT_WIDTH); |
134 | 145 |
rightContainer.setWidth(ELEMENT_WIDTH); |
Also available in: Unified diff
fix #7949 Reference combobox with begins and anywhere search mode