From e423b6f3277ce844c88241d2f0086035ba0fca3a Mon Sep 17 00:00:00 2001 From: Adrian Egloff Date: Thu, 27 Feb 2025 15:53:27 +0100 Subject: [PATCH] Allow to set animateBoundsChange property on java tile widget --- .../scout/rt/client/ui/tile/AbstractTile.java | 20 +++++++++++++++++++ .../scout/rt/client/ui/tile/ITile.java | 5 +++++ .../scout/rt/ui/html/json/tile/JsonTile.java | 12 ++++++++--- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/org.eclipse.scout.rt.client/src/main/java/org/eclipse/scout/rt/client/ui/tile/AbstractTile.java b/org.eclipse.scout.rt.client/src/main/java/org/eclipse/scout/rt/client/ui/tile/AbstractTile.java index f0c44f4af21..0c3489c833c 100644 --- a/org.eclipse.scout.rt.client/src/main/java/org/eclipse/scout/rt/client/ui/tile/AbstractTile.java +++ b/org.eclipse.scout.rt.client/src/main/java/org/eclipse/scout/rt/client/ui/tile/AbstractTile.java @@ -86,6 +86,7 @@ protected void initConfig() { setCssClass(getConfiguredCssClass()); setDisplayStyle(getConfiguredDisplayStyle()); setGridDataHints(getConfiguredGridDataHints()); + setAnimateBoundsChange(getConfiguredAnimateBoundsChange()); } @Override @@ -190,6 +191,15 @@ protected String getConfiguredDisplayStyle() { return DISPLAY_STYLE_DEFAULT; } + /** + * Configures whether to animate changes of the tile bounds. The default is true. + */ + @ConfigProperty(ConfigProperty.BOOLEAN) + @Order(150) + protected boolean getConfiguredAnimateBoundsChange() { + return true; + } + /** * Configures the grid data for this tile. *

@@ -295,6 +305,16 @@ protected void setDisplayStyle(String style) { propertySupport.setPropertyString(PROP_DISPLAY_STYLE, style); } + @Override + public boolean isAnimateBoundsChange() { + return propertySupport.getPropertyBool(PROP_ANIMATE_BOUNDS_CHANGE); + } + + @Override + public void setAnimateBoundsChange(boolean animateBoundsChange) { + propertySupport.setPropertyBool(PROP_ANIMATE_BOUNDS_CHANGE, animateBoundsChange); + } + protected IDataChangeListener getInternalDataChangeListener() { return m_internalDataChangeListener; } diff --git a/org.eclipse.scout.rt.client/src/main/java/org/eclipse/scout/rt/client/ui/tile/ITile.java b/org.eclipse.scout.rt.client/src/main/java/org/eclipse/scout/rt/client/ui/tile/ITile.java index 7ece598e371..f5a73373a01 100644 --- a/org.eclipse.scout.rt.client/src/main/java/org/eclipse/scout/rt/client/ui/tile/ITile.java +++ b/org.eclipse.scout.rt.client/src/main/java/org/eclipse/scout/rt/client/ui/tile/ITile.java @@ -26,6 +26,7 @@ public interface ITile extends IWidget, IOrdered, IStyleable, IExtensibleObject, String PROP_COLOR_SCHEME = "colorScheme"; String PROP_GRID_DATA_HINTS = "gridDataHints"; String PROP_DISPLAY_STYLE = "displayStyle"; + String PROP_ANIMATE_BOUNDS_CHANGE = "animateBoundsChange"; /** * This is the default display style. If it is active, default styling is applied like visualizing the selection. @@ -77,4 +78,8 @@ public interface ITile extends IWidget, IOrdered, IStyleable, IExtensibleObject, @Override boolean isLoading(); + + boolean isAnimateBoundsChange(); + + void setAnimateBoundsChange(boolean animateBoundsChange); } diff --git a/org.eclipse.scout.rt.ui.html/src/main/java/org/eclipse/scout/rt/ui/html/json/tile/JsonTile.java b/org.eclipse.scout.rt.ui.html/src/main/java/org/eclipse/scout/rt/ui/html/json/tile/JsonTile.java index c14d621a016..e624eb8f6d7 100644 --- a/org.eclipse.scout.rt.ui.html/src/main/java/org/eclipse/scout/rt/ui/html/json/tile/JsonTile.java +++ b/org.eclipse.scout.rt.ui.html/src/main/java/org/eclipse/scout/rt/ui/html/json/tile/JsonTile.java @@ -50,19 +50,19 @@ public Object prepareValueForToJson(Object value) { return ((IColorScheme) value).getIdentifier(); } }); - putJsonProperty(new JsonProperty(IFormFieldTile.PROP_DISPLAY_STYLE, model) { + putJsonProperty(new JsonProperty<>(IFormFieldTile.PROP_DISPLAY_STYLE, model) { @Override protected String modelValue() { return getModel().getDisplayStyle(); } }); - putJsonProperty(new JsonProperty(ITile.PROP_LOADING, model) { + putJsonProperty(new JsonProperty<>(ITile.PROP_LOADING, model) { @Override protected Boolean modelValue() { return getModel().isLoading(); } }); - putJsonProperty(new JsonProperty(ITile.PROP_GRID_DATA_HINTS, model) { + putJsonProperty(new JsonProperty<>(ITile.PROP_GRID_DATA_HINTS, model) { @Override protected GridData modelValue() { return getModel().getGridDataHints(); @@ -73,5 +73,11 @@ public Object prepareValueForToJson(Object value) { return JsonGridData.toJson((GridData) value); } }); + putJsonProperty(new JsonProperty<>(ITile.PROP_ANIMATE_BOUNDS_CHANGE, model) { + @Override + protected Boolean modelValue() { + return getModel().isAnimateBoundsChange(); + } + }); } }