| /trunk/GlareMethodFinder/src/GlareMethodFinder.mxml r17 | /trunk/GlareMethodFinder/src/GlareMethodFinder.mxml r18 | ||
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
|---|---|---|---|
| 2 | <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="344" height="508"> | 2 | <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="344" height="508"> |
| 3 | <mx:TextInput id="pattern" x="10" y="40" width="226" change="doSearch()"/> | 3 | <mx:TextInput id="pattern" x="63" y="40" width="246" change="doSearch()"/> |
| 4 | <mx:Button id="search" x="244" y="40" label="Search" click="doSearch()"/> | ||
| 5 | <mx:List id="methods" x="10" y="70" width="299" height="403"></mx:List> | 4 | <mx:List id="methods" x="10" y="70" width="299" height="403"></mx:List> |
| 6 | <mx:Label x="48" y="10" text="Glare Method Finder" fontSize="18"/> | 5 | <mx:Label x="10" y="10" text="Glare Method Finder" fontSize="18"/> |
| 7 | 6 | ||
| 8 | <mx:Script> | 7 | <mx:Script> |
| 9 | <![CDATA[ | 8 | <![CDATA[ |
| 10 | import mx.rpc.events.ResultEvent; | 9 | import mx.rpc.events.ResultEvent; |
| 11 | import mx.rpc.remoting.mxml.RemoteObject; | 10 | import mx.rpc.remoting.mxml.RemoteObject; |
| 12 | 11 | ||
| 13 | private function doSearch():void { | 12 | private function doSearch():void { |
| 14 | if (pattern.text.length == 0) return | 13 | if (pattern.text.length == 0) return |
| 15 | var service:RemoteObject = new RemoteObject("MethodFinderService") | 14 | var service:RemoteObject = new RemoteObject("MethodFinderService") |
| 16 | service.addEventListener(ResultEvent.RESULT, handleSearchResult) | 15 | service.addEventListener(ResultEvent.RESULT, handleSearchResult) |
| 17 | service.getSelectorsMatching(pattern.text+'*') | 16 | service.getSelectorsMatching(pattern.text+'*') |
| 18 | } | 17 | } |
| 19 | private function handleSearchResult(event:ResultEvent):void { | 18 | private function handleSearchResult(event:ResultEvent):void { |
| 20 | methods.dataProvider = event.result as Array | 19 | methods.dataProvider = event.result as Array |
| 21 | } | 20 | } |
| 22 | ]]> | 21 | ]]> |
| 23 | </mx:Script> | 22 | </mx:Script> |
| 23 | <mx:Label x="10" y="42" text="Pattern"/> | ||
| 24 | </mx:WindowedApplication> | 24 | </mx:WindowedApplication> |