Changeset 2115
- Timestamp:
- 08/17/12 13:39:15 (12 years ago)
- Location:
- ComponentRegistry/branches/ComponentRegistry-1.12.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
ComponentRegistry/branches/ComponentRegistry-1.12.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/CMDComponentXMLEditor.as
r2096 r2115 6 6 import clarin.cmdi.componentregistry.common.components.AddComponentLabelButton; 7 7 import clarin.cmdi.componentregistry.common.components.AddElementLabelButton; 8 import clarin.cmdi.componentregistry.common.components.LabelButton; 8 9 import clarin.cmdi.componentregistry.common.components.RemoveLabelButton; 9 10 import clarin.cmdi.componentregistry.editor.model.CMDComponent; … … 22 23 import mx.containers.FormItem; 23 24 import mx.containers.FormItemDirection; 25 import mx.containers.HBox; 24 26 import mx.controls.Alert; 25 27 import mx.controls.Label; … … 163 165 checkFirstDefiningComponent(_spec.cmdComponents); 164 166 handleHeader(_spec); 167 168 var collapseExpandBox:HBox = new HBox(); 169 collapseExpandBox.addChild(createCollapseAllButton()); 170 collapseExpandBox.addChild(createExpandAllButton()); 171 addChild(collapseExpandBox); 172 165 173 handleElements(_firstComponent.cmdElements); 166 174 addElementAddButton(); 167 175 handleComponents(_firstComponent.cmdComponents); 168 176 addComponentAddButton(); 177 169 178 trace("Created editor view in " + (getTimer() - start) + " ms."); 179 } 180 181 private function createCollapseAllButton():UIComponent{ 182 var button:LabelButton = new LabelButton(collapseAll, "Collapse all"); 183 button.setStyle("color","blue"); 184 return button; 185 } 186 187 private function collapseAll(event:Event):void{ 188 for(var i:int=0;i<numChildren;i++){ 189 var child:Object = getChildAt(i); 190 if(child is ElementEdit || child is ComponentEdit){ 191 ItemEdit(child).collapseAll(); 192 } 193 } 194 } 195 196 private function createExpandAllButton():UIComponent{ 197 var button:LabelButton = new LabelButton(expandAll, "Expand all"); 198 button.setStyle("color","blue"); 199 return button; 200 } 201 202 private function expandAll(event:Event):void{ 203 for(var i:int=0;i<numChildren;i++){ 204 var child:Object = getChildAt(i); 205 if(child is ElementEdit || child is ComponentEdit){ 206 ItemEdit(child).expandAll(); 207 } 208 } 170 209 } 171 210 -
ComponentRegistry/branches/ComponentRegistry-1.12.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/ItemEdit.as
r2113 r2115 49 49 hideableForm.addChild(child); 50 50 } 51 52 public function setDetailsVisibleState(visibleState:Boolean):void{ 53 showToggleBox.visibleState = visibleState; 54 } 55 56 57 58 protected function setAllVisibleState(visibleState:Boolean):void{ 59 setDetailsVisibleState(visibleState); 60 for(var i:int=0;i<numChildren;i++){ 61 var child:Object = getChildAt(i); 62 if(child is ElementEdit || child is ComponentEdit){ 63 ItemEdit(child).setAllVisibleState(visibleState); 64 } 65 } 66 } 67 68 public function collapseAll():void{ 69 setAllVisibleState(false); 70 } 71 72 public function expandAll():void{ 73 setAllVisibleState(true); 74 } 51 75 } 52 76 } -
ComponentRegistry/branches/ComponentRegistry-1.12.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/ShowToggleBox.mxml
r2111 r2115 49 49 visibleContainer.includeInLayout = visibleState; 50 50 if(visibleState){ 51 invisibleContainer.drawFocus(false); 51 if(invisibleContainer != null){ 52 invisibleContainer.drawFocus(false); 53 } 52 54 visibleContainer.drawFocus(true); 53 55 } … … 58 60 invisibleContainer.includeInLayout = !visibleState; 59 61 if(!visibleState){ 60 visibleContainer.drawFocus(false); 62 if(visibleContainer != null){ 63 visibleContainer.drawFocus(false); 64 } 61 65 invisibleContainer.drawFocus(true); 62 66 }
Note: See TracChangeset
for help on using the changeset viewer.