source: ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/EnumerationEdit.as @ 206

Last change on this file since 206 was 206, checked in by patdui, 14 years ago
  • added as3httpclient for doing http DELETE commands etc...
  • implemented editor
  • Using Basic Header security to authorize POST and DELETEs
  • renamed Register to Importer
File size: 1.1 KB
Line 
1package clarin.cmdi.componentregistry.editor {
2        import clarin.cmdi.componentregistry.common.ComponentMD;
3        import clarin.cmdi.componentregistry.common.StyleConstants;
4       
5        import mx.collections.XMLListCollection;
6        import mx.containers.FormItem;
7        import mx.controls.ComboBox;
8        import mx.core.UIComponent;
9
10        public class EnumerationEdit extends FormItem {
11                private var _parent:UIComponent;
12                private var _valueList:XMLListCollection;
13
14                public function EnumerationEdit(valueList:XMLListCollection, parent:UIComponent) {
15                        super();
16                        label = "ValueScheme";
17                        styleName = StyleConstants.XMLBROWSER_FIELD;
18                        _parent = parent;
19                        _valueList = valueList;
20                }
21
22                protected override function createChildren():void {
23                        super.createChildren();
24                        var result:ComboBox = new ComboBox();
25                        result.editable = true;
26                        result.dataProvider = _valueList;
27                        result.labelFunction = function(item:Object):String {
28                                var xmlItem:XML = item as XML;
29                                if (item.hasOwnProperty("@" + ComponentMD.APP_INFO)) {
30                                        return xmlItem.attribute(ComponentMD.APP_INFO) + " - " + xmlItem.text();
31                                } else {
32                                        return xmlItem.text();
33                                }
34                        };
35                        addChild(result);
36                }
37        }
38}
Note: See TracBrowser for help on using the repository browser.