<commit_before><?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the Spark DataGrid control. -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx">
    
    <fx:Declarations>
        <s:XMLListCollection id="employees">
            <s:source>
                <fx:XMLList>
                    <employee>
                        <name><NAME></name>
                        <phone>555-219-2270</phone>
                        <email><EMAIL></email>
                        <active>true</active>
                    </employee>
                    <employee>
                        <name><NAME></name>
                        <phone>555-219-2012</phone>
                        <email><EMAIL></email>
                        <active>true</active>
                    </employee>
                    <employee>
                        <name><NAME></name>
                        <phone>555-219-2012</phone>
                        <email><EMAIL></email>
                        <active>false</active>
                    </employee>
                    <employee>
                        <name><NAME></name>
                        <phone>555-219-2000</phone>
                        <email><EMAIL></email>
                        <active>true</active>
                    </employee>
                </fx:XMLList>
            </s:source>
        </s:XMLListCollection>
    </fx:Declarations>
    
    <s:Panel title="Spark DataGrid Control Example"
             width="75%" height="75%" 
             horizontalCenter="0" verticalCenter="0">
        <s:VGroup left="10" right="10" top="10" bottom="10">
            <s:Label width="100%" color="blue"
                     text="Select a row in the DataGrid control."/>			
            <s:DataGrid id="dg"
                        dataProvider="{employees}"
                        editable="true"					
                        width="100%" height="100%">
                <s:columns>
                    <s:ArrayCollection>
                        <s:GridColumn dataField="name" headerText="Name"/>
                        <s:GridColumn dataField="phone" headerText="Phone"/>
                        <s:GridColumn dataField="email" headerText="Email">
                            <!-- Declare a custom itemRenderer for the email column -->
                            <s:itemRenderer>
                                <fx:Component>
                                    <s:GridItemRenderer>
                                        <fx:Script>
                                            <![CDATA[
                                                import flashx.textLayout.conversion.TextConverter;									            
                                                override public function prepare(hasBeenRecycled:Boolean):void 
                                                {
                                                    anchor.textFlow = TextConverter.importToFlow(
                                                        "<a href='mailto:" + data.email + "'>" + 
                                                        data.email + "</a>", 
                                                        TextConverter.TEXT_FIELD_HTML_FORMAT);
                                                }
                                            ]]>
                                        </fx:Script>									    
                                        <s:RichEditableText id="anchor" editable="false" 
                                                            left="5" verticalCenter="0" right="5" 
                                                            lineBreak="explicit" />
                                    </s:GridItemRenderer>
                                </fx:Component>
                            </s:itemRenderer>
                        </s:GridColumn>
                        <s:GridColumn dataField="active" headerText="Active" />
                    </s:ArrayCollection>
                </s:columns>
            </s:DataGrid>
            
            <s:Form width="100%" height="100%">
                <s:FormItem label="Name">
                    <s:Label text="{dg.selectedItem.name}"/>
                </s:FormItem>
                <s:FormItem label="Email">
                    <s:Label text="{dg.selectedItem.email}"/>
                </s:FormItem>
                <s:FormItem label="Phone">
                    <s:Label text="{dg.selectedItem.phone}"/>
                </s:FormItem>
            </s:Form>
        </s:VGroup>
    </s:Panel>	
</s:Application><commit_msg>Transferred from the Adobe Open Source Subversion Repository<commit_after><?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the Spark DataGrid control. -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx">
    
    <fx:Declarations>
        <s:ArrayCollection id="employees">
            <s:DataItem name="<NAME>" phone="555-219-2270" email="<EMAIL>" active="true"/>
            <s:DataItem name="<NAME>" phone="555-219-2012" email="<EMAIL>" active="true"/>
            <s:DataItem name="<NAME>" phone="555-219-2012" email="<EMAIL>" active="false"/>
            <s:DataItem name="<NAME>" phone="555-219-2000" email="<EMAIL>" active="true"/>
        </s:ArrayCollection>
     </fx:Declarations>
    
    <s:Panel title="Spark DataGrid Control Example"
             width="75%" height="75%" 
             horizontalCenter="0" verticalCenter="0">
        <s:VGroup left="10" right="10" top="10" bottom="10">
            <s:Label width="100%" color="blue"
                     text="Select a row in the DataGrid control."/>			
            <s:DataGrid id="dg"
                        dataProvider="{employees}"
                        editable="true"
                        width="100%" height="100%">
                <s:columns>
                    <s:ArrayCollection>
                        <s:GridColumn dataField="name" headerText="Name"/>
                        <s:GridColumn dataField="phone" headerText="Phone"/>
                        <s:GridColumn dataField="email" headerText="Email">
                            <!-- Declare a custom itemRenderer for the email column -->
                            <s:itemRenderer>
                                <fx:Component>
                                    <s:GridItemRenderer>
                                        <fx:Script>
                                            <![CDATA[
                                                import flashx.textLayout.conversion.TextConverter;									            
                                                override public function prepare(hasBeenRecycled:Boolean):void 
                                                {
                                                    anchor.textFlow = TextConverter.importToFlow(
                                                        "<a href='mailto:" + data.email + "'>" + 
                                                        data.email + "</a>", 
                                                        TextConverter.TEXT_FIELD_HTML_FORMAT);
                                                }
                                            ]]>
                                        </fx:Script>									    
                                        <s:RichEditableText id="anchor" editable="false" 
                                                            paddingLeft="5" paddingRight="5"
                                                            paddingTop="5" paddingBottom="5"
                                                            verticalCenter="0"
                                                            heightInLines="1"/>
                                    </s:GridItemRenderer>
                                </fx:Component>
                            </s:itemRenderer>
                        </s:GridColumn>
                        <s:GridColumn dataField="active" headerText="Active" />
                    </s:ArrayCollection>
                </s:columns>
            </s:DataGrid>
            
            <s:Form width="100%" height="100%">
                <s:FormItem label="Name">
                    <s:Label text="{dg.selectedItem.name}"/>
                </s:FormItem>
                <s:FormItem label="Email">
                    <s:Label text="{dg.selectedItem.email}"/>
                </s:FormItem>
                <s:FormItem label="Phone">
                    <s:Label text="{dg.selectedItem.phone}"/>
                </s:FormItem>
            </s:Form>
        </s:VGroup>
    </s:Panel>	
</s:Application>
{'fraction_non_alphanumeric': 0.11734058217238645, 'fraction_numerical': 0.018235360743006003, 'mean_word_length': 0.9364035087719298, 'pattern_counts': {'":': 0, '<': 163, '<?xml version=': 2, '>': 163, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 62, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6966197', 'n_tokens_mistral': 2144, 'n_tokens_neox': 1881, 'n_words': 312}