You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CtrlShiftMultiselectTouchDetectionDisabled.java 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package com.vaadin.tests.components.table;
  2. import java.util.Set;
  3. import com.vaadin.v7.data.Property;
  4. import com.vaadin.v7.ui.Label;
  5. public class CtrlShiftMultiselectTouchDetectionDisabled
  6. extends CtrlShiftMultiselect {
  7. protected Label label;
  8. @Override
  9. protected void setup() {
  10. super.setup();
  11. label = new Label("0");
  12. label.setId("count");
  13. label.setCaption("Amount of selected items");
  14. table.setMultiSelectTouchDetectionEnabled(false);
  15. table.addValueChangeListener(new Property.ValueChangeListener() {
  16. @Override
  17. public void valueChange(Property.ValueChangeEvent event) {
  18. Property property = event.getProperty();
  19. Set set = (Set) property.getValue();
  20. label.setValue("" + set.size());
  21. }
  22. });
  23. addComponent(label);
  24. }
  25. @Override
  26. protected String getDescription() {
  27. return "Allow disabling multi selection's touch screen detection for hybrid devices";
  28. }
  29. @Override
  30. protected Integer getTicketNumber() {
  31. return 11601;
  32. }
  33. }