Ignore:
Timestamp:
08/17/12 11:49:20 (12 years ago)
Author:
twagoo
Message:

Moved (some) common functionality of ComponentEdit? and ElementEdit? in a common base class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/branches/ComponentRegistry-1.12.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/ComponentEdit.as

    r2112 r2113  
    2929       
    3030        [Event(name="removeComponent", type="flash.events.Event")]
    31         public class ComponentEdit extends Form {
     31        public class ComponentEdit extends ItemEdit {
    3232                public static const REMOVE_COMPONENT_EVENT:String = "removeComponent";
    3333                private static const DRAG_ITEMS:String = "items";
     
    3838                private var addComponentLabel:Label
    3939                private var addElementLabel:Label
    40                
    41                 private var showToggleBox:ShowToggleBox;
    42                 private var hideableForm:Form;
    4340               
    4441                public function ComponentEdit(component:CMDComponent, parent:UIComponent, parentComponent:CMDComponent) {
     
    10097                        createComponentEditBar();
    10198                       
    102                         hideableForm = createHidableForm();                     
    103                         showToggleBox.visibleContainer = hideableForm;
    104                        
    105                         addChild(hideableForm);                 
     99                        addChild(getHideableForm());                   
    106100                       
    107101                        var summary:ComponentSummary = new ComponentSummary();
    108102                        summary.component = _component;
    109103                        summary.visible = false;
    110                         showToggleBox.invisibleContainer = summary;
    111                        
     104                       
     105                        setSummaryContainer(summary);           
    112106                        addChild(summary);
    113107                       
     
    115109                        if (componentLink != null) {
    116110                                addCardinalityInput();
    117                                 hideableForm.addChild(componentLink);
     111                                addToHideableForm(componentLink);
    118112                        } else {
    119113                                addNameInput();
     
    162156               
    163157                private function addConceptLink():void {
    164                         hideableForm.addChild(new ConceptLinkInput(LabelConstants.CONCEPTLINK, _component.conceptLink, function(val:String):void {
     158                        addToHideableForm(new ConceptLinkInput(LabelConstants.CONCEPTLINK, _component.conceptLink, function(val:String):void {
    165159                                _component.conceptLink = val;
    166160                        }));
     
    177171                                _component.name = val; 
    178172                        }, new ChildNameValidator(_parentComponent, component));
    179                         hideableForm.addChild(nameInput);
     173                        addToHideableForm(nameInput);
    180174                }
    181175               
    182176                private function addCardinalityInput():void {
    183                         hideableForm.addChild(new CardinalityInput(LabelConstants.CARDINALITY_MIN, _component.cardinalityMin, CardinalityInput.BOUNDED, function(val:String):void {
     177                        addToHideableForm(new CardinalityInput(LabelConstants.CARDINALITY_MIN, _component.cardinalityMin, CardinalityInput.BOUNDED, function(val:String):void {
    184178                                _component.cardinalityMin = val;
    185179                        }));
    186                         hideableForm.addChild(new CardinalityInput(LabelConstants.CARDINALITY_MAX, _component.cardinalityMax, CardinalityInput.UNBOUNDED,function(val:String):void {
     180                        addToHideableForm(new CardinalityInput(LabelConstants.CARDINALITY_MAX, _component.cardinalityMax, CardinalityInput.UNBOUNDED,function(val:String):void {
    187181                                _component.cardinalityMax = val;
    188182                        }));
     
    202196                        var editBar:HBox = new HBox();
    203197                       
    204                         showToggleBox = new ShowToggleBox();
    205                         showToggleBox.visibleState = true;
    206                         editBar.addChild(showToggleBox);
     198                        editBar.addChild(getShowToggleBox());
    207199                       
    208200                        editBar.addChild(createHeading());
     
    265257               
    266258                private function handleCMDAttributeList():void {
    267                         hideableForm.addChild(new AttributeListEdit(_component, this));
     259                        addToHideableForm(new AttributeListEdit(_component, this));
    268260                }
    269261               
Note: See TracChangeset for help on using the changeset viewer.