[sitemap] Add releaseOnly parameter to Slider sitemap element (#4084)
Related to #3430 Signed-off-by: Laurent Garnier <lg.hc@free.fr>pull/4091/head
parent
0efaf23d4e
commit
a906d09b40
|
@ -584,6 +584,7 @@ public class SitemapResource
|
|||
if (widget instanceof Slider sliderWidget) {
|
||||
bean.sendFrequency = sliderWidget.getFrequency();
|
||||
bean.switchSupport = sliderWidget.isSwitchEnabled();
|
||||
bean.releaseOnly = sliderWidget.isReleaseOnly();
|
||||
bean.minValue = sliderWidget.getMinValue();
|
||||
bean.maxValue = sliderWidget.getMaxValue();
|
||||
bean.step = sliderWidget.getStep();
|
||||
|
|
|
@ -55,6 +55,7 @@ public class WidgetDTO {
|
|||
// widget-specific attributes
|
||||
public final List<MappingDTO> mappings = new ArrayList<>();
|
||||
public Boolean switchSupport;
|
||||
public Boolean releaseOnly;
|
||||
public Integer sendFrequency;
|
||||
public Integer refresh;
|
||||
public Integer height;
|
||||
|
|
|
@ -127,7 +127,8 @@ Slider:
|
|||
('icon=[' (IconRules+=IconRule (',' IconRules+=IconRule)*) ']') |
|
||||
('staticIcon=' staticIcon=Icon))? &
|
||||
('sendFrequency=' frequency=INT)? & (switchEnabled?='switchSupport')? &
|
||||
('minValue=' minValue=Number)? & ('maxValue=' maxValue=Number)? & ('step=' step=Number)? &
|
||||
(releaseOnly?='releaseOnly')? & ('minValue=' minValue=Number)? &
|
||||
('maxValue=' maxValue=Number)? & ('step=' step=Number)? &
|
||||
('labelcolor=[' (LabelColor+=ColorArray (',' LabelColor+=ColorArray)*) ']')? &
|
||||
('valuecolor=[' (ValueColor+=ColorArray (',' ValueColor+=ColorArray)*) ']')? &
|
||||
('iconcolor=[' (IconColor+=ColorArray (',' IconColor+=ColorArray)*) ']')? &
|
||||
|
|
|
@ -240,6 +240,8 @@ public class UIComponentSitemapProvider implements SitemapProvider, RegistryChan
|
|||
setWidgetPropertyFromComponentConfig(widget, component, "step", SitemapPackage.SLIDER__STEP);
|
||||
setWidgetPropertyFromComponentConfig(widget, component, "switchEnabled",
|
||||
SitemapPackage.SLIDER__SWITCH_ENABLED);
|
||||
setWidgetPropertyFromComponentConfig(widget, component, "releaseOnly",
|
||||
SitemapPackage.SLIDER__RELEASE_ONLY);
|
||||
setWidgetPropertyFromComponentConfig(widget, component, "sendFrequency",
|
||||
SitemapPackage.SLIDER__FREQUENCY);
|
||||
break;
|
||||
|
|
|
@ -284,6 +284,7 @@ public class ItemUIRegistryImpl implements ItemUIRegistry {
|
|||
} else if (DimmerItem.class.equals(itemType)) {
|
||||
Slider slider = SitemapFactory.eINSTANCE.createSlider();
|
||||
slider.setSwitchEnabled(true);
|
||||
slider.setReleaseOnly(true);
|
||||
return slider;
|
||||
} else if (ImageItem.class.equals(itemType)) {
|
||||
return SitemapFactory.eINSTANCE.createImage();
|
||||
|
|
|
@ -815,6 +815,7 @@ public class ItemUIRegistryImplTest {
|
|||
defaultWidget = uiRegistry.getDefaultWidget(DimmerItem.class, ITEM_NAME);
|
||||
assertThat(defaultWidget, is(instanceOf(Slider.class)));
|
||||
assertThat(((Slider) defaultWidget).isSwitchEnabled(), is(true));
|
||||
assertThat(((Slider) defaultWidget).isReleaseOnly(), is(true));
|
||||
|
||||
defaultWidget = uiRegistry.getDefaultWidget(ImageItem.class, ITEM_NAME);
|
||||
assertThat(defaultWidget, is(instanceOf(Image.class)));
|
||||
|
|
Loading…
Reference in New Issue