fix #7588 updating buttons on setDataSource
[cdm-vaadin.git] / src / main / java / eu / etaxonomy / vaadin / component / ToOneRelatedEntityField.java
1 /**
2 * Copyright (C) 2017 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9 package eu.etaxonomy.vaadin.component;
10
11 import com.vaadin.ui.Button.ClickListener;
12
13 import eu.etaxonomy.cdm.vaadin.event.NestedButtonStateUpdater;
14
15 /**
16 * @author a.kohlbecker
17 * @since May 25, 2017
18 *
19 */
20 public interface ToOneRelatedEntityField<V extends Object> {
21
22 public void setNestedButtonStateUpdater(NestedButtonStateUpdater<V> buttonUpdater);
23
24 /**
25 * Set the enabled state of the edit button
26 *
27 * @param enabled
28 */
29 public void setEditButtonEnabled(boolean enabled);
30
31 /**
32 * Adds the click listener to the add-entity-button.
33 *
34 * @param listener
35 * the Listener to be added.
36 */
37 public void addClickListenerAddEntity(ClickListener listener);
38
39 /**
40 * Set the enabled state of the add button
41 *
42 * @param enabled
43 */
44 public void setAddButtonEnabled(boolean enabled);
45
46 /**
47 * Adds the click listener to the edit-entity-button.
48 *
49 * @param listener
50 * the Listener to be added.
51 */
52 public void addClickListenerEditEntity(ClickListener listener);
53
54 public void selectNewItem(V bean);
55
56 public Class<? extends V> getType();
57
58 }