/* Handles typeIndex and typeCount properties for every walker.
178134
function walkIterator(query, parent, state) {
  var nodes = parent.children
  var typeIndex = state.index ? createTypeIndex() : null
  var delayed = []

  return {
    prefillTypeIndex: rangeDefaults(prefillTypeIndex),
    each: rangeDefaults(each),
    done: done
  }

  function done() {
    var length = delayed.length
    var index = -1

    while (++index < length) {
      delayed[index]()

      if (state.one && state.found) {
        break
      }
    }

    return this
  }

  function prefillTypeIndex(start, end) {
    if (typeIndex) {
      while (start < end) {
        typeIndex(nodes[start])
        start++
      }
    }

    return this
  }

  function each(start, end) {
    var child = nodes[start]
    var index
    var elementIndex

    if (start >= end) {
      return this
    }

    if (typeIndex) {
      elementIndex = typeIndex.elements
      index = typeIndex(child)
      delayed.push(delay)
    } else {
      pushNode()
    }

    /* Stop if we’re looking for one node and it’s already found. */
    if (state.one && state.found) {
      return this
    }

    return each.call(this, start + 1, end)

    function delay() {
      state.typeIndex = index
      state.elementIndex = elementIndex
      state.typeCount = typeIndex.count(child)
      state.elementCount = typeIndex.elements
      pushNode()
    }

    function pushNode() {
      var exit = enter(state, child)
      state.iterator(query, child, start, parent, state)
      exit()
    }
  }

  function rangeDefaults(iterator) {
    return rangeDefault

    function rangeDefault(start, end) {
      if (start === null || start === undefined || start < 0) {
        start = 0
      }

      if (end === null || end === undefined || end > nodes.length) {
        end = nodes.length
      }

      return iterator.call(this, start, end)
    }
  }
}
657333
@Override
	public void setTypeahead(boolean _typeahead) {
		if (_typeahead) {
			AddResourcesListener.addResourceToHeadButAfterJQuery(C.BSF_LIBRARY, "js/typeahead.js");
			AddResourcesListener.addExtCSSResource("typeahead.css");
		}
		super.setTypeahead(_typeahead);
	}
141654
function(parentValue, nameIndex) {

                                            if (nameIndex > defaultPropertyDepth) {
                                                defaultObserve = currentObserve;
                                                defaultReads = currentReads;
                                                defaultPropertyDepth = nameIndex;
                                                defaultScope = scope;

                                                defaultComputeReadings = can.__clearReading();
                                            }
                                        }
