Changeset 2109
- Timestamp:
- 08/17/12 08:37:44 (12 years ago)
- Location:
- ComponentRegistry/branches/ComponentRegistry-1.12.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ComponentRegistry/branches/ComponentRegistry-1.12.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/ComponentEdit.as
r2071 r2109 39 39 private var addElementLabel:Label 40 40 41 private var showToggleBox:ShowToggleBox; 42 private var hideableForm:Form; 41 43 42 44 public function ComponentEdit(component:CMDComponent, parent:UIComponent, parentComponent:CMDComponent) { … … 98 100 createComponentEditBar(); 99 101 102 hideableForm = createHidableForm(); 103 showToggleBox.visibleContainer = hideableForm; 104 105 addChild(hideableForm); 106 107 var summary:ComponentSummary = new ComponentSummary(); 108 summary.component = _component; 109 summary.visible = false; 110 showToggleBox.invisibleContainer = summary; 111 112 addChild(summary); 113 100 114 var componentLink:FormItem = createComponentLink(_component); 101 115 if (componentLink != null) { 102 116 addCardinalityInput(); 103 addChild(componentLink);117 hideableForm.addChild(componentLink); 104 118 } else { 105 119 addNameInput(); … … 127 141 drawFocus(false); 128 142 }); 129 addChild(addComponentLabel);143 hideableForm.addChild(addComponentLabel); 130 144 } 131 145 … … 144 158 drawFocus(false); 145 159 }); 146 addChild(addElementLabel);160 hideableForm.addChild(addElementLabel); 147 161 } 148 162 149 163 private function addConceptLink():void { 150 addChild(new ConceptLinkInput(LabelConstants.CONCEPTLINK, _component.conceptLink, function(val:String):void {164 hideableForm.addChild(new ConceptLinkInput(LabelConstants.CONCEPTLINK, _component.conceptLink, function(val:String):void { 151 165 _component.conceptLink = val; 152 166 })); … … 163 177 _component.name = val; 164 178 }, new ChildNameValidator(_parentComponent, component)); 165 addChild(nameInput);179 hideableForm.addChild(nameInput); 166 180 } 167 181 168 182 private function addCardinalityInput():void { 169 addChild(new CardinalityInput(LabelConstants.CARDINALITY_MIN, _component.cardinalityMin, CardinalityInput.BOUNDED, function(val:String):void {183 hideableForm.addChild(new CardinalityInput(LabelConstants.CARDINALITY_MIN, _component.cardinalityMin, CardinalityInput.BOUNDED, function(val:String):void { 170 184 _component.cardinalityMin = val; 171 185 })); 172 addChild(new CardinalityInput(LabelConstants.CARDINALITY_MAX, _component.cardinalityMax, CardinalityInput.UNBOUNDED,function(val:String):void {186 hideableForm.addChild(new CardinalityInput(LabelConstants.CARDINALITY_MAX, _component.cardinalityMax, CardinalityInput.UNBOUNDED,function(val:String):void { 173 187 _component.cardinalityMax = val; 174 188 })); 175 189 } 176 190 191 private function createHidableForm():Form { 192 var form:Form = new Form(); 193 form.styleName = StyleConstants.XMLBROWSER; 194 form.setStyle("paddingTop","0"); 195 form.setStyle("paddingBottom","0"); 196 form.verticalScrollPolicy = "off"; 197 form.horizontalScrollPolicy = "off"; 198 return form; 199 } 200 177 201 private function createComponentEditBar():void { 178 202 var editBar:HBox = new HBox(); 203 204 showToggleBox = new ShowToggleBox(); 205 showToggleBox.visibleState = true; 206 editBar.addChild(showToggleBox); 207 179 208 editBar.addChild(createHeading()); 180 209 var removeButton:Label = new RemoveLabelButton(); … … 236 265 237 266 private function handleCMDAttributeList():void { 238 addChild(new AttributeListEdit(_component, this));267 hideableForm.addChild(new AttributeListEdit(_component, this)); 239 268 } 240 269 … … 250 279 comp.setStyle("paddingLeft", "50"); 251 280 if (!addComponentLabel) { 252 addChild(comp);281 hideableForm.addChild(comp); 253 282 } else { 254 addChildAt(comp,getChildIndex(addComponentLabel));283 hideableForm.addChildAt(comp, hideableForm.getChildIndex(addComponentLabel)); 255 284 } 256 285 } … … 259 288 var comp:CMDComponent = ComponentEdit(event.currentTarget).component; 260 289 _component.removeComponent(comp); 261 removeChild(event.currentTarget as DisplayObject);290 hideableForm.removeChild(event.currentTarget as DisplayObject); 262 291 } 263 292 … … 273 302 elem.addEventListener(ElementEdit.REMOVE_ELEMENT_EVENT, removeElement); 274 303 if (!addElementLabel) { 275 addChild(elem);304 hideableForm.addChild(elem); 276 305 } else { 277 addChildAt(elem,getChildIndex(addElementLabel));306 hideableForm.addChildAt(elem, hideableForm.getChildIndex(addElementLabel)); 278 307 } 279 308 } … … 282 311 var elem:CMDComponentElement = ElementEdit(event.currentTarget).element; 283 312 _component.removeElement(elem); 284 removeChild(event.currentTarget as DisplayObject);313 hideableForm.removeChild(event.currentTarget as DisplayObject); 285 314 } 286 315 -
ComponentRegistry/branches/ComponentRegistry-1.12.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/model/CMDComponent.as
r1988 r2109 7 7 import mx.events.CollectionEventKind; 8 8 9 [Bindable] 9 10 public class CMDComponent implements XmlAble, AttributeContainer, ChangeTrackingCMDElement { 10 11
Note: See TracChangeset
for help on using the changeset viewer.