Project

General

Profile

« Previous | Next » 

Revision bf643f22

Added by Andreas Kohlbecker over 5 years ago

fix #7951 ReferenceLabelProvider to ellipsis the reference labels

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/StartRegistrationViewBean.java
17 17
import com.vaadin.navigator.View;
18 18
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
19 19
import com.vaadin.spring.annotation.SpringView;
20
import com.vaadin.ui.AbstractSelect;
20 21
import com.vaadin.ui.Alignment;
21 22
import com.vaadin.ui.Button;
23
import com.vaadin.ui.ComboBox;
22 24
import com.vaadin.ui.CssLayout;
23 25
import com.vaadin.ui.HorizontalLayout;
24 26
import com.vaadin.ui.Label;
......
26 28
import com.vaadin.ui.themes.ValoTheme;
27 29

  
28 30
import eu.etaxonomy.cdm.model.reference.Reference;
31
import eu.etaxonomy.cdm.ref.TypedEntityReference;
29 32
import eu.etaxonomy.cdm.vaadin.event.ReferenceEditorAction;
30 33
import eu.etaxonomy.cdm.vaadin.event.RegistrationEditorAction;
31 34
import eu.etaxonomy.cdm.vaadin.permission.AccessRestrictedView;
......
48 51
    public static final String SUBHEADER_DEEFAULT = "Any valid nomenclatural act can only be etablished in a publication. "
49 52
            + "To start a new registration process, please choose an existing one or create a new publication.";
50 53

  
51
    private LazyComboBox<Reference> referenceCombobox;
54
    private LazyComboBox<TypedEntityReference<Reference>> referenceCombobox;
52 55

  
53 56
    private Button newPublicationButton;
54 57

  
......
80 83
        HorizontalLayout publicationLayout = new HorizontalLayout();
81 84
        publicationLayout.setSpacing(true);
82 85

  
83
        referenceCombobox = new LazyComboBox<Reference>(Reference.class);
86
        Class<TypedEntityReference<Reference>> type = (Class<TypedEntityReference<Reference>>) new TypedEntityReference<Reference>(Reference.class, null).getClass();
87
        referenceCombobox = new LazyComboBox<TypedEntityReference<Reference>>(type) {
88

  
89
            @Override
90
            protected void setSelectInstance(AbstractSelect select) {
91
                if(select instanceof ComboBox){
92
                    ComboBox combobox = (ComboBox)select;
93
                    // uncomment the below line to set a defined width for the ComboBox popup
94
                    // combobox.setPopupWidth("200%");
95
                }
96
                super.setSelectInstance(select);
97
            }
98

  
99
        };
84 100
        referenceCombobox.setWidth(ELEMENT_WIDTH);
85 101
        referenceCombobox.setBuffered(false);
86 102
        referenceCombobox.addValueChangeListener( e -> {
......
102 118
        removeNewPublicationButton.setStyleName(ValoTheme.BUTTON_DANGER);
103 119
        removeNewPublicationButton.setWidth(ELEMENT_WIDTH);
104 120
        removeNewPublicationButton.addClickListener( e -> getViewEventBus().publish(this,
105
                new ReferenceEditorAction(EditorActionType.REMOVE, removeNewPublicationButton, referenceCombobox, this)
121
                new ReferenceEditorAction(EditorActionType.REMOVE, removeNewPublicationButton, null, this)
106 122
                ));
107 123

  
108 124
        removeNewPublicationButton.setVisible(false);
......
200 216
     * @return the referenceCombobox
201 217
     */
202 218
    @Override
203
    public LazyComboBox<Reference> getReferenceCombobox() {
219
    public LazyComboBox<TypedEntityReference<Reference>> getReferenceCombobox() {
204 220
        return referenceCombobox;
205 221
    }
206 222

  

Also available in: Unified diff