private void updateValueFromDataSource() { // Update the internal value from the data source String newConvertedValue = getDataSourceValue(); if (!SharedUtil.equals(newConvertedValue, getState(false).text)) { getState().text = newConvertedValue; fireValueChange(); } }
/** * Set the value of the label. Value of the label is the XML contents of the * label. Since Vaadin 7.2, changing the value of Label instance with that * method will fire ValueChangeEvent. * * @param newStringValue * the New value of the label. */ @Override public void setValue(String newStringValue) { if (getPropertyDataSource() == null) { LabelState state = getState(false); String oldTextValue = state.text; if (!SharedUtil.equals(oldTextValue, newStringValue)) { getState().text = newStringValue; fireValueChange(); } } else { throw new IllegalStateException( "Label is only a Property.Viewer and cannot update its data source"); } }