<commit_before><?xml version="1.0" encoding="utf-8"?>
<!--
/*
 * openwms.org, the Open Warehouse Management System.
 *
 * This file is part of openwms.org.
 *
 * openwms.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as 
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * openwms.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software. If not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
-->
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" backgroundColor="#C2DAEF" show="onShow()">

    <mx:Metadata>
        [Name("locationView")]
        [ManagedEvent(name="LOAD_ALL_LOCATIONS")]
        [ManagedEvent(name="LOAD_ALL_LOCATION_TYPES")]
        [ManagedEvent(name="LOAD_ALL_LOCATION_GROUPS")]
        [ManagedEvent(name="SAVE_LOCATION")]
    </mx:Metadata>

    <mx:Script>
        <![CDATA[
        	import mx.controls.Alert;
        	import mx.managers.PopUpManager;
            import org.openwms.web.flex.client.util.DisplayUtility;
            import org.openwms.web.flex.client.util.BindingProperty;
            import org.openwms.web.flex.client.common.event.LocationEvent;
            import org.openwms.web.flex.client.common.event.LocationTypeEvent;
            import org.openwms.web.flex.client.common.event.LocationGroupEvent;
        	import org.openwms.common.domain.LocationGroup;
        	import org.openwms.common.domain.LocationType;
        	import org.openwms.common.domain.Location;
            import org.openwms.web.flex.client.common.model.CommonModelLocator;
            import mx.controls.dataGridClasses.DataGridColumn;
            import mx.collections.ArrayCollection;
            import mx.events.ListEvent;

            [In]
            [Bindable]
            /**
             * Inject.
             */
            public var commonModelLocator:CommonModelLocator;

            [Bindable]
            private var selected:Location;

            [Bindable]
            private var listLocationGroups:ArrayCollection=new ArrayCollection();

            private function onShow():void {
                if (commonModelLocator.allLocations.length == 0) {
                    dispatchEvent(new LocationEvent(LocationEvent.LOAD_ALL_LOCATIONS));
                }
                if (commonModelLocator.allLocationTypes.length == 0) {
                	dispatchEvent(new LocationTypeEvent(LocationTypeEvent.LOAD_ALL_LOCATION_TYPES));
                }
                if (commonModelLocator.allLocationGroups.length == 0) {
                	dispatchEvent(new LocationGroupEvent(LocationGroupEvent.LOAD_ALL_LOCATION_GROUPS));
                }
            }

            private function onRowClick(event:ListEvent):void {
            	selected = event.currentTarget.selectedItem as Location;
                locationGroupCB.selectedIndex = commonModelLocator.allLocationGroups.getItemIndex(selected.locationGroup);
                locationTypeCB.selectedIndex = commonModelLocator.allLocationTypes.getItemIndex(selected.locationType);
                if (selected.lastAccess != null) {
                    lastAccessTxt.text = commonModelLocator.dateTimeFormatter.format(selected.lastAccess);
                }
            }
<commit_msg>javadoc<commit_after><?xml version="1.0" encoding="utf-8"?>
<!--
/*
 * openwms.org, the Open Warehouse Management System.
 *
 * This file is part of openwms.org.
 *
 * openwms.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as 
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * openwms.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software. If not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
-->
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" backgroundColor="#C2DAEF" show="onShow()">

    <mx:Metadata>
        [Name("locationView")]
        [ManagedEvent(name="LOAD_ALL_LOCATIONS")]
        [ManagedEvent(name="LOAD_ALL_LOCATION_TYPES")]
        [ManagedEvent(name="LOAD_ALL_LOCATION_GROUPS")]
        [ManagedEvent(name="SAVE_LOCATION")]
    </mx:Metadata>

    <mx:Script>
        <![CDATA[
        	import mx.controls.Alert;
        	import mx.managers.PopUpManager;
            import org.openwms.web.flex.client.util.DisplayUtility;
            import org.openwms.web.flex.client.util.BindingProperty;
            import org.openwms.web.flex.client.common.event.LocationEvent;
            import org.openwms.web.flex.client.common.event.LocationTypeEvent;
            import org.openwms.web.flex.client.common.event.LocationGroupEvent;
        	import org.openwms.common.domain.LocationGroup;
        	import org.openwms.common.domain.LocationType;
        	import org.openwms.common.domain.Location;
            import org.openwms.web.flex.client.common.model.CommonModelLocator;
            import mx.controls.dataGridClasses.DataGridColumn;
            import mx.collections.ArrayCollection;
            import mx.events.ListEvent;

            [In]
            [Bindable]
            /**
             * Inject a model to work on.
             */
            public var commonModelLocator:CommonModelLocator;

            [Bindable]
            private var selected:Location;

            [Bindable]
            private var listLocationGroups:ArrayCollection=new ArrayCollection();

            private function onShow():void {
                if (commonModelLocator.allLocations.length == 0) {
                    dispatchEvent(new LocationEvent(LocationEvent.LOAD_ALL_LOCATIONS));
                }
                if (commonModelLocator.allLocationTypes.length == 0) {
                	dispatchEvent(new LocationTypeEvent(LocationTypeEvent.LOAD_ALL_LOCATION_TYPES));
                }
                if (commonModelLocator.allLocationGroups.length == 0) {
                	dispatchEvent(new LocationGroupEvent(LocationGroupEvent.LOAD_ALL_LOCATION_GROUPS));
                }
            }

            private function onRowClick(event:ListEvent):void {
            	selected = event.currentTarget.selectedItem as Location;
                locationGroupCB.selectedIndex = commonModelLocator.allLocationGroups.getItemIndex(selected.locationGroup);
                locationTypeCB.selectedIndex = commonModelLocator.allLocationTypes.getItemIndex(selected.locationType);
                if (selected.lastAccess != null) {
                    lastAccessTxt.text = commonModelLocator.dateTimeFormatter.format(selected.lastAccess);
                }
            }

{'fraction_non_alphanumeric': 0.09244704942054083, 'fraction_numerical': 0.007726122285866524, 'mean_word_length': 2.554924242424242, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 2, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1380386', 'n_tokens_mistral': 2062, 'n_tokens_neox': 1988, 'n_words': 459}