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 org.vaadin.teemu.switchui.Switch;
|
12
|
|
13
|
/**
|
14
|
* @author a.kohlbecker
|
15
|
* @since May 11, 2017
|
16
|
*
|
17
|
*/
|
18
|
public class SwitchButton extends Switch {
|
19
|
|
20
|
private static final long serialVersionUID = 2557108593729214773L;
|
21
|
|
22
|
private ValueChangeListener valueSetListener = null;
|
23
|
|
24
|
public SwitchButton() {
|
25
|
super();
|
26
|
}
|
27
|
|
28
|
/**
|
29
|
* {@inheritDoc}
|
30
|
*/
|
31
|
@Override
|
32
|
protected void setInternalValue(Boolean newValue) {
|
33
|
super.setInternalValue(newValue);
|
34
|
if(valueSetListener != null){
|
35
|
valueSetListener.valueChange(new ValueChangeEvent(this));
|
36
|
}
|
37
|
}
|
38
|
|
39
|
public void setValueSetLister(ValueChangeListener valueSetListener){
|
40
|
this.valueSetListener = valueSetListener;
|
41
|
}
|
42
|
|
43
|
}
|