Changeset 249


Ignore:
Timestamp:
03/18/10 09:16:38 (14 years ago)
Author:
patdui
Message:
  • created rightclick context menu "Edit..." works on profiles and components
Location:
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/browser/ComponentInfoPage.mxml

    r117 r249  
    1111        <browser:infoPage id="infoPanel"
    1212                                   cmdComponent="{component.componentMD.xml}"
     13                                   itemDescription="{component.description}"
    1314                                   headerLabel="{component.description.name}"
    1415                                   width="100%"
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/browser/ProfileInfoPage.mxml

    r119 r249  
    1010        <browser:infoPage id="infoPanel"
    1111                                   cmdComponent="{profile.profileSource}"
     12                                   itemDescription="{profile.description}"
    1213                                   headerLabel="{profile.description.name}"
    1314                                   width="100%"
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/browser/infoPage.mxml

    r206 r249  
    22<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
    33                 xmlns:comp="clarin.cmdi.componentregistry.common.components.*"
     4                 xmlns:common="clarin.cmdi.componentregistry.common.*"
    45                 xmlns:browser="clarin.cmdi.componentregistry.browser.*">
    56
    67        <mx:XML id="cmdComponent"/>
     8        <common:ItemDescription id="itemDescription"/>
    79        <mx:String id="headerLabel"/>
    810
     
    1012                         verticalAlign="middle"
    1113                         width="100%">
    12                 <mx:Label id="header"               
     14                <mx:Label id="header"
    1315                                  text="{headerLabel}"
    1416                                  fontWeight="bold"
    1517                                  fontSize="14"/>
    16         <mx:ToggleButtonBar id="toggleBar" dataProvider="{infoViewStack}"/>
     18                <mx:ToggleButtonBar id="toggleBar"
     19                                                        dataProvider="{infoViewStack}"/>
    1720        </mx:HBox>
    1821
     
    2225                                  styleName="borderStyles">
    2326
    24                 <browser:xmlBrowsePanel id="viewPanel" label="view"
    25                                                 cmdComponent="{cmdComponent}"/>
    26                 <browser:xmlPanel id="xmlPanel" label="xml"
    27                                            cmdComponent="{cmdComponent}"/>
     27                <browser:xmlBrowsePanel id="viewPanel"
     28                                                                label="view"
     29                                                                cmdComponent="{cmdComponent}"
     30                                                                itemDescription="{itemDescription}"/>
     31                <browser:xmlPanel id="xmlPanel"
     32                                                  label="xml"
     33                                                  cmdComponent="{cmdComponent}"/>
    2834
    2935        </mx:ViewStack>
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/browser/xmlBrowsePanel.mxml

    r238 r249  
    11<?xml version="1.0" encoding="utf-8"?>
    22<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
    3                  xmlns:browser="clarin.cmdi.componentregistry.browser.*" >
     3                   xmlns:common="clarin.cmdi.componentregistry.common.*"
     4                   xmlns:browser="clarin.cmdi.componentregistry.browser.*">
    45        <mx:Script>
    5             <![CDATA[
    6                 import clarin.cmdi.componentregistry.editor.model.CMDModelFactory;
    7             ]]>
     6                <![CDATA[
     7                        import clarin.cmdi.componentregistry.editor.model.CMDModelFactory;
     8                ]]>
    89        </mx:Script>
    910
    1011        <mx:XML id="cmdComponent"/>
     12        <common:ItemDescription id="itemDescription"/>
     13
    1114        <browser:CMDComponentXMLBrowser id="xmlBrowse"
    12                                                                  cmdSpec="{CMDModelFactory.createModel(cmdComponent)}"
    13                                                                  width="100%"
    14                                                                  height="100%"
    15                                                                  />
     15                                                                        cmdSpec="{CMDModelFactory.createModel(cmdComponent, itemDescription)}"
     16                                                                        width="100%"
     17                                                                        height="100%"/>
    1618</mx:Canvas>
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/common/components/BrowseContextMenu.as

    r206 r249  
    4545                        cmi.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, saveAsXsd);
    4646                        result.push(cmi);
    47                         cmi = new ContextMenuItem("Create New Profile...");
    48                         cmi.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, createNewProfile);
     47                        cmi = new ContextMenuItem("Edit Item...");
     48                        cmi.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, editItem);
    4949                        result.push(cmi);
    5050                        cmi = new ContextMenuItem("Delete...");
     
    7979                }
    8080
    81                 private function createNewProfile(event:ContextMenuEvent):void {
     81                private function editItem(event:ContextMenuEvent):void {
    8282                        var item:ItemDescription = _dataGrid.selectedItem as ItemDescription;
    8383                        viewStack.switchToEditor(item);
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/common/components/ExpandingComponentLabel.as

    r238 r249  
    7878                                expanded = new CMDComponentXMLBrowser();
    7979                        }
    80                         (expanded as CMDSpecRenderer).cmdSpec = CMDModelFactory.createModel(comp.componentMD.xml);
     80                        (expanded as CMDSpecRenderer).cmdSpec = CMDModelFactory.createModel(comp.componentMD.xml, comp.description);
    8181                        addChild(expanded);
    8282                        isExpanded = true;
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/EditorAS.as

    r242 r249  
    4444public function init():void {
    4545        profileSrv.addEventListener(ProfileInfoService.PROFILE_LOADED, profileLoaded);
     46        componentSrv.addEventListener(ComponentInfoService.COMPONENT_LOADED, componentLoaded);
    4647        componentsSrv.load();
    4748        uploadService.init(uploadProgress);
     
    5051private function profileLoaded(event:Event):void {
    5152        var cmdComponent:XML = profileSrv.profile.profileSource;
    52         this.cmdSpec = CMDModelFactory.createModel(cmdComponent);
     53        this.cmdSpec = CMDModelFactory.createModel(cmdComponent, profileSrv.profile.description);
    5354}
     55
     56private function componentLoaded(event:Event):void {
     57        var cmdComponent:XML = componentSrv.component.componentMD.xml;
     58        this.cmdSpec = CMDModelFactory.createModel(cmdComponent, componentSrv.component.description);
     59}
     60
    5461
    5562public function setDescription(itemDescription:ItemDescription):void {
     
    5764        if (currentDescription.isProfile) {
    5865                profileSrv.load(currentDescription);
     66        } else {
     67                componentSrv.load(currentDescription);
    5968        }
    6069}
     
    7584        uploadService.addEventListener(UploadCompleteEvent.UPLOAD_COMPLETE, handleSaveComplete);
    7685        if (item.isProfile) {
    77             uploadService.submitProfile(item, xmlEditor.cmdSpec.toXml());
     86                uploadService.submitProfile(item, xmlEditor.cmdSpec.toXml());
    7887        } else {
    79             uploadService.submitComponent(item, xmlEditor.cmdSpec.toXml());
     88                uploadService.submitComponent(item, xmlEditor.cmdSpec.toXml());
    8089        }
    8190}
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/model/CMDModelFactory.as

    r224 r249  
    11package clarin.cmdi.componentregistry.editor.model {
    22        import clarin.cmdi.componentregistry.common.ComponentMD;
     3        import clarin.cmdi.componentregistry.common.ItemDescription;
    34
    45        import mx.collections.ArrayCollection;
     
    910                }
    1011
    11                 public static function createModel(xml:XML):CMDSpec {
    12                         var result:CMDSpec = new CMDSpec(xml.@isProfile);
     12                public static function createModel(xml:XML, description:ItemDescription):CMDSpec {
     13                        var result:CMDSpec = new CMDSpec(xml.@isProfile == "true");
    1314                        result.headerName = xml.Header.Name;
    1415                        result.headerId = xml.Header.ID;
    1516                        result.headerDescription = xml.Header.Description;
     17                        result.groupName = description.groupName;
    1618                        var components:XMLList = xml.elements(ComponentMD.CMD_COMPONENT);
    1719                        for each (var component:XML in components) {
Note: See TracChangeset for help on using the changeset viewer.