Fix event listening for duration field

Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
SirWayne
2016-03-09 16:26:33 +01:00
parent a4cc3df092
commit e47d540eb5
3 changed files with 5 additions and 11 deletions

View File

@@ -9,13 +9,11 @@
package org.eclipse.hawkbit; package org.eclipse.hawkbit;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/** /**
* Properties for the server e.g. the server's URL which must be configured. * Properties for the server e.g. the server's URL which must be configured.
* *
*/ */
@Component
@ConfigurationProperties("hawkbit.server") @ConfigurationProperties("hawkbit.server")
public class HawkbitServerProperties { public class HawkbitServerProperties {
/** /**

View File

@@ -47,7 +47,7 @@ import com.mongodb.MongoClientOptions;
*/ */
@Configuration @Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true, mode = AdviceMode.ASPECTJ, proxyTargetClass = true, securedEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true, mode = AdviceMode.ASPECTJ, proxyTargetClass = true, securedEnabled = true)
@EnableConfigurationProperties({ DdiSecurityProperties.class }) @EnableConfigurationProperties({ HawkbitServerProperties.class, DdiSecurityProperties.class })
@Profile("test") @Profile("test")
public class TestConfiguration implements AsyncConfigurer { public class TestConfiguration implements AsyncConfigurer {

View File

@@ -26,7 +26,7 @@ import com.vaadin.ui.GridLayout;
* duration in the DurationField or he can configure using the global duration * duration in the DurationField or he can configure using the global duration
* by changing the CheckBox. * by changing the CheckBox.
*/ */
public class DurationConfigField extends GridLayout implements ValueChangeListener, ConfigurationItem { public class DurationConfigField extends GridLayout implements ConfigurationItem {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@@ -50,15 +50,11 @@ public class DurationConfigField extends GridLayout implements ValueChangeListen
this.addComponent(durationField, 1, 0); this.addComponent(durationField, 1, 0);
this.setComponentAlignment(durationField, Alignment.MIDDLE_LEFT); this.setComponentAlignment(durationField, Alignment.MIDDLE_LEFT);
checkBox.addValueChangeListener(this); checkBox.addValueChangeListener(event->checkBoxChange());
durationField.addValueChangeListener(this); durationField.addValueChangeListener(event->notifyConfigurationChanged());
} }
@Override private void checkBoxChange() {
public void valueChange(final ValueChangeEvent event) {
if (event.getProperty() != checkBox) {
return;
}
durationField.setEnabled(checkBox.getValue()); durationField.setEnabled(checkBox.getValue());
if (!checkBox.getValue()) { if (!checkBox.getValue()) {