diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/src/main/java/com/vaadin/client/ui/VListSelect.java | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/VListSelect.java b/client/src/main/java/com/vaadin/client/ui/VListSelect.java index 9ce897de0e..b00a9513f1 100644 --- a/client/src/main/java/com/vaadin/client/ui/VListSelect.java +++ b/client/src/main/java/com/vaadin/client/ui/VListSelect.java @@ -30,6 +30,7 @@ import com.vaadin.client.FastStringSet; import com.vaadin.client.Focusable; import com.vaadin.client.connectors.AbstractMultiSelectConnector.MultiSelectWidget; import com.vaadin.shared.Registration; +import com.vaadin.shared.ui.listselect.ListSelectState; import elemental.json.JsonObject; @@ -57,6 +58,7 @@ public class VListSelect extends Composite */ public VListSelect() { container = new FlowPanel(); + initWidget(container); select = new ListBox(); @@ -71,6 +73,13 @@ public class VListSelect extends Composite container.add(select); updateEnabledState(); + setStylePrimaryName(ListSelectState.PRIMARY_STYLENAME); + } + + @Override + public void setStylePrimaryName(String style) { + super.setStylePrimaryName(style); + select.setStyleName(style + "-select"); } /** @@ -105,24 +114,6 @@ public class VListSelect extends Composite } @Override - public void setStyleName(String style) { - super.setStyleName(style); - updateStyleNames(); - } - - @Override - public void setStylePrimaryName(String style) { - super.setStylePrimaryName(style); - updateStyleNames(); - } - - /** Update the style names for container & select. */ - protected void updateStyleNames() { - container.setStyleName(getStylePrimaryName()); - select.setStyleName(getStylePrimaryName() + "-select"); - } - - @Override public void setItems(List<JsonObject> items) { selectedItemKeys = FastStringSet.create(); for (int i = 0; i < items.size(); i++) { @@ -163,7 +154,7 @@ public class VListSelect extends Composite return selectedItemKeys; } - private void selectionEvent(Object source){ + private void selectionEvent(Object source) { if (source == select) { // selection can change by adding and at the same time removing // previous keys, or by just adding (e.g. when modifier keys are |