You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2020/05/13 14:50:25 UTC
[royale-asjs] 05/10: tour-de-jewel: refacotr item renders and even
clean checks in bindings not need now
This is an automated email from the ASF dual-hosted git repository.
carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit 0a6114def781f7c8320967ccb09e499c5e0e6004
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Mon May 11 19:44:27 2020 +0200
tour-de-jewel: refacotr item renders and even clean checks in bindings not need now
---
.../src/main/resources/jewel-example-styles.css | 6 ------
.../itemRenderers/AdvancedIconListItemRenderer.mxml | 14 +++++++-------
.../itemRenderers/CheckBoxDataGridItemRenderer.mxml | 2 +-
.../itemRenderers/IconDataGridItemRenderer.mxml | 4 ++--
.../royale/itemRenderers/IconListItemRenderer.mxml | 8 ++++----
.../itemRenderers/ImageDataGridItemRenderer.mxml | 2 +-
.../NavigationGroupExampleItemRenderer.mxml | 17 ++++++++---------
.../NavigationIconLinkItemRenderer.mxml | 11 ++++++-----
.../TabBarHorizontalIconItemRenderer.mxml | 6 +++---
.../TabBarVerticalIconItemRenderer.mxml | 6 +++---
.../itemRenderers/TableStyleListItemRenderer.mxml | 20 +++++++++++---------
11 files changed, 46 insertions(+), 50 deletions(-)
diff --git a/examples/jewel/TourDeJewel/src/main/resources/jewel-example-styles.css b/examples/jewel/TourDeJewel/src/main/resources/jewel-example-styles.css
index 3bed732..a1febdb 100644
--- a/examples/jewel/TourDeJewel/src/main/resources/jewel-example-styles.css
+++ b/examples/jewel/TourDeJewel/src/main/resources/jewel-example-styles.css
@@ -42,8 +42,6 @@ j|IconButtonBar
IItemRenderer: ClassReference("itemRenderers.SimpleIconListItemRenderer");
}
-
-
.iconListItemRenderer
{
IItemRenderer: ClassReference("itemRenderers.IconListItemRenderer");
@@ -53,10 +51,6 @@ j|IconButtonBar
{
IItemRenderer: ClassReference("itemRenderers.AdvancedIconListItemRenderer");
}
-.advancedIconListItemRenderer .fonticon
-{
- margin-right: 24px;
-}
.jewel.item .jewelItem {
color: #3cadf1;
diff --git a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/AdvancedIconListItemRenderer.mxml b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/AdvancedIconListItemRenderer.mxml
index 45123c4..7eea4ea 100644
--- a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/AdvancedIconListItemRenderer.mxml
+++ b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/AdvancedIconListItemRenderer.mxml
@@ -83,14 +83,14 @@ limitations under the License.
<j:beads>
<js:ItemRendererDataBinding/>
+ <j:HorizontalLayout gap="8" itemsVerticalAlign="itemsCenter"/>
</j:beads>
- <j:HGroup gap="8" itemsVerticalAlign="itemsCenter">
- <js:MaterialIcon text="{iconListItem ? iconListItem.icon : ''}"
- visible="{iconListItem ? iconListItem.icon != null : false}"
- className="{colorClass}"
- click="clickCloseButton()"/>
- <j:Label html="{text}" multiline="true"/>
- </j:HGroup>
+ <js:MaterialIcon text="{iconListItem.icon}"
+ visible="{iconListItem.icon != null}"
+ className="{colorClass}"
+ click="clickCloseButton()"/>
+
+ <j:Label html="{text}" multiline="true"/>
</j:ListItemRenderer>
diff --git a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/CheckBoxDataGridItemRenderer.mxml b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/CheckBoxDataGridItemRenderer.mxml
index c65ac99..40a3069 100644
--- a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/CheckBoxDataGridItemRenderer.mxml
+++ b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/CheckBoxDataGridItemRenderer.mxml
@@ -47,7 +47,7 @@ limitations under the License.
<j:HorizontalCenteredLayout/>
</j:beads>
- <j:CheckBox selected="{detailIconList ? detailIconList.componentSet == 'Jewel' : false}">
+ <j:CheckBox selected="{detailIconList.componentSet == 'Jewel'}">
<j:beads>
<j:Disabled disabled="true"/>
</j:beads>
diff --git a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/IconDataGridItemRenderer.mxml b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/IconDataGridItemRenderer.mxml
index 299fe3f..b5e6e78 100644
--- a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/IconDataGridItemRenderer.mxml
+++ b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/IconDataGridItemRenderer.mxml
@@ -50,8 +50,8 @@ limitations under the License.
<j:HorizontalCenteredLayout/>
</j:beads>
- <js:MaterialIcon text="{iconList ? iconList.icon : ''}"
- visible="{iconList ? iconList.icon != null : false}"
+ <js:MaterialIcon text="{iconList.icon}"
+ visible="{iconList.icon != null}"
click="clickCloseButton(event)"/>
</j:DataGridItemRenderer>
diff --git a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/IconListItemRenderer.mxml b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/IconListItemRenderer.mxml
index a827384..8f79390 100644
--- a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/IconListItemRenderer.mxml
+++ b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/IconListItemRenderer.mxml
@@ -58,12 +58,12 @@ limitations under the License.
<js:ItemRendererDataBinding />
<j:ToolTip localId="tt" toolTip="{getToolTip(text)}"/>
<js:ToolTipRemovalWhenItemRemoved tooltip="{tt}"/>
+ <j:HorizontalLayout gap="8" itemsVerticalAlign="itemsCenter"/>
</j:beads>
- <j:HGroup gap="8" itemsVerticalAlign="itemsCenter">
- <js:MaterialIcon text="{iconList.icon}" visible="{iconList.icon != null}" click="clickCloseButton()"/>
- <j:Label html="{text}" multiline="true"/>
- </j:HGroup>
+ <js:MaterialIcon text="{iconList.icon}" visible="{iconList.icon != null}" click="clickCloseButton()"/>
+
+ <j:Label html="{text}" multiline="true"/>
</j:ListItemRenderer>
diff --git a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/ImageDataGridItemRenderer.mxml b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/ImageDataGridItemRenderer.mxml
index bc6be43..83c5f6f 100644
--- a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/ImageDataGridItemRenderer.mxml
+++ b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/ImageDataGridItemRenderer.mxml
@@ -39,7 +39,7 @@ limitations under the License.
<j:HorizontalCenteredLayout/>
</j:beads>
- <j:Image src="{ product ? product.image : '' }"/>
+ <j:Image src="{product.image}"/>
</j:DataGridItemRenderer>
diff --git a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/NavigationGroupExampleItemRenderer.mxml b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/NavigationGroupExampleItemRenderer.mxml
index 5041fd2..e6a02d6 100644
--- a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/NavigationGroupExampleItemRenderer.mxml
+++ b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/NavigationGroupExampleItemRenderer.mxml
@@ -21,8 +21,8 @@ limitations under the License.
xmlns:j="library://ns.apache.org/royale/jewel"
xmlns:js="library://ns.apache.org/royale/basic"
xmlns:html="library://ns.apache.org/royale/html"
- className="layout vertical"
- sectionClick="handleNavToggle(event)">
+ sectionClick="handleNavToggle(event)"
+ height="48">
<fx:Script>
<![CDATA[
@@ -79,16 +79,15 @@ limitations under the License.
<j:beads>
<js:ItemRendererDataBinding />
+ <j:HorizontalLayout gap="8" itemsVerticalAlign="itemsCenter"/>
</j:beads>
- <j:HGroup gap="8" itemsVerticalAlign="itemsCenter">
- <js:MaterialIcon text="{navlink.icon}" visible="{navlink.icon != null}"/>
+ <js:MaterialIcon text="{navlink.icon}" visible="{navlink.icon != null}"/>
- <html:Span className="navigation-section-title" text="{text}"/>
-
- <js:MaterialIcon text="{open? MaterialIconType.EXPAND_LESS: MaterialIconType.EXPAND_MORE}" className="hint"
- visible="{navlink.subMenu != null}" />
- </j:HGroup>
+ <html:Span className="navigation-section-title" text="{text}"/>
+
+ <js:MaterialIcon text="{open? MaterialIconType.EXPAND_LESS: MaterialIconType.EXPAND_MORE}" className="hint"
+ visible="{navlink.subMenu != null}" />
</j:CollapsibleNavigationSectionRenderer>
diff --git a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/NavigationIconLinkItemRenderer.mxml b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/NavigationIconLinkItemRenderer.mxml
index 42aff86..86c92f0 100644
--- a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/NavigationIconLinkItemRenderer.mxml
+++ b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/NavigationIconLinkItemRenderer.mxml
@@ -21,7 +21,8 @@ limitations under the License.
xmlns:j="library://ns.apache.org/royale/jewel"
xmlns:js="library://ns.apache.org/royale/basic"
xmlns:html="library://ns.apache.org/royale/html"
- xmlns="http://www.w3.org/1999/xhtml">
+ xmlns="http://www.w3.org/1999/xhtml"
+ height="48">
<fx:Script>
<![CDATA[
@@ -37,12 +38,12 @@ limitations under the License.
<j:beads>
<js:ItemRendererDataBinding />
+ <j:HorizontalLayout gap="8" itemsVerticalAlign="itemsCenter"/>
</j:beads>
- <j:HGroup gap="8" itemsVerticalAlign="itemsCenter">
- <js:MaterialIcon text="{navlink.icon}" visible="{navlink.icon != null}"/>
- <html:Span text="{navlink.label}"/>
- </j:HGroup>
+ <js:MaterialIcon text="{navlink.icon}" visible="{navlink.icon != null}"/>
+
+ <html:Span text="{navlink.label}"/>
</j:NavigationLinkItemRenderer>
diff --git a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/TabBarHorizontalIconItemRenderer.mxml b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/TabBarHorizontalIconItemRenderer.mxml
index 26f8828..ab6c292 100644
--- a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/TabBarHorizontalIconItemRenderer.mxml
+++ b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/TabBarHorizontalIconItemRenderer.mxml
@@ -40,9 +40,9 @@ limitations under the License.
</j:beads>
<j:HGroup gap="4" itemsVerticalAlign="itemsCenter">
- <js:MaterialIcon text="{tabButton ? tabButton.icon : ''}"
- visible="{tabButton ? tabButton.icon != null : false}"/>
- <html:Span text="{tabButton ? tabButton.label : ''}"/>
+ <js:MaterialIcon text="{tabButton.icon}"
+ visible="{tabButton.icon != null}"/>
+ <html:Span text="{tabButton.label}"/>
</j:HGroup>
</j:TabBarButtonInidicatorRestrictedToContentItemRenderer>
diff --git a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/TabBarVerticalIconItemRenderer.mxml b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/TabBarVerticalIconItemRenderer.mxml
index b323763..c5d5c4f 100644
--- a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/TabBarVerticalIconItemRenderer.mxml
+++ b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/TabBarVerticalIconItemRenderer.mxml
@@ -40,9 +40,9 @@ limitations under the License.
</j:beads>
<j:VGroup itemsHorizontalAlign="itemsCenter">
- <js:MaterialIcon text="{tabButton ? tabButton.icon : ''}"
- visible="{tabButton ? tabButton.icon != null : false}"/>
- <html:Span text="{tabButton ? tabButton.label : ''}"/>
+ <js:MaterialIcon text="{tabButton.icon}"
+ visible="{tabButton.icon != null}"/>
+ <html:Span text="{tabButton.label}"/>
</j:VGroup>
</j:TabBarButtonInidicatorRestrictedToContentItemRenderer>
diff --git a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/TableStyleListItemRenderer.mxml b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/TableStyleListItemRenderer.mxml
index 49c6d7f..afbef18 100644
--- a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/TableStyleListItemRenderer.mxml
+++ b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/TableStyleListItemRenderer.mxml
@@ -20,20 +20,22 @@ limitations under the License.
<ir:IconListItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:j="library://ns.apache.org/royale/jewel"
xmlns:js="library://ns.apache.org/royale/basic"
- xmlns:ir="itemRenderers.*"
- width="100%">
+ xmlns:ir="itemRenderers.*">
<ir:beads>
<js:ItemRendererDataBinding />
- <j:HorizontalLayout/>
+ <j:HorizontalLayout itemsVerticalAlign="itemsCenter"/>
</ir:beads>
- <!-- <j:HGroup itemsVerticalAlign="itemsCenter"> -->
- <js:MaterialIcon text="{iconList ? iconList.icon : ''}" visible="{iconList ? iconList.icon != null : false}" click="clickCloseButton()" width="100"/>
- <j:Label html="{text}" multiline="true" width="300"/>
- <j:Label html="Third field" multiline="true" width="100"/>
- <j:Label html="Fourth field" multiline="true" width="200"/>
- <!-- </j:HGroup> -->
+ <js:MaterialIcon text="{iconList.icon}"
+ visible="{iconList.icon != null}"
+ click="clickCloseButton()" width="100"/>
+
+ <j:Label html="{text}" multiline="true" width="300"/>
+
+ <j:Label html="Third field" multiline="true" width="100"/>
+
+ <j:Label html="Fourth field" multiline="true" width="200"/>
</ir:IconListItemRenderer>