Changeset 2095


Ignore:
Timestamp:
08/15/12 13:08:27 (12 years ago)
Author:
twagoo
Message:

Moved the public/workspace switch out of Browse into a separate class and added it to both Browse and BrowserOverviewList?, it being optional (off by default) in the latter. Also made the action buttons bar optional. Now the browser panel in Editor can have different controls than the main browser.

Location:
ComponentRegistry/branches/ComponentRegistry-1.12.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/branches/ComponentRegistry-1.12.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/browser/Browse.mxml

    r2093 r2095  
    77                   height="100%"
    88                   label="Component Browser"
    9                    implements="clarin.cmdi.componentregistry.common.components.RegistryView"
     9                   implements="clarin.cmdi.componentregistry.common.components.RegistryView" xmlns:components="clarin.cmdi.componentregistry.common.components.*"
    1010                   >
    1111        <mx:Metadata>
     
    162162                        }
    163163                       
    164                         private static const USERSPACE_LABEL:String = "Work space";
    165                         private static const PUBLICSPACE_LABEL:String = "Public space";
    166                         [Bindable]
    167                         public var spaces:ArrayCollection = new ArrayCollection([{label: PUBLICSPACE_LABEL, data: 1}, {label: USERSPACE_LABEL, data: 2}]);
    168                        
    169164                        private function setUserSpace(event:Event = null):void {
    170165                                if (Config.instance.userSpace) {
     
    173168                                        userSpaceCB.selectedIndex = 0;
    174169                                }
    175                         }
    176                        
    177                         private function userSpaceCloseHandler(event:Event):void {
    178                                 if (Credentials.instance.isLoggedIn()) {
    179                                         Config.instance.userSpace = ComboBox(event.target).selectedItem.data == 2;
    180                                 } else if (userSpaceCB.selectedIndex != 0) {
    181                                         userSpaceCB.selectedIndex = 0;
    182                                         new Login().show(this, Config.VIEW_BROWSE, Config.SPACE_USER, null);
    183                                 }
    184                                
    185170                        }
    186171                ]]>
     
    205190                       
    206191                        <mx:Box paddingTop="5" paddingLeft="5">
    207                                 <mx:ComboBox id="userSpaceCB"
    208                                                          dataProvider="{spaces}"
    209                                                          width="110"
    210                                                          close="userSpaceCloseHandler(event);"
    211                                                          />
     192                                <components:SpaceSwitch id="userSpaceCB"  />
    212193                        </mx:Box>
    213                                                
     194                       
    214195                        <mx:TabNavigator id="tabnav"
    215196                                                         width="100%"
  • ComponentRegistry/branches/ComponentRegistry-1.12.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/browser/BrowserOverviewList.mxml

    r2094 r2095  
    3434                        [Bindable]
    3535                        public var viewStack:RegistryViewStack;
     36                       
     37                        [Bindable]
     38                        public var buttonsEnabled:Boolean = true;
     39                       
     40                        [Bindable]
     41                        public var spaceSwitchEnabled:Boolean = false;
    3642                       
    3743                        public function set browserDataProvider(dataProvider:ArrayCollection):void {
     
    104110                         paddingRight="5"
    105111                         width="100%">
    106        
     112               
     113                <mx:Box paddingTop="5" paddingLeft="5"
     114                                visible="{spaceSwitchEnabled}"
     115                                includeInLayout="{spaceSwitchEnabled}">
     116                        <comp:SpaceSwitch id="userSpaceCB" />
     117                </mx:Box>
     118               
    107119                <mx:HBox horizontalAlign="left"
    108120                                 verticalAlign="middle"
    109                                  width="70%">
     121                                 width="70%"
     122                                 visible="{buttonsEnabled}"
     123                                 >
    110124                       
    111125                        <mx:Button label="Create new"
  • ComponentRegistry/branches/ComponentRegistry-1.12.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/Editor.mxml

    r2093 r2095  
    4848                                <browser:BrowserOverviewList id="componentsPaletteOverview"
    4949                                                                                         width="100%" height="90%"
     50                                                                                         buttonsEnabled="false"
     51                                                                                         spaceSwitchEnabled="true"
    5052                                                                                         browserDataProvider="{componentsSrv.itemDescriptions}"
    5153                                                                                         browserColumns="{browserColumns.getComponentColumns()}"
Note: See TracChangeset for help on using the changeset viewer.