{ "bigcode": { "train": { "total_tokens": 453700537, "example": "////////////////////////////////////////////////////////////////////////////////\r\n//\r\n// Licensed to the Apache Software Foundation (ASF) under one or more\r\n// contributor license agreements. See the NOTICE file distributed with\r\n// this work for additional information regarding copyright ownership.\r\n// The ASF licenses this file to You under the Apache License, Version 2.0\r\n// (the \"License\"); you may not use this file except in compliance with\r\n// the License. You may obtain a copy of the License at\r\n//\r\n// http://www.apache.org/licenses/LICENSE-2.0\r\n//\r\n// Unless required by applicable law or agreed to in writing, software\r\n// distributed under the License is distributed on an \"AS IS\" BASIS,\r\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n// See the License for the specific language governing permissions and\r\n// limitations under the License.\r\n//\r\n////////////////////////////////////////////////////////////////////////////////\r\n\r\n/*\r\n\r\nThe implementations of DefaultGridItemRenderer (nee UIFTETExtFieldGridItemRenderer) and UITextFieldGridItemRenderer\r\nare identical, save the superclass and constructor names. This file contains the bulk of the code.\r\n\r\n*/\r\n import flash.display.DisplayObject;\r\n import flash.events.Event;\r\n import flash.geom.Matrix;\r\n import flash.geom.Matrix3D;\r\n import flash.geom.Point;\r\n import flash.geom.Rectangle;\r\n import flash.geom.Vector3D;\r\n import flash.utils.getDefinitionByName;\r\n import flash.utils.getQualifiedClassName;\r\n import flash.utils.getQualifiedSuperclassName;\r\n \r\n import mx.core.DesignLayer;\r\n import mx.core.IFlexDisplayObject;\r\n import mx.core.IFlexModuleFactory;\r\n import mx.core.ILayoutDirectionElement;\r\n import mx.core.IToolTip;\r\n import mx.core.LayoutDirection;\r\n import mx.core.mx_internal;\r\n import mx.events.FlexEvent;\r\n import mx.events.ToolTipEvent;\r\n import mx.geom.TransformOffsets;\r\n import mx.managers.ISystemManager;\r\n import mx.managers.ToolTipManager;\r\n import mx.styles.CSSStyleDeclaration;\r\n import mx.styles.IStyleClient;\r\n import mx.styles.StyleProtoChain;\r\n \r\n import spark.components.Grid;\r\n import spark.components.gridClasses.GridColumn;\r\n \r\n use namespace mx_internal;\r\n\r\n /**\r\n * @private\r\n * Distance by which this textfield is inset from the edges of the cell.\r\n * See setLayoutBoundsPosition() and setLayoutBoundsSize().\r\n */\r\n private static const LEFT_PADDING:Number = 5; \r\n private static const RIGHT_PADDING:Number = 5;\r\n private static const TOP_PADDING:Number = 4;\r\n private static const BOTTOM_PADDING:Number = 3;\r\n \r\n /**\r\n * @private\r\n * The updatePreferredSize() method only updates preferredWidth,Height if \r\n * preferredSizeInvalid is true.\r\n */\r\n private var preferredSizeInvalid:Boolean = false;\r\n private var preferredWidth:Number;\r\n private var preferredHeight:Number;\r\n \r\n /**\r\n * @private\r\n * A workaround for the fact that UITextField automatically calls validateNow()\r\n * when its text property is set.\r\n */\r\n private var enableValidateNow:Boolean = true;\r\n\r\n /**\r\n * @private\r\n * Used to prevent changes to width,height caused by calling setLayoutBoundsSize()\r\n * from updating explicitWidth,Height.\r\n */\r\n private var inSetLayoutBoundsSize:Boolean = false;\r\n\r\n /**\r\n * @private\r\n * Temporarily stores the values of styles specified with setStyle() until \r\n * moduleFactory is set.\r\n */\r\n private var deferredSetStyles:Object = null;\r\n\r\n //--------------------------------------------------------------------------\r\n //\r\n // Properties \r\n //\r\n //--------------------------------------------------------------------------\r\n \r\n private function dispatchChangeEvent(type:String):void\r\n {\r\n if (hasEventListener(type))\r\n dispatchEvent(new Event(type));\r\n }\r\n \r\n //----------------------------------\r\n // column\r\n //----------------------------------\r\n \r\n private var _column:GridColumn = null;\r\n \r\n [Bindable(\"columnChanged\")]\r\n \r\n /**\r\n * @inheritDoc\r\n * \r\n * @default null\r\n * \r\n * @langversion 3.0\r\n * @playerversion Flash 10\r\n * @playerversion AIR 2.5\r\n * @productversion Flex 4.5\r\n */\r\n public function get column():GridColumn\r\n {\r\n return _column;\r\n }\r\n \r\n /**\r\n * @private\r\n */\r\n public function set column(value:GridColumn):void\r\n {\r\n if (_column == value)\r\n return;\r\n \r\n _column = value;\r\n dispatchChangeEvent(\"columnChanged\");\r\n }\r\n\r\n //----------------------------------\r\n // column\r\n //----------------------------------\r\n\r\n /**\r\n * @inheritDoc\r\n * \r\n * @langversion 3.0\r\n * @playerversion Flash 10\r\n * @playerversion AIR 2.5\r\n * @productversion Flex 4.5\r\n */\r\n public function get columnIndex():int\r\n {\r\n return (_column)? _column.columnIndex : -1;\r\n }\r\n\r\n \r\n //----------------------------------\r\n // data\r\n //----------------------------------\r\n \r\n private var _data:Object = null;\r\n \r\n [Bindable(\"dataChange\")] // compatible with FlexEvent.DATA_CHANGE\r\n \r\n /**\r\n * The value of the data provider item for the entire row of the grid control.\r\n * Item renderers often bind visual element attributes to properties of this object. \r\n * \r\n * @default null\r\n * \r\n * @langversion 3.0\r\n * @playerversion Flash 10\r\n * @playerversion AIR 2.5\r\n * @productversion Flex 4.5\r\n */\r\n public function get data():Object\r\n {\r\n return _data;\r\n }\r\n \r\n /**\r\n * @private\r\n */\r\n public function set data(value:Object):void\r\n {\r\n if (_data == value)\r\n return;\r\n \r\n _data = value;\r\n \r\n const eventType:String = \"dataChange\"; \r\n if (hasEventListener(eventType))\r\n dispatchEvent(new FlexEvent(eventType)); \r\n }\r\n \r\n //----------------------------------\r\n // down\r\n //----------------------------------\r\n \r\n private var _down:Boolean = false;\r\n \r\n [Bindable(\"downChanged\")] \r\n \r\n /**\r\n *
The grid control's updateDisplayList() method sets this property \r\n * before calling prepare().
true when the mouse is hovered over the item renderer.\r\n *\r\n * @default false\r\n * \r\n * @langversion 3.0\r\n * @playerversion Flash 10\r\n * @playerversion AIR 2.0\r\n * @productversion Flex 4.5 \r\n */ \r\n public function get hovered():Boolean\r\n {\r\n return _hovered;\r\n }\r\n \r\n /**\r\n * @private\r\n */ \r\n public function set hovered(value:Boolean):void\r\n {\r\n if (_hovered == value)\r\n return;\r\n \r\n _hovered = value;\r\n dispatchChangeEvent(\"hoveredChanged\"); \r\n }\r\n \r\n //----------------------------------\r\n // rowIndex\r\n //----------------------------------\r\n \r\n private var _rowIndex:int = -1;\r\n \r\n [Bindable(\"rowIndexChanged\")]\r\n \r\n /**\r\n * The grid control's updateDisplayList() method sets this property \r\n * before calling prepare().
The grid control's updateDisplayList() method sets this property \r\n * before calling preprare().
The grid control's updateDisplayList() method sets this property \r\n * before calling prepare().
The grid control sets this property to the value of the column's \r\n * itemToLabel() method, before calling preprare().
layoutDirection from its parent.\r\n * \r\n * @langversion 3.0\r\n * @playerversion Flash 10\r\n * @playerversion AIR 2.5\r\n * @productversion Flex 4.5\r\n */\r\n public function get layoutDirection():String\r\n {\r\n return getStyle(\"layoutDirection\"); \r\n }\r\n \r\n /**\r\n * @private\r\n */\r\n public function set layoutDirection(value:String):void\r\n {\r\n }\r\n\r\n /**\r\n * @private \r\n */\r\n public function invalidateLayoutDirection():void\r\n {\r\n }\r\n \r\n //--------------------------------------------------------------------------\r\n //\r\n // IStyleClient Methods and Properties\r\n // (source code from mx.controls.dataGridClassses.DataGridItemRenderer.as)\r\n //-------------------------------------------------------------------------- \r\n \r\n /**\r\n * @private\r\n */\r\n public function getClassStyleDeclarations():Array\r\n {\r\n var className:String = getQualifiedClassName(this).replace(\"::\", \".\");\r\n const styleDeclarations:Array = [];\r\n \r\n while ((className!= \"mx.core.UIFTETextField\") && (className!= \"mx.core.UITextField\"))\r\n {\r\n var styleDeclaration:CSSStyleDeclaration = styleManager.getMergedStyleDeclaration(className);\r\n if (styleDeclaration)\r\n styleDeclarations.unshift(styleDeclaration);\r\n \r\n try\r\n {\r\n className = getQualifiedSuperclassName(getDefinitionByName(className)).replace(\"::\", \".\");\r\n }\r\n catch(e:ReferenceError)\r\n {\r\n break;\r\n }\r\n } \r\n \r\n return styleDeclarations;\r\n }\r\n \r\n /**\r\n * @private\r\n */\r\n public function initProtoChain():void\r\n {\r\n styleChangedFlag = true;\r\n \r\n var classSelectors:Array = [];\r\n \r\n if (styleName)\r\n {\r\n if (styleName is CSSStyleDeclaration)\r\n {\r\n // Get the style sheet referenced by the styleName property\r\n classSelectors.push(CSSStyleDeclaration(styleName));\r\n }\r\n else if (styleName is IFlexDisplayObject)\r\n {\r\n // If the styleName property is a UIComponent, then there's a\r\n // special search path for that case.\r\n StyleProtoChain.initProtoChainForUIComponentStyleName(this);\r\n return;\r\n }\r\n else if (styleName is String)\r\n {\r\n // Get the style sheet referenced by the styleName property\r\n var styleNames:Array = styleName.split(/\\s+/);\r\n for (var c:int=0; c < styleNames.length; c++)\r\n {\r\n if (styleNames[c].length) {\r\n classSelectors.push(styleManager.getMergedStyleDeclaration(\".\" + \r\n styleNames[c]));\r\n }\r\n }\r\n }\r\n }\r\n \r\n // To build the proto chain, we start at the end and work forward.\r\n // Referring to the list at the top of this function, we'll start by\r\n // getting the tail of the proto chain, which is:\r\n // - for non-inheriting styles, the global style sheet\r\n // - for inheriting styles, my parent's style object\r\n \r\n var nonInheritChain:Object = styleManager.stylesRoot;\r\n \r\n var p:IStyleClient = parent as IStyleClient;\r\n if (p)\r\n {\r\n var inheritChain:Object = p.inheritingStyles;\r\n if (inheritChain == StyleProtoChain.STYLE_UNINITIALIZED)\r\n inheritChain = nonInheritChain;\r\n }\r\n else\r\n {\r\n inheritChain = styleManager.stylesRoot;\r\n }\r\n \r\n // Working backwards up the list, the next element in the\r\n // search path is the type selector\r\n var typeSelectors:Array = getClassStyleDeclarations();\r\n var n:int = typeSelectors.length;\r\n for (var i:int = 0; i < n; i++)\r\n {\r\n var typeSelector:CSSStyleDeclaration = typeSelectors[i];\r\n inheritChain = typeSelector.addStyleToProtoChain(inheritChain, this);\r\n nonInheritChain = typeSelector.addStyleToProtoChain(nonInheritChain, this);\r\n }\r\n \r\n // Next are the class selectors\r\n for (i = 0; i < classSelectors.length; i++)\r\n {\r\n var classSelector:CSSStyleDeclaration = classSelectors[i];\r\n if (classSelector)\r\n {\r\n inheritChain = classSelector.addStyleToProtoChain(inheritChain, this);\r\n nonInheritChain = classSelector.addStyleToProtoChain(nonInheritChain, this);\r\n }\r\n }\r\n \r\n // Finally, we'll add the in-line styles\r\n // to the head of the proto chain.\r\n inheritingStyles = styleDeclaration?\r\n styleDeclaration.addStyleToProtoChain(inheritChain, this) :\r\n inheritChain;\r\n \r\n nonInheritingStyles = styleDeclaration?\r\n styleDeclaration.addStyleToProtoChain(nonInheritChain, this) :\r\n nonInheritChain;\r\n }\r\n \r\n /**\r\n * @private\r\n * \r\n * @langversion 3.0\r\n * @playerversion Flash 10\r\n * @playerversion AIR 2.5\r\n * @productversion Flex 4.5\r\n */\r\n public function clearStyle(styleProp:String):void\r\n {\r\n setStyle(styleProp, undefined);\r\n }\r\n \r\n /**\r\n * @private\r\n */\r\n public function regenerateStyleCache(recursive:Boolean):void\r\n {\r\n initProtoChain();\r\n }\r\n \r\n /**\r\n * @private\r\n */\r\n public function notifyStyleChangeInChildren(styleProp:String, recursive:Boolean):void\r\n { \r\n }\r\n \r\n /**\r\n * @private\r\n */\r\n public function registerEffects(effects:Array /* of String */):void\r\n {\r\n } \r\n \r\n //----------------------------------\r\n // styleDeclaration\r\n //----------------------------------\r\n \r\n private var _styleDeclaration:CSSStyleDeclaration;\r\n \r\n /**\r\n * @private\r\n */\r\n public function get styleDeclaration():CSSStyleDeclaration\r\n {\r\n return _styleDeclaration;\r\n }\r\n \r\n /**\r\n * @private\r\n */\r\n public function set styleDeclaration(value:CSSStyleDeclaration):void\r\n {\r\n _styleDeclaration = value;\r\n }\r\n<|endoftext|>"
},
"test": {
"total_tokens": 50999295,
"example": "package com.guepard.parser.serialization\r\n{\r\n//\timport adobe.utils.CustomActions;\r\n//\timport calista.hash.Blowfish;\r\n\timport com.guepard.app.Converter;\r\n\timport com.guepard.parser.info.AccessType;\r\n\timport com.guepard.parser.info.ClassInfo;\r\n\timport com.guepard.parser.info.ExpressionInfo;\r\n\timport com.guepard.parser.info.ExpressionType;\r\n\timport com.guepard.parser.info.MemberInfo;\r\n\timport com.guepard.parser.info.MethodInfo;\r\n\timport com.guepard.parser.info.MethodType;\r\n\timport com.guepard.parser.info.NamespaceInfo;\r\n\timport com.guepard.parser.info.VariableInfo;\r\n\timport com.guepard.parser.info.VariableType;\r\n\timport com.guepard.parser.token.Token;\r\n\timport com.guepard.parser.token.TokenType;\r\n\t\r\n\timport flash.utils.Dictionary;\r\n\t\r\n\t/**\r\n\t *...\r\n\t * @author Antonov Sergey\r\n\t */\r\n\tpublic class CodeAnalyzator\r\n\t{\r\n\t\tpublic static const ITERATIONS_MAX:int = 10;\r\n\t\t\r\n\t\tprivate static var _errors:Vector.