761888
private void handleElementCollectionAttribute(CQLTranslator translator, Attribute attribute,
            StringBuilder typeQueryBuilder)
    {
        String dataType = CassandraValidationClassMapper.getValidationClass(attribute.getJavaType(), true);

        // CQL Type of collection column
        String collectionCqlType = translator.getCQLType(dataType);

        // Collection Column Name
        String collectionColumnName = new String(((AbstractAttribute) attribute).getJPAColumnName());

        // Generic Type list
        StringBuilder genericTypesBuilder = null;
        List<Class<?>> genericClasses = PropertyAccessorHelper.getGenericClasses((Field) attribute.getJavaMember());
        if (!genericClasses.isEmpty())
        {
            genericTypesBuilder = new StringBuilder();
            if (MapType.class.getSimpleName().equals(dataType) && genericClasses.size() == 2)
            {
                genericTypesBuilder.append(Constants.STR_LT);
                if (genericClasses.get(0).getAnnotation(Embeddable.class) != null)
                {
                    String frozenKey = CQLTranslator.FROZEN + Constants.STR_LT + Constants.ESCAPE_QUOTE
                            + genericClasses.get(0).getSimpleName() + Constants.ESCAPE_QUOTE + Constants.STR_GT;
                    genericTypesBuilder.append(frozenKey);
                }
                else
                {
                    String keyDataType = CassandraValidationClassMapper.getValidationClass(genericClasses.get(0), true);
                    genericTypesBuilder.append(translator.getCQLType(keyDataType));
                }
                genericTypesBuilder.append(Constants.SPACE_COMMA);
                if (genericClasses.get(1).getAnnotation(Embeddable.class) != null)
                {
                    String frozenKey = CQLTranslator.FROZEN + Constants.STR_LT + Constants.ESCAPE_QUOTE
                            + genericClasses.get(1).getSimpleName() + Constants.ESCAPE_QUOTE + Constants.STR_GT;
                    genericTypesBuilder.append(frozenKey);
                }
                else
                {
                    String keyDataType = CassandraValidationClassMapper.getValidationClass(genericClasses.get(1), true);
                    genericTypesBuilder.append(translator.getCQLType(keyDataType));
                }
                genericTypesBuilder.append(Constants.STR_GT);
            }
            else if ((ListType.class.getSimpleName().equals(dataType) || SetType.class.getSimpleName().equals(dataType))
                    && genericClasses.size() == 1)
            {
                genericTypesBuilder.append(Constants.STR_LT);
                if (genericClasses.get(0).getAnnotation(Embeddable.class) != null)
                {
                    String frozenKey = CQLTranslator.FROZEN + Constants.STR_LT + Constants.ESCAPE_QUOTE
                            + genericClasses.get(0).getSimpleName() + Constants.ESCAPE_QUOTE + Constants.STR_GT;
                    genericTypesBuilder.append(frozenKey);
                }
                else
                {
                    String keyDataType = CassandraValidationClassMapper.getValidationClass(genericClasses.get(0), true);
                    genericTypesBuilder.append(translator.getCQLType(keyDataType));
                }
                genericTypesBuilder.append(Constants.STR_GT);
            }
            else
            {
                throw new SchemaGenerationException("Incorrect collection field definition for "
                        + ((AbstractAttribute) attribute).getJPAColumnName()
                        + ". Generic Types must be defined correctly.");
            }
        }

        if (genericTypesBuilder != null)
        {
            collectionCqlType += genericTypesBuilder.toString();
        }

        translator.appendColumnName(typeQueryBuilder, collectionColumnName, collectionCqlType);
        typeQueryBuilder.append(Constants.SPACE_COMMA);

    }
877690
private void fillWizardPageWithSelectedTypes() {
		final StructuredSelection selection = getSelectedItems();
		if (selection == null) {
			return;
		}
		for (final Iterator<?> iter = selection.iterator(); iter.hasNext();) {
			final Object obj = iter.next();
			if (obj instanceof TypeNameMatch) {
				accessedHistoryItem(obj);
				final TypeNameMatch type = (TypeNameMatch) obj;
				final String qualifiedName = Utilities.getNameWithTypeParameters(type.getType());
				final String message;

				if (addTypeToWizardPage(this.typeWizardPage, qualifiedName)) {
					message = MessageFormat.format(Messages.AbstractSuperTypeSelectionDialog_2,
							TextProcessor.process(qualifiedName, JAVA_ELEMENT_DELIMITERS));
				} else {
					message = MessageFormat.format(Messages.AbstractSuperTypeSelectionDialog_3,
							TextProcessor.process(qualifiedName, JAVA_ELEMENT_DELIMITERS));
				}
				updateStatus(new StatusInfo(IStatus.INFO, message));
			}
		}
	}
1355932
void onColumnTypeChanged(@Observes ValueChangeEvent<ColumnType> event) {
        PortablePreconditions.checkNotNull("ValueChangeEvent<ColumnType>",
                                           event);
        if (event.getContext().equals(columnType)) {

            // Update the help tooltip when the column type changes
            String columnTypeDescr = getColumnTypeDescription(event.getValue());
            columnType.setHelpContent(DataSetEditorConstants.INSTANCE.attributeColumnType(),
                                      columnTypeDescr,
                                      Placement.RIGHT);
        }
    }
