more fixes for asdoc app
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/05b0e230 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/05b0e230 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/05b0e230 Branch: refs/heads/develop Commit: 05b0e230a0293a65a2a9fff0bd459ccc21f87b35 Parents: 2143ae2 Author: Alex Harui <[email protected]> Authored: Sun Dec 11 23:34:43 2016 -0800 Committer: Alex Harui <[email protected]> Committed: Sun Dec 11 23:36:30 2016 -0800 ---------------------------------------------------------------------- .../ASDoc/src/main/flex/ASDocMainView.mxml | 2 +- .../ASDoc/src/main/flex/models/ASDocModel.as | 69 +++++++++++++++++++- 2 files changed, 68 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/05b0e230/examples/flexjs/ASDoc/src/main/flex/ASDocMainView.mxml ---------------------------------------------------------------------- diff --git a/examples/flexjs/ASDoc/src/main/flex/ASDocMainView.mxml b/examples/flexjs/ASDoc/src/main/flex/ASDocMainView.mxml index 26c6f18..25d4884 100644 --- a/examples/flexjs/ASDoc/src/main/flex/ASDocMainView.mxml +++ b/examples/flexjs/ASDoc/src/main/flex/ASDocMainView.mxml @@ -73,7 +73,7 @@ limitations under the License. <js:Label id="packageName" text="{ASDocModel(applicationModel).currentPackage}" width="100%"/> <js:Label id="baseName" text="{ASDocModel(applicationModel).currentClass}" width="100%" style="fontSize:20"/> <js:Label id="inheritance" text="{ASDocModel(applicationModel).inheritance}" width="100%"/> - <js:Label id="attributes" text="{ASDocModel(applicationModel).attributes}" width="100%"/> + <js:MultilineLabel id="attributes" text="{ASDocModel(applicationModel).attributes}" width="100%"/> <js:MultilineLabel id="description" text="{ASDocModel(applicationModel).description}" width="100%"/> <js:Label text="Public Properties" /> <js:List id="publicPropertyList" dataProvider="{ASDocModel(applicationModel).publicProperties}" http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/05b0e230/examples/flexjs/ASDoc/src/main/flex/models/ASDocModel.as ---------------------------------------------------------------------- diff --git a/examples/flexjs/ASDoc/src/main/flex/models/ASDocModel.as b/examples/flexjs/ASDoc/src/main/flex/models/ASDocModel.as index 41c8400..20a9345 100644 --- a/examples/flexjs/ASDoc/src/main/flex/models/ASDocModel.as +++ b/examples/flexjs/ASDoc/src/main/flex/models/ASDocModel.as @@ -148,6 +148,10 @@ package models private var _currentClassData:Object; + private var _baseClassList:Array; + + private var _attributesMap:Object; + private function completeClassHandler(event:Event):void { app.service.removeEventListener("complete", completeClassHandler); @@ -158,7 +162,13 @@ package models _publicProperties = []; _publicMethods = []; _constructorList = []; + _baseClassList = []; + _inheritance = null; + _attributesMap = {}; + _attributes = null; } + else + _baseClassList.push(data.qname); for each (var m:Object in data.members) { m.shortDescription = makeShortDescription(m.description); @@ -168,7 +178,7 @@ package models { _constructorList.push(m); } - else + else if (m.qname != data.qname) _publicMethods.push(m); } else @@ -177,6 +187,14 @@ package models } } + for each (m in data.tags) + { + if (!_attributesMap[m.tagName]) + { + _attributesMap[m.tagName] = m.values; + } + } + if (data.type == "class" && data.baseClassname && data.baseClassname.indexOf("flash.") != 0) { app.service.addEventListener("complete", completeClassHandler); @@ -224,7 +242,13 @@ package models _publicProperties = []; _publicMethods = []; _constructorList = []; + _baseClassList = []; + _inheritance = null; + _attributesMap = {}; + _attributes = null; } + else + _baseClassList.push(data.qname); for each (var m:Object in data.members) { m.shortDescription = makeShortDescription(m.description); @@ -243,6 +267,13 @@ package models } } + for each (m in data.tags) + { + if (!_attributesMap[m.tagName]) + { + _attributesMap[m.tagName] = m.values; + } + } if (data.baseInterfaceNames) extensions = extensions.concat(data.baseInterfaceNames); @@ -289,12 +320,27 @@ package models { return _currentClassData.description; } - + private var _inheritance:String; [Bindable("currentDataChanged")] public function get inheritance():String { + if (!_inheritance) + { + var s:String = "extends "; + if (_baseClassList.length == 0) + s += "Object"; + else + { + s += _baseClassList.shift(); + for each (var p:String in _baseClassList) + { + s += "-> " + p; + } + } + _inheritance = s; + } return _inheritance; } @@ -303,6 +349,25 @@ package models [Bindable("currentDataChanged")] public function get attributes():String { + if (!_attributes) + { + var s:String = ""; + for (var p:String in _attributesMap) + { + var o:Array = _attributesMap[p]; + s += p + ": "; + var firstOne:Boolean = true; + for each (var q:String in o) + { + if (!firstOne) + s += ", "; + firstOne = false; + s += q; + } + s += "\n"; + } + _attributes = s; + } return _attributes; } }
