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 2019/05/08 19:05:44 UTC
[royale-asjs] branch develop updated: tourdejewel: simplify code
extending a renderer from another
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
The following commit(s) were added to refs/heads/develop by this push:
new 3d59cca tourdejewel: simplify code extending a renderer from another
3d59cca is described below
commit 3d59ccad9e5ecb4515c41ff386a0fbec28707816
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Wed May 8 21:05:36 2019 +0200
tourdejewel: simplify code extending a renderer from another
---
.../royale/itemRenderers/IconListItemRenderer.mxml | 7 +++--
.../itemRenderers/TableStyleListItemRenderer.mxml | 34 +++-------------------
2 files changed, 8 insertions(+), 33 deletions(-)
diff --git a/examples/royale/TourDeJewel/src/main/royale/itemRenderers/IconListItemRenderer.mxml b/examples/royale/TourDeJewel/src/main/royale/itemRenderers/IconListItemRenderer.mxml
index 0c61d93..4a37606 100644
--- a/examples/royale/TourDeJewel/src/main/royale/itemRenderers/IconListItemRenderer.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/itemRenderers/IconListItemRenderer.mxml
@@ -24,10 +24,11 @@ limitations under the License.
<fx:Script>
<![CDATA[
- import vos.IconListVO;
- import org.apache.royale.jewel.List;
import org.apache.royale.collections.ArrayList;
+ import org.apache.royale.jewel.List;
import org.apache.royale.jewel.beads.views.ListView;
+
+ import vos.IconListVO;
[Bindable("dataChange")]
public function get iconList():IconListVO
@@ -35,7 +36,7 @@ limitations under the License.
return data as IconListVO;
}
- private function clickCloseButton():void
+ public function clickCloseButton():void
{
var view:ListView = this.itemRendererParent as ListView;
if (view) {
diff --git a/examples/royale/TourDeJewel/src/main/royale/itemRenderers/TableStyleListItemRenderer.mxml b/examples/royale/TourDeJewel/src/main/royale/itemRenderers/TableStyleListItemRenderer.mxml
index b5d3ee8..8a02c77 100644
--- a/examples/royale/TourDeJewel/src/main/royale/itemRenderers/TableStyleListItemRenderer.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/itemRenderers/TableStyleListItemRenderer.mxml
@@ -17,36 +17,10 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-<j:ListItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
+<itemRenderers: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="http://www.w3.org/1999/xhtml">
-
- <fx:Script>
- <![CDATA[
- import vos.IconListVO;
- import org.apache.royale.jewel.List;
- import org.apache.royale.collections.ArrayList;
- import org.apache.royale.jewel.beads.views.ListView;
-
- [Bindable("dataChange")]
- public function get iconList():IconListVO
- {
- return data as IconListVO;
- }
-
- private function clickCloseButton():void
- {
- var view:ListView = this.itemRendererParent as ListView;
- if (view) {
- var host:List = view.host as List;
- if (host) {
- (host.dataProvider as ArrayList).removeItemAt(index);
- }
- }
- }
- ]]>
- </fx:Script>
+ xmlns:js="library://ns.apache.org/royale/basic"
+ xmlns:itemRenderers="itemRenderers.*">
<j:beads>
<js:ItemRendererDataBinding />
@@ -58,5 +32,5 @@ limitations under the License.
<j:Label html="Third field" multiline="true" width="100"/>
<j:Label html="Fourth field" multiline="true" width="200"/>
-</j:ListItemRenderer>
+</itemRenderers:IconListItemRenderer>