Changeset 1152
- Timestamp:
- 03/02/11 15:29:47 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/common/components/ExpandingComponentLabel.as
r431 r1152 9 9 import clarin.cmdi.componentregistry.services.ComponentInfoService; 10 10 import clarin.cmdi.componentregistry.services.ComponentListService; 11 11 12 12 import flash.display.DisplayObject; 13 13 import flash.events.MouseEvent; 14 14 15 15 import mx.containers.VBox; 16 16 import mx.controls.Label; 17 import mx.managers.CursorManager; 17 18 18 19 public class ExpandingComponentLabel extends VBox { … … 20 21 [Bindable] 21 22 public var isExpanded:Boolean = false; 23 private var expandBusy:Boolean = false; 22 24 23 25 private var expanded:DisplayObject; … … 35 37 styleName = StyleConstants.EXPANDING_COMPONENT; 36 38 if (item && item.isInUserSpace) { 37 39 this.setStyle("borderColor", StyleConstants.USER_BORDER_COLOR); 38 40 } 39 41 } … … 55 57 56 58 private function handleClick(event:MouseEvent):void { 57 if (isExpanded) { 58 unexpand(); 59 isExpanded = false; 60 } else { 61 expand(); 59 if (!expandBusy) { 60 expandStart(); 61 try { 62 if (isExpanded) { 63 isExpanded = false; 64 unexpand(); 65 } else { 66 isExpanded = true; 67 expand(); 68 } 69 } catch (err:Error) { 70 trace(err); 71 CursorManager.removeBusyCursor(); 72 } 62 73 } 74 } 75 76 private function expandStart():void { 77 expandBusy = true; 78 CursorManager.setBusyCursor(); 79 } 80 81 private function expandFinished():void { 82 expandBusy = false; 83 CursorManager.removeBusyCursor(); 63 84 } 64 85 … … 67 88 if (expanded != null) { 68 89 removeChild(expanded); 90 expanded = null; 69 91 } 92 expandFinished(); 70 93 } 71 94 … … 84 107 (expanded as CMDSpecRenderer).cmdSpec = CMDModelFactory.createModel(comp.componentMD.xml, comp.description); 85 108 addChild(expanded); 86 isExpanded = true;109 expandFinished(); 87 110 } 88 111
Note: See TracChangeset
for help on using the changeset viewer.