<commit_before><?xml version="1.0" encoding="utf-8"?>

<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="550" height="500" creationComplete="init()">
<mx:Script>
	<![CDATA[
		import mx.controls.CheckBox;
		import mx.binding.utils.BindingUtils;
		import mx.collections.ArrayCollection;
		import mx.managers.PopUpManager;
	    import mx.events.CollectionEvent;
	    import Components.DAGPath;
	    import mx.controls.Alert;
		import mx.managers.PopUpManager;
		import mx.rpc.events.ResultEvent;

	    [Bindable]
		public var pathList:ArrayCollection=new ArrayCollection();;
	    [Bindable]
		public var selectedList:ArrayCollection= null;
		
		public var nodeList:ArrayCollection =null;						
		public var dagPath:DAGPath = null;
		
		private function init():void
        {
        	 //Intialising ambiguity panel
        	selectedList = new ArrayCollection()
        	pathList.addEventListener(CollectionEvent.COLLECTION_CHANGE, handleDataProviderChange);
        }
       
		public  function closePopUp(event:MouseEvent):void {
				var buttonStr:Array=event.currentTarget.toString().split(".");
				var index:int=(buttonStr.length-1)
	   	 	 	PopUpManager.removePopUp(this);
				if(buttonStr[index]=="OK")
				{
					this.parentApplication.rpcService.removeEventListener(ResultEvent.RESULT,this.parentApplication.getPathHandler,false);
					this.parentApplication.rpcService.addEventListener("result",this.parentApplication.linkNodesHandler);
					if(nodeList!=null&&selectedList!=null)
					{
						this.parentApplication.rpcService.linkNodes(nodeList,selectedList);
					}
				}
				else
				{
					selectedList=null;
					pathList=null;
					this.parentApplication.cancelHandler(nodeList);
				}
						
		}

	private function handleDataProviderChange(event:CollectionEvent):void
        {
		
		try{
				var len:int = pathList.length;
				for (var i:int=0;i<len;i++)
				{
					dagPath = pathList.getItemAt(i) as DAGPath;
					if (dagPath.isSelected)
					{
						selectedList.addItem(dagPath);
					}
				}
			}catch(error:Error)
			{
				Alert.show("Error :"+error.message);
			
			}
			
             
         }
		
	]]>
</mx:Script>
	<mx:DataGrid name="pathGrid" dataProvider="{pathList}" width="550" x="0" height="500" y="0"  verticalScrollPolicy="off" horizontalScrollPolicy="off">
		<mx:columns>
			<mx:DataGridColumn headerText="Paths" dataField="toolTip" dataTipField="toolTip" showDataTips="true" width="450"/>
			<mx:DataGridColumn headerText="Select" dataField="isSelected" width="100">
			   <mx:itemRenderer>
			      <mx:Component>
				         <mx:CheckBox name="checkBox" click="data.isSelected=!data.isSelected"  selected="{data.isSelected}"/>			      	
			      </mx:Component>
      		   </mx:itemRenderer>
			</mx:DataGridColumn>			
		</mx:columns>
	</mx:DataGrid>
	<mx:ControlBar name="controlBar">
		<mx:Spacer width="100%"/>
		<mx:Button name="OK" label="OK" click="closePopUp(event)"/>
		<mx:Button name="Cancel" label="Cancel" click="closePopUp(event)"/>
	</mx:ControlBar>

</mx:Panel>
<commit_msg>Word wrap added<commit_after><?xml version="1.0" encoding="utf-8"?>

<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="550" height="500" creationComplete="init()">
<mx:Script>
	<![CDATA[
		import mx.controls.CheckBox;
		import mx.binding.utils.BindingUtils;
		import mx.collections.ArrayCollection;
		import mx.managers.PopUpManager;
	    import mx.events.CollectionEvent;
	    import Components.DAGPath;
	    import mx.controls.Alert;
		import mx.managers.PopUpManager;
		import mx.rpc.events.ResultEvent;

	    [Bindable]
		public var pathList:ArrayCollection=new ArrayCollection();;
	    [Bindable]
		public var selectedList:ArrayCollection= null;
		
		public var nodeList:ArrayCollection =null;						
		public var dagPath:DAGPath = null;
		
		private function init():void
        {
        	 //Intialising ambiguity panel
        	selectedList = new ArrayCollection()
        	pathList.addEventListener(CollectionEvent.COLLECTION_CHANGE, handleDataProviderChange);
        }
       
		public  function closePopUp(event:MouseEvent):void {
				var buttonStr:Array=event.currentTarget.toString().split(".");
				var index:int=(buttonStr.length-1)
	   	 	 	PopUpManager.removePopUp(this);
				if(buttonStr[index]=="OK")
				{
					this.parentApplication.rpcService.removeEventListener(ResultEvent.RESULT,this.parentApplication.getPathHandler,false);
					this.parentApplication.rpcService.addEventListener("result",this.parentApplication.linkNodesHandler);
					if(nodeList!=null&&selectedList!=null)
					{
						this.parentApplication.rpcService.linkNodes(nodeList,selectedList);
					}
				}
				else
				{
					selectedList=null;
					pathList=null;
					this.parentApplication.cancelHandler(nodeList);
				}
						
		}

	private function handleDataProviderChange(event:CollectionEvent):void
        {
		
		try{
				var len:int = pathList.length;
				for (var i:int=0;i<len;i++)
				{
					dagPath = pathList.getItemAt(i) as DAGPath;
					if (dagPath.isSelected)
					{
						selectedList.addItem(dagPath);
					}
				}
			}catch(error:Error)
			{
				Alert.show("Error :"+error.message);
			
			}
			
             
         }
		
	]]>
</mx:Script>
	<mx:DataGrid name="pathGrid" dataProvider="{pathList}" width="550" x="0" height="500" y="0"  verticalScrollPolicy="off" horizontalScrollPolicy="off">
		<mx:columns>
			<mx:DataGridColumn headerText="Paths" dataField="toolTip" dataTipField="toolTip" showDataTips="true" width="450" wordWrap="true"/>
			<mx:DataGridColumn headerText="Select" dataField="isSelected" width="100">
			   <mx:itemRenderer>
			      <mx:Component>
				         <mx:CheckBox name="checkBox" click="data.isSelected=!data.isSelected"  selected="{data.isSelected}"/>			      	
			      </mx:Component>
      		   </mx:itemRenderer>
			</mx:DataGridColumn>			
		</mx:columns>
	</mx:DataGrid>
	<mx:ControlBar name="controlBar">
		<mx:Spacer width="100%"/>
		<mx:Button name="OK" label="OK" click="closePopUp(event)"/>
		<mx:Button name="Cancel" label="Cancel" click="closePopUp(event)"/>
	</mx:ControlBar>

</mx:Panel>

{'fraction_non_alphanumeric': 0.13387198986058302, 'fraction_numerical': 0.010139416983523447, 'mean_word_length': 3.254043126684636, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 2, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4545938', 'n_tokens_mistral': 2372, 'n_tokens_neox': 1938, 'n_words': 285}