Changeset 1754
- Timestamp:
- 02/20/12 15:22:50 (12 years ago)
- Location:
- ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/ComponentEdit.as
r1577 r1754 29 29 30 30 [Event(name="removeComponent", type="flash.events.Event")] 31 public class ComponentEdit extends Form {31 public class ComponentEdit extends Form implements CMDValidator { 32 32 public static const REMOVE_COMPONENT_EVENT:String = "removeComponent"; 33 33 private static const DRAG_ITEMS:String = "items"; … … 292 292 } 293 293 294 294 public function validate():Boolean{ 295 // Parent must not have another component or element of the same name 296 for each (var component:CMDComponent in _parentComponent.cmdComponents) { 297 if(component != _component && component.name == _component.name){ 298 return false; 299 } 300 } 301 for each (var element:CMDComponentElement in _parentComponent.cmdElements) { 302 if(element.name == _component.name){ 303 return false; 304 } 305 } 306 return true; 307 } 295 308 } 296 309 } -
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/ElementEdit.as
r912 r1754 21 21 22 22 [Event(name="removeElement", type="flash.events.Event")] 23 public class ElementEdit extends Form {23 public class ElementEdit extends Form implements CMDValidator { 24 24 public static const REMOVE_ELEMENT_EVENT:String = "removeElement"; 25 25 private var _element:CMDComponentElement; … … 153 153 addChild(nameInput); 154 154 } 155 155 156 157 public function validate():Boolean{ 158 // Parent must not have another component or element of the same name 159 for each (var component:CMDComponent in _parentComponent.cmdComponents) { 160 if(component.name == _element.name){ 161 return false; 162 } 163 } 164 for each (var element:CMDComponentElement in _parentComponent.cmdElements) { 165 if(element != _element && element.name == _element.name){ 166 return false; 167 } 168 } 169 return true; 170 } 156 171 } 157 172 }
Note: See TracChangeset
for help on using the changeset viewer.