use of com.vaadin.data.HasValue.ValueChangeListener in project stockstat by rroart.
the class MyIclijUI method getMarkets.
private ListSelect getMarkets() {
ListSelect ls = new ListSelect("Get market");
Set<String> marketSet = null;
try {
List<String> markets = controlService.getMarkets();
markets.remove(null);
marketSet = new TreeSet<>(markets);
} catch (Exception e) {
log.error(Constants.EXCEPTION, e);
return ls;
}
log.info("languages " + marketSet);
if (marketSet == null) {
return ls;
}
ls.setItems(marketSet);
// ls.setNullSelectionAllowed(false);
// Show 5 items and a scrollbar if there are more
ls.setRows(5);
ls.addValueChangeListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
// Assuming that the value type is a String
Set<String> values = (Set<String>) event.getValue();
// TODO multi-valued?
String value = values.iterator().next();
// Do something with the value
try {
controlService.getIclijConf().setMarket(value);
} catch (Exception e) {
log.error(Constants.EXCEPTION, e);
}
}
});
// ls.setImmediate(true);
return ls;
}
use of com.vaadin.data.HasValue.ValueChangeListener in project stockstat by rroart.
the class MyIclijUI method getMLMarkets.
private ListSelect getMLMarkets() {
ListSelect ls = new ListSelect("Get ML market");
Set<String> marketSet = null;
try {
List<String> markets = controlService.getMarkets();
markets.remove(null);
marketSet = new TreeSet<>(markets);
} catch (Exception e) {
log.error(Constants.EXCEPTION, e);
return ls;
}
log.info("languages " + marketSet);
if (marketSet == null) {
return ls;
}
ls.setItems(marketSet);
// ls.setNullSelectionAllowed(false);
// Show 5 items and a scrollbar if there are more
ls.setRows(5);
ls.addValueChangeListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
// Assuming that the value type is a String
Set<String> values = (Set<String>) event.getValue();
// TODO multi-valued?
String value = values.iterator().next();
// Do something with the value
try {
controlService.getIclijConf().setMlmarket(value);
} catch (Exception e) {
log.error(Constants.EXCEPTION, e);
}
}
});
// ls.setImmediate(true);
return ls;
}
use of com.vaadin.data.HasValue.ValueChangeListener in project stockstat by rroart.
the class MyIclijUI method getDate.
private InlineDateField getDate() {
InlineDateField tf = new InlineDateField("Set comparison date");
// Create a DateField with the default style
// Set the date and time to present
LocalDate date = LocalDate.now();
tf.setValue(date);
// Handle changes in the value
tf.addValueChangeListener(new ValueChangeListener() {
public void valueChange(HasValue.ValueChangeEvent event) {
// Assuming that the value type is a String
LocalDate date = (LocalDate) event.getValue();
try {
controlService.getIclijConf().setDate(date);
Notification.show("Request sent");
// displayResults();
} catch (Exception e) {
log.error(Constants.EXCEPTION, e);
}
}
});
// tf.setImmediate(true);
return tf;
}
Aggregations