| <?xml version="1.0" encoding="utf-8"?> |
| <!-- |
| |
| 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. |
| |
| --> |
| <rs:DocPage xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:js="library://ns.apache.org/royale/basic" |
| xmlns:rs="library://ns.apache.org/royale/site" |
| xmlns:local="*" |
| width="100%" height="100%" |
| initComplete="applicationModel.addEventListener('packageListChanged', packagesReadyHandler)" |
| > |
| <fx:Script> |
| <![CDATA[ |
| import models.ASDocModel; |
| import org.apache.royale.core.ClassFactory; |
| import org.apache.royale.events.Event; |
| import org.apache.royale.events.DetailEvent; |
| import org.apache.royale.html.PopUpList; |
| import org.apache.royale.utils.PointUtils; |
| |
| private var packagesReady:Boolean = false; |
| |
| private function packagesReadyHandler(event:Event):void |
| { |
| packagesReady = true; |
| // wait until package data is ready before updating initial view to any anchor hash |
| hashChanged(); |
| } |
| |
| /** |
| * @royalesuppresspublicvarwarning |
| */ |
| public var currentPackage:String; |
| |
| private function packageChangedHandler():void |
| { |
| currentPackage = packageList.selectedItem as String; |
| dispatchEvent(new Event("packageChanged")); |
| } |
| |
| private function packageListChangedHandler():void |
| { |
| currentPackage = packagePaneList.selectedItem as String; |
| dispatchEvent(new Event("packageChanged")); |
| } |
| |
| /** |
| * @royalesuppresspublicvarwarning |
| */ |
| public var currentClass:String; |
| |
| private function classChangedHandler():void |
| { |
| currentState = "loading"; |
| currentClass = classList.selectedItem as String; |
| dispatchEvent(new Event("classChanged")); |
| } |
| |
| private function showTopLevel():void |
| { |
| dispatchEvent(new DetailEvent(topLevel.selected ? "addTag" : "removeTag", false, false, "toplevel")); |
| } |
| |
| private function showViewBeads():void |
| { |
| dispatchEvent(new DetailEvent(viewBeads.selected ? "addTag" : "removeTag", false, false, "viewbead")); |
| } |
| |
| private var findMember:String ; |
| |
| private function paramsReady():void |
| { |
| if (packagesReady) |
| updateView(efb.urlParameters); |
| else |
| clb.callLater(paramsReady); |
| } |
| |
| private function hashChanged():void |
| { |
| if (popUpList) |
| { |
| removeElement(popUpList); |
| popUpList = null; |
| searchTI.text = ""; |
| } |
| var hash:String = router.hash; |
| if (hash.substr(0,2) == "#!") |
| hash = hash.substring(2); |
| if (hash.charAt(0) == "#") |
| hash = hash.substring(1); |
| updateView(hash); |
| } |
| |
| private function updateView(hash:String):void |
| { |
| if (!hash) |
| currentState = "packages"; |
| else |
| { |
| var delimiter:String = ASDocModel.DELIMITER; |
| var c:int = hash.indexOf(delimiter); |
| if (c == -1) |
| { |
| c == hash.indexOf("$"); |
| if (c != -1) |
| delimiter = "$"; |
| } |
| if (c != -1) |
| { |
| var pkg:String = hash.substr(0, c); |
| packageList.selectedItem = pkg; |
| packageChangedHandler(); |
| var cls:String = hash.substr(c + 1); |
| c = cls.indexOf(delimiter) |
| if (c != -1) |
| { |
| findMember = cls.substr(c + 1); |
| cls = cls.substr(0, c); |
| COMPILE::JS |
| { |
| if (document.getElementById(findMember) && |
| classList.selectedItem == cls) |
| { |
| // we are already on the right page so just scroll to member |
| scrollMemberIntoView(); |
| return; |
| } |
| } |
| } |
| applicationModel.addEventListener("currentDataChanged", findMemberDetail); |
| classList.selectedItem = cls; |
| var title:String = cls; |
| if (pkg.length > 1) |
| title += " (" + pkg + ")"; |
| router.title = title; |
| classChangedHandler(); |
| } |
| else |
| { |
| packageList.selectedItem = hash; |
| router.title = hash; |
| packageChangedHandler(); |
| } |
| } |
| } |
| |
| private function findMemberDetail(event:Event):void |
| { |
| currentState = "classDetail"; |
| applicationModel.removeEventListener("currentDataChanged", findMemberDetail); |
| if (findMember) |
| clb.callLater(scrollMemberIntoView); |
| } |
| |
| private function scrollMemberIntoView():void |
| { |
| COMPILE::JS |
| { |
| document.getElementById(findMember).scrollIntoView(); |
| } |
| findMember = null; |
| } |
| |
| private var popUpList:PopUpList; |
| private var max_results:int = 200; |
| private var too_many:Array = [ "Too many search results" ]; |
| |
| private function search():void |
| { |
| if (!popUpList) |
| { |
| popUpList = new PopUpList(); |
| popUpList.itemRenderer = new ClassFactory(ClassPickerHashAnchorStringItemRenderer); |
| popUpList.dataProvider = too_many; |
| addElement(popUpList); |
| var pt:Point = new Point(searchTI.x, searchTI.y); |
| pt.y += searchTI.height; |
| pt = PointUtils.localToGlobal(pt, titleGroup); |
| popUpList.x = pt.x; |
| popUpList.y = pt.y; |
| popUpList.width = searchTI.width; |
| popUpList.height = 200; |
| } |
| filterRegEx = new RegExp(searchTI.text,"i"); |
| var arr:Array = (applicationModel as ASDocModel).allClasses.filter(filterClasses, this); |
| if (arr.length < max_results) |
| popUpList.dataProvider = arr; |
| else |
| popUpList.dataProvider = too_many; |
| } |
| private var filterRegEx:RegExp; |
| private function filterClasses(item:String):Boolean |
| { |
| return filterRegEx.test(item); |
| } |
| |
| ]]> |
| </fx:Script> |
| <fx:Style> |
| @namespace "*"; |
| @namespace rs "library://ns.apache.org/royale/site"; |
| |
| .sectionLabel{ |
| padding-top: 3px; |
| padding-bottom: 3px; |
| font-size: 16px; |
| font-weight: bold; |
| background-color: rgb( 253, 171, 125); |
| text-align: center; |
| } |
| |
| .titleGroup { |
| margin-top: 30px; |
| margin-left: 5px; |
| } |
| |
| .detailsPane { |
| padding-left: 20px; |
| padding-right: 10px; |
| } |
| |
| .paneTitle { |
| padding-left: 20px; |
| font-size: 24px; |
| font-weight: bold; |
| background-color: rgb( 253, 171, 125); |
| } |
| |
| .paneList { |
| margin-top: 50px; |
| margin-left: 20px; |
| margin-right: 20px; |
| border-style: solid; |
| } |
| |
| .HashAnchorAnchor { |
| text-decoration: none; |
| } |
| |
| HashAnchorStringItemRenderer { |
| padding-left: 5px; |
| } |
| |
| OptionalHashAnchorStringItemRenderer { |
| padding-right: 3px; |
| } |
| |
| .summary { |
| padding-top:3px; |
| padding-bottom:3px; |
| } |
| |
| .detailCaption { |
| font-weight: bold; |
| width: 80px; |
| line-height: 20px; |
| } |
| |
| .title { |
| font-size: 20px; |
| } |
| |
| .attributeList { |
| border-style: none; |
| margin-top: 10px; |
| margin-bottom: 10px; |
| } |
| |
| .description { |
| margin-top: 10px; |
| margin-bottom: 10px; |
| font-family: sans-serif; |
| font-size: 12px; |
| } |
| |
| .attributeCaption { |
| font-weight: bold; |
| margin-right: 3px; |
| } |
| |
| .summaryQName { |
| font-weight: bold; |
| margin-left: 10px; |
| margin-top: 3px; |
| text-decoration: none; |
| } |
| .summaryType { |
| } |
| .summaryTypeLink { |
| text-decoration: none; |
| } |
| .summaryDescription { |
| margin-left: 10px; |
| margin-bottom: 3px; |
| } |
| |
| .summaryList { |
| margin-bottom: 20px; |
| border-style: solid; |
| } |
| |
| .detailList { |
| margin-bottom: 20px; |
| } |
| |
| .property { |
| padding-left: 20px; |
| padding-right: 10px; |
| padding-bottom: 20px; |
| border-width: 1px; |
| border-bottom-style: solid; |
| } |
| .propertyQName { |
| font-family: monospace; |
| } |
| .propertyType { |
| font-family: monospace; |
| } |
| .propertyQNameTitle { |
| font-weight: bold; |
| font-size: 18px; |
| margin-top: 3px; |
| margin-right: 3px; |
| } |
| .propertyTypeLink { |
| text-decoration: none; |
| font-family: monospace; |
| } |
| |
| .paramName { |
| font-family: monospace; |
| } |
| .paramType { |
| font-family: monospace; |
| } |
| .paramLink { |
| text-decoration: none; |
| font-family: monospace; |
| } |
| |
| .eventQName { |
| font-weight: bold; |
| } |
| .eventLink { |
| text-decoration: none; |
| } |
| |
| .eventSummaryQName { |
| text-decoration: none; |
| font-weight: bold; |
| width: 120px; |
| margin-left: 10px; |
| margin-right: 10px; |
| margin-top: 3px; |
| } |
| |
| .findClassLabel { |
| padding-right: 3px; |
| } |
| |
| .searchTI { |
| width: 300px; |
| } |
| |
| .swfonly { |
| color: #f00; |
| } |
| |
| .jsonly { |
| color: #0f0; |
| } |
| |
| .loading { |
| font-size: 40px; |
| } |
| </fx:Style> |
| <fx:Declarations> |
| <fx:Component className="AltBGRenderer"> |
| <local:AlternatingBackgroundColorHashAnchorStringItemRenderer backgroundColor0="#ffffff" backgroundColor1="#ffeeee" /> |
| </fx:Component> |
| </fx:Declarations> |
| <js:states> |
| <js:State name="packages" /> |
| <js:State name="loading" /> |
| <js:State name="classDetail" /> |
| </js:states> |
| <js:beads> |
| <js:ViewDataBinding /> |
| <js:OneFlexibleChildVerticalLayoutForOverflow flexibleChild="topContainer" /> |
| <js:HashChangeNotifierBeadWithTitle id="router" hashChange="hashChanged()" /> |
| <js:EscapedFragmentBead id="efb" ready="paramsReady()" /> |
| <js:CallLaterBead id="clb" /> |
| </js:beads> |
| <rs:DocTopBar /> |
| <rs:DocTagline /> |
| <js:Group width="100%" id="titleGroup" className="titleGroup"> |
| <js:beads> |
| <js:OneFlexibleChildHorizontalLayoutForOverflow flexibleChild="spacer" /> |
| </js:beads> |
| <js:Label text="Apache Royale ActionScript Library Reference" id="title" height="30" className="title"/> |
| <js:Spacer width="20" /> |
| <js:Label text="Find a class" className="findClassLabel"/> |
| <js:TextInput id="searchTI" className="searchTI" change="search()" /> |
| <js:Spacer id="spacer" /> |
| <js:CheckBox id="topLevel" text="Top-Level" click="showTopLevel()" /> |
| <js:CheckBox id="viewBeads" text="View Bead" click="showViewBeads()" /> |
| </js:Group> |
| <js:Group width="100%" className="topContainer" id="topContainer"> |
| <js:beads> |
| <js:OneFlexibleChildHorizontalLayoutForOverflow flexibleChild="rightSide" /> |
| <js:LayoutChangeNotifier watchedProperty="{ASDocModel(applicationModel).packageList}" initialValue="null" /> |
| </js:beads> |
| <js:Group width="300" height="100%" className="leftSide" id="leftSide"> |
| <js:beads> |
| <js:VerticalLayout /> |
| </js:beads> |
| <js:List id="packageList" dataProvider="{ASDocModel(applicationModel).packageList}" |
| width="100%" height="50%" |
| itemRenderer="HashAnchorStringItemRenderer"/> |
| <js:List id="classList" dataProvider="{ASDocModel(applicationModel).classList}" |
| width="100%" height="50%" |
| itemRenderer="HashAnchorStringItemRenderer" labelField="label" /> |
| </js:Group> |
| <js:Container className="rightSide" id="rightSide" height="100%"> |
| <js:beads> |
| <js:VerticalLayout /> |
| <js:ScrollingViewport /> |
| </js:beads> |
| <js:Label className="paneTitle" id="baseName" width="100%" style="fontSize:20" |
| text="{currentState == 'packages' ? 'All Packages' : ASDocModel(applicationModel).currentClass}" /> |
| <js:Group id="packageListPane" width="100%" includeIn="packages"> |
| <js:beads> |
| <js:VerticalLayout /> |
| </js:beads> |
| <js:List className="paneList" id="packagePaneList" dataProvider="{ASDocModel(applicationModel).packageList}" |
| itemRenderer="AltBGRenderer"/> |
| </js:Group> |
| <js:Group id="loadingPane" width="100%" includeIn="loading"> |
| <js:Label className="loading" text="Loading..." /> |
| </js:Group> |
| <js:Group id="detailsPane" className="detailsPane" width="100%" includeIn="classDetail"> |
| <js:beads> |
| <js:VerticalLayout /> |
| </js:beads> |
| <js:Group> |
| <js:beads> |
| <js:HorizontalLayout /> |
| </js:beads> |
| <js:Label className="detailCaption" text="Package" /> |
| <js:Label className="detailInfo" id="packageName" text="{ASDocModel(applicationModel).currentPackage}" /> |
| </js:Group> |
| <js:Group> |
| <js:beads> |
| <js:HorizontalLayout /> |
| </js:beads> |
| <js:Label className="detailCaption" text="Class" /> |
| <js:Label className="detailInfo" text="{ASDocModel(applicationModel).currentClass}" /> |
| </js:Group> |
| <js:Group> |
| <js:beads> |
| <js:HorizontalLayout /> |
| </js:beads> |
| <js:Label className="detailCaption" text="Inheritance" /> |
| <js:List className="detailInfo" id="inheritance" dataProvider="{ASDocModel(applicationModel).inheritance}" |
| itemRenderer="OptionalHashAnchorStringItemRenderer" labelField="label"> |
| <js:beads> |
| <js:HorizontalLayout /> |
| </js:beads> |
| </js:List> |
| </js:Group> |
| <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 className="summaryList" id="publicPropertyList" dataProvider="{ASDocModel(applicationModel).publicProperties}" |
| itemRenderer="SummaryRenderer" width="100%"/> |
| <js:Label text="Public Methods" className="sectionLabel"/> |
| <js:List className="summaryList" id="publicMethodList" dataProvider="{ASDocModel(applicationModel).publicMethods}" |
| itemRenderer="MethodSummaryRenderer" width="100%"/> |
| <js:Label text="Events" className="sectionLabel"/> |
| <js:List className="summaryList" id="publicEventList" dataProvider="{ASDocModel(applicationModel).publicEvents}" |
| itemRenderer="EventSummaryRenderer" width="100%"/> |
| <js:Label text="Property Details" className="sectionLabel"/> |
| <js:DataContainer className="detailList" id="propertyDetails" dataProvider="{ASDocModel(applicationModel).publicProperties}" |
| itemRenderer="PropertyDetailRenderer" width="100%"/> |
| <js:Label text="Constructor Details" className="sectionLabel"/> |
| <js:DataContainer className="detailList" id="constructorDetails" dataProvider="{ASDocModel(applicationModel).constructorList}" |
| itemRenderer="MethodDetailRenderer" width="100%"/> |
| <js:Label text="Method Details" className="sectionLabel"/> |
| <js:DataContainer className="detailList" id="MethodDetails" dataProvider="{ASDocModel(applicationModel).publicMethods}" |
| itemRenderer="MethodDetailRenderer" width="100%"/> |
| <js:Label text="Event Details" className="sectionLabel"/> |
| <js:DataContainer className="detailList" id="EventDetails" dataProvider="{ASDocModel(applicationModel).publicEvents}" |
| itemRenderer="EventDetailRenderer" width="100%"/> |
| </js:Group> |
| </js:Container> |
| </js:Group> |
| </rs:DocPage> |