This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 7a6b265f0039fcc6c494c897710ac797238b27c4
Author: Alex Harui <aha...@apache.org>
AuthorDate: Sat Feb 3 08:22:57 2018 -0800

    fix up more detail entries
---
 .../ASDoc/src/main/royale/ASDocMainView.mxml       | 20 ++++++-
 .../ASDoc/src/main/royale/AttributeRenderer.as     | 61 ++++++++++++++++++++++
 .../ASDoc/src/main/royale/models/ASDocModel.as     | 16 +++---
 3 files changed, 88 insertions(+), 9 deletions(-)

diff --git a/examples/royale/ASDoc/src/main/royale/ASDocMainView.mxml 
b/examples/royale/ASDoc/src/main/royale/ASDocMainView.mxml
index 20e137f..5e13dd1 100644
--- a/examples/royale/ASDoc/src/main/royale/ASDocMainView.mxml
+++ b/examples/royale/ASDoc/src/main/royale/ASDocMainView.mxml
@@ -156,6 +156,21 @@ limitations under the License.
                        font-size: 20px;
         }
         
+        .attributeList {
+            border-style: none;
+            margin-top: 10px;
+            margin-bottom: 10px;
+        }
+        
+        .description {
+               margin-top: 10px;
+               margin-bottom: 10px;
+        }
+        
+        .attributeCaption {
+            font-weight: bold;
+        }
+        
        </fx:Style>
        <fx:Declarations>
                <fx:Component className="AltBGRenderer">
@@ -241,8 +256,9 @@ limitations under the License.
                                </js:beads>
                            </js:List>
                        </js:Group>
-                   <js:MultilineLabel id="attributes" 
text="{ASDocModel(applicationModel).attributes}" width="100%"/>
-                   <js:MultilineLabel id="description" 
text="{ASDocModel(applicationModel).description}" width="100%"/>
+                   <js:DataContainer id="attributes" className="attributeList" 
dataProvider="{ASDocModel(applicationModel).attributes}" 
+                       itemRenderer="AttributeRenderer" width="100%"/>
+                   <js:MultilineLabel id="description" className="description" 
text="{ASDocModel(applicationModel).description}" width="100%"/>
                    <js:Label text="Public Properties" 
className="sectionLabel"/>
                    <js:List id="publicPropertyList" 
dataProvider="{ASDocModel(applicationModel).publicProperties}"
                             itemRenderer="SummaryRenderer" width="100%"/>
diff --git a/examples/royale/ASDoc/src/main/royale/AttributeRenderer.as 
b/examples/royale/ASDoc/src/main/royale/AttributeRenderer.as
new file mode 100644
index 0000000..4739506
--- /dev/null
+++ b/examples/royale/ASDoc/src/main/royale/AttributeRenderer.as
@@ -0,0 +1,61 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package
+{
+import  org.apache.royale.html.supportClasses.StringItemRenderer;
+
+       /**
+        *  The AttributeRenderer class displays an ASDoc attribute.  
+        *
+        *  @langversion 3.0
+        *  @playerversion Flash 10.2
+        *  @playerversion AIR 2.6
+        *  @productversion Royale 0.0
+        */
+       public class AttributeRenderer extends StringItemRenderer
+       {
+               /**
+                *  constructor.
+                *
+                *  @langversion 3.0
+                *  @playerversion Flash 10.2
+                *  @playerversion AIR 2.6
+                *  @productversion Royale 0.0
+                */
+               public function AttributeRenderer()
+               {
+                       typeNames = "AttributeRenderer"
+               }
+
+               override public function set text(value:String):void
+               {
+                       var html:String = "<span class='attributeCaption'>" + 
data.name + "</span>";
+                       html += "<span class='attributeValue'>" + data.value + 
"</span>";
+            COMPILE::SWF
+            {
+                textField.htmlText = value;
+            }
+            COMPILE::JS
+            {
+                this.element.innerHTML = html;
+            }
+               }
+
+       }
+}
diff --git a/examples/royale/ASDoc/src/main/royale/models/ASDocModel.as 
b/examples/royale/ASDoc/src/main/royale/models/ASDocModel.as
index 76de577..f69f155 100644
--- a/examples/royale/ASDoc/src/main/royale/models/ASDocModel.as
+++ b/examples/royale/ASDoc/src/main/royale/models/ASDocModel.as
@@ -399,22 +399,24 @@ package models
             return _inheritance;
         }
        
-        private var _attributes:String;
+        private var _attributes:Array;
         
         [Bindable("currentDataChanged")]
-        public function get attributes():String
+        public function get attributes():Array
         {
             if (!_attributes)
             {
-                var s:String = "";
+               _attributes = [];
                 for (var p:String in _attributesMap)
                 {
+                    var obj:Object = {};
                     var o:Array = _attributesMap[p];
                     var k:String = tagNameMap[p];
                     if (k != null)
-                        s += k + " ";
+                        obj.name = k;
                     else
-                        s += p + ": ";
+                        obj.name = p;
+                    var s:String = "";
                     var firstOne:Boolean = true;
                     for each (var q:String in o)
                     {
@@ -423,9 +425,9 @@ package models
                         firstOne = false;
                         s += q;
                     }
-                    s += "\n";
+                    obj.value = s;
+                    _attributes.push(obj);
                 }
-                _attributes = s;
             }
             return _attributes;
         }

-- 
To stop receiving notification emails like this one, please contact
aha...@apache.org.

Reply via email to