847479
private void handleImportMappings(RtfImportMappings importMappings) {
		Iterator it = importMappings.getFontMappings().keySet().iterator();
		while(it.hasNext()) {
			String fontNr = (String) it.next();
			this.importMgr.importFont(fontNr, (String) importMappings.getFontMappings().get(fontNr));
		}
		it = importMappings.getColorMappings().keySet().iterator();
		while(it.hasNext()) {
			String colorNr = (String) it.next();
			this.importMgr.importColor(colorNr, (Color) importMappings.getColorMappings().get(colorNr));
		}
		it = importMappings.getListMappings().keySet().iterator();
		while(it.hasNext()) {
			String listNr = (String) it.next();
			this.importMgr.importList(listNr, (String)importMappings.getListMappings().get(listNr));
		}
		it = importMappings.getStylesheetListMappings().keySet().iterator();
		while(it.hasNext()) {
			String stylesheetListNr = (String) it.next();
			this.importMgr.importStylesheetList(stylesheetListNr, (List) importMappings.getStylesheetListMappings().get(stylesheetListNr));
		}
		
	}
675278
private int getIndex(TypeVariable<?> variable) {

        Class<?> rawType = resolveClass(owningType);
        TypeVariable<?>[] typeParameters = rawType.getTypeParameters();

        for (int i = 0; i < typeParameters.length; i++) {
            if (variable.equals(typeParameters[i])) {
                return i;
            }
        }

        return -1;
    }
812843
function typeInAncestry(type, input) {
	return ancestry(input)
		.reduce((carry, obj) => carry || Type.objectName(obj) === type, false);
}
542142
function() {
		gui.Plugin.prototype.ondestruct.call(this);
		gui.Object.each(this._trackedtypes, function(type, list) {
			list.slice().forEach(function(checks) {
				this._cleanup(type, checks);
			}, this);
		}, this);
	}
1248523
function handleItemKeypress(e) {
    const itemIndex = NodeListUtils.findNodeWithFirstChar(this.itemEls, e.key);

    if (itemIndex !== -1) {
        this.rovingTabindex.index = itemIndex;
    }
}
672727
function(types, handler, required) {
		types.forEach(function(Type) {
			if (gui.Type.isDefined(Type)) {
				this._addchecks(Type.$classid, [handler]);
				this._watches.push(Type);
				if (required) {
					this._needing.push(Type);
				}
			} else {
				throw new TypeError("Could not register input for undefined Type");
			}
		}, this);
		types.forEach(function(Type) {
			gui.Class.descendantsAndSelf(Type, function(T) {
				if (T.out(this.context)) { // type has been output already?
					this._maybeinput(edb.Output.$get(T));
				}
			}, this);
		}, this);
	}
202421
private TypeInfo getTypeInfo(Map<String, TypeInfo> typeMaps, String path, Class<?> superType) {

    TypeInfo typeInfo = typeMaps.get(path);
    if (typeInfo == null) {
      typeInfo = new TypeInfo(superType);
      typeMaps.put(path, typeInfo);
    }

    return typeInfo;

  }
250941
function(e) {
    if (e.doclet.kind == 'typedef' && e.doclet.properties) {
      properties[e.doclet.longname] = e.doclet.properties;
    }
  }
319088
public void clearTypes() {

        List<String> selectedTypes = m_searchObject.getTypes();
        m_handler.onClearTypes(selectedTypes);
        m_searchObject.clearTypes();
        updateResultsTab(false);
        ValueChangeEvent.fire(this, m_searchObject);
    }
902947
function(e) {
	   inputEx.StringField.superclass.onFocus.call(this,e);

	   if(this.options.typeInvite) {
         this.updateTypeInvite();
      }
	}
27246
@Override
	public void caseATypeMultipleBind(ATypeMultipleBind node)
			throws AnalysisException
	{
		ADefPatternBind bind = node.getAncestor(ADefPatternBind.class);

		if(bind != null && bind.parent() instanceof AForPatternBindStm)
		{
			super.caseATypeMultipleBind(node);
		}
		else {

			info.addUnsupportedNode(node, "Type binds are not supported");
		}
	}