Skip to content

Commit

Permalink
buttongrid with buttons for UI defined sitemap
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Herwege <[email protected]>
  • Loading branch information
mherwege committed Sep 12, 2024
1 parent bcda209 commit 6326894
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.openhab.core.model.sitemap.sitemap.VisibilityRule;
import org.openhab.core.model.sitemap.sitemap.Widget;
import org.openhab.core.model.sitemap.sitemap.impl.ButtonDefinitionImpl;
import org.openhab.core.model.sitemap.sitemap.impl.ButtonImpl;
import org.openhab.core.model.sitemap.sitemap.impl.ButtongridImpl;
import org.openhab.core.model.sitemap.sitemap.impl.ChartImpl;
import org.openhab.core.model.sitemap.sitemap.impl.ColorArrayImpl;
Expand Down Expand Up @@ -270,6 +271,16 @@ protected Sitemap buildSitemap(RootUIComponent rootComponent) {
addWidgetButtons(buttongridWidget.getButtons(), component);
widget = buttongridWidget;
break;
case "Button":
ButtonImpl buttonWidget = (ButtonImpl) SitemapFactory.eINSTANCE.createButton();
widget = buttonWidget;
setWidgetPropertyFromComponentConfig(widget, component, "row", SitemapPackage.BUTTON__ROW);
setWidgetPropertyFromComponentConfig(widget, component, "column", SitemapPackage.BUTTON__COLUMN);
setWidgetPropertyFromComponentConfig(widget, component, "stateless", SitemapPackage.BUTTON__STATELESS);
setWidgetPropertyFromComponentConfig(widget, component, "cmd", SitemapPackage.BUTTON__CMD);
setWidgetPropertyFromComponentConfig(widget, component, "releaseCmd",
SitemapPackage.BUTTON__RELEASE_CMD);
break;
case "Default":
DefaultImpl defaultWidget = (DefaultImpl) SitemapFactory.eINSTANCE.createDefault();
widget = defaultWidget;
Expand Down

0 comments on commit 6326894

Please sign in to comment.