/*
PropertySelector builder
181798
public static <E, F> PropertySelector<E, F> newPropertySelector(boolean orMode, Attribute<?, ?>... fields) {
        PropertySelector<E, F> ps = new PropertySelector<E, F>(checkNotNull(fields));
        return ps.orMode(orMode);
    }
627102
function() {
      inputEx.TypeField.superclass.initEvents.call(this); 
      
      // "Toggle the properties panel" button :
      Event.addListener(this.button, 'click', this.onTogglePropertiesPanel, this, true);
      
      // Prevent the button to receive a "click" event if the propertyPanel doesn't catch it
      Event.addListener(this.propertyPanel, 'click', function(e) { Event.stopPropagation(e);}, this, true);
      
      // Listen the "type" selector to update the groupOptions
      // Hack the type selector to rebuild the group option
      this.typeSelect.updatedEvt.subscribe(this.rebuildGroupOptions, this, true);
   }
1103608
public DescriptionBuilder freeSelectProperty(final String name,
                                                 final String defaultValue,
                                                 final boolean required,
                                                 final String propTitle,
                                                 final String propDescription, final List<String> selectValues) {
        properties.add(PropertyUtil.freeSelect(name, propTitle, propDescription, required, defaultValue, selectValues));
        return this;
    }
869220
function createGettersAndSetters() {
        var editor = EditorManager.getActiveEditor();
        if (!editor) {
            return;
        }
        initializeRefactoringSession(editor);

        var startIndex = current.startIndex,
            endIndex = current.endIndex,
            selectedText = current.selectedText;

        if (selectedText.length >= 1) {
            var selectionDetails = RefactoringUtils.normalizeText(selectedText, startIndex, endIndex);
            selectedText = selectionDetails.text;
            startIndex = selectionDetails.start;
            endIndex = selectionDetails.end;
        }

        var token = TokenUtils.getTokenAt(current.cm, current.cm.posFromIndex(endIndex)),
            commaString = ",",
            isLastNode,
            templateParams,
            parentNode,
            propertyEndPos;

        //Create getters and setters only if selected reference is a property
        if (token.type !== "property") {
            current.editor.displayErrorMessageAtCursor(Strings.ERROR_GETTERS_SETTERS);
            return;
        }

        parentNode = current.getParentNode(current.ast, endIndex);
        // Check if selected propery is child of a object expression
        if (!parentNode || !parentNode.properties) {
            current.editor.displayErrorMessageAtCursor(Strings.ERROR_GETTERS_SETTERS);
            return;
        }


        var propertyNodeArray = parentNode.properties;
        // Find the last Propery Node before endIndex
        var properyNodeIndex = propertyNodeArray.findIndex(function (element) {
            return (endIndex >= element.start && endIndex < element.end);
        });

        var propertyNode = propertyNodeArray[properyNodeIndex];

        //Get Current Selected Property End Index;
        propertyEndPos = editor.posFromIndex(propertyNode.end);


        //We have to add ',' so we need to find position of current property selected
        isLastNode = current.isLastNodeInScope(current.ast, endIndex);
        var nextPropertNode, nextPropertyStartPos;
        if(!isLastNode && properyNodeIndex + 1 <= propertyNodeArray.length - 1) {
            nextPropertNode = propertyNodeArray[properyNodeIndex + 1];
            nextPropertyStartPos = editor.posFromIndex(nextPropertNode.start);

            if(propertyEndPos.line !== nextPropertyStartPos.line) {
                propertyEndPos = current.lineEndPosition(current.startPos.line);
            } else {
                propertyEndPos = nextPropertyStartPos;
                commaString = ", ";
            }
        }

        var getSetPos;
        if (isLastNode) {
            getSetPos = current.document.adjustPosForChange(propertyEndPos, commaString.split("\n"),
                                                            propertyEndPos, propertyEndPos);
        } else {
            getSetPos = propertyEndPos;
        }
        templateParams = {
            "getName": token.string,
            "setName": token.string,
            "tokenName": token.string
        };

        // Replace, setSelection, IndentLine
        // We need to call batchOperation as indentLine don't have option to add origin as like replaceRange
        current.document.batchOperation(function() {
            if (isLastNode) {
                //Add ',' in the end of current line
                current.document.replaceRange(commaString, propertyEndPos, propertyEndPos);
            }

            current.editor.setSelection(getSetPos); //Selection on line end

            // Add getters and setters for given token using template at current cursor position
            current.replaceTextFromTemplate(GETTERS_SETTERS, templateParams);

            if (!isLastNode) {
                // Add ',' at the end setter
                current.document.replaceRange(commaString, current.editor.getSelection().start, current.editor.getSelection().start);
            }
        });
    }
570993
function buildPropertyPaths(oObject, sObjectName) {
				Object.keys(oObject).forEach(function (sProperty) {
					var sPropertyPath = _Helper.buildPath(sObjectName, sProperty),
						vPropertyValue = oObject[sProperty];

					if (sProperty === "@$ui5._") {
						return; // ignore private namespace
					}

					if (vPropertyValue !== null && typeof vPropertyValue === "object") {
						buildPropertyPaths(vPropertyValue, sPropertyPath);
					} else {
						aSelect.push(sPropertyPath);
					}
				});
			}
1034199
private UiSelector buildSelector(int selectorId, Object selectorValue) {
        if (selectorId == SELECTOR_CHILD || selectorId == SELECTOR_PARENT) {
            throw new UnsupportedOperationException();
//            selector.getLastSubSelector().mSelectorAttributes.put(selectorId, selectorValue);
        } else {
            this.mSelectorAttributes.put(selectorId, selectorValue);
        }
        return this;
    }
286263
public static PropertyBuilder builder(final Property orig) {
        return new PropertyBuilder()
            .name(orig.getName())
            .defaultValue(orig.getDefaultValue())
            .required(orig.isRequired())
            .type(orig.getType())
            .description(orig.getDescription())
            .title(orig.getTitle())
            .values(orig.getSelectValues())
            .labels(orig.getSelectLabels())
            .validator(orig.getValidator())
            .scope(orig.getScope())
            .renderingOptions(orig.getRenderingOptions())
            ;
    }
537343
function(source, propertyName)
	{
		if (!conbo.isAccessor(source, propertyName) && !conbo.isFunc(source, propertyName))
		{
			if (source instanceof conbo.EventDispatcher)
			{
				conbo.makeBindable(source, [propertyName]);
			}
			else
			{
				conbo.warn('It will not be possible to detect changes to "'+propertyName+'" because "'+source.toString()+'" is not an EventDispatcher');
			}
		}
	}
488888
String buildSelect(String htmlAttributes, SelectOptions options) {

        return buildSelect(htmlAttributes, options.getOptions(), options.getValues(), options.getSelectedIndex());
    }
1179781
void onSelectAllChange(Boolean value) {

        for (Object id : m_selectionContainer.getItemIds()) {
            m_selectionContainer.getItem(id).getItemProperty(PROP_SELECTED).setValue(value);
        }
    }
92310
function(options) {
		PropertyWidget.apply(this, arguments);
		SettingsTextfield.apply(this, arguments);
		if (this.node && options.indent) {
			var spans = this.node.getElementsByTagName('span');
			if (spans) {
				var span = spans[0];
				var existingClassName = span.className;
				if (existingClassName) {
					span.className += " setting-indent";
				} else {
					span.className = "setting-indent";
				}
			}
		}
	}
1026445
private void buildUI() {

		// Attribute select:
		attributeSelect = new SelectItem("attributeItem");
		attributeSelect.setWidth(140);
		attributeSelect.setShowTitle(false);
		attributeSelect.setValueMap(org.geomajas.gwt.client.widget.attribute.AttributeCriterionPane.
				getSearchableAttributes(layer));
		attributeSelect.setHint(I18nProvider.getSearch().gridChooseAttribute());
		attributeSelect.setShowHintInField(true);

		attributeSelect.setValidateOnChange(true);
		attributeSelect.setShowErrorStyle(true);
		attributeSelect.setRequired(true);

		// Operator select:
		operatorSelect = new SelectItem("operatorItem");
		operatorSelect.setDisabled(true);
		operatorSelect.setWidth(140);
		operatorSelect.setShowTitle(false);

		operatorSelect.setValidateOnChange(true);
		operatorSelect.setShowErrorStyle(true);
		operatorSelect.setRequired(true);

		// Value form item:
		valueItem = new AttributeFormItem("valueItem");
		valueItem.setShowTitle(false);
		valueItem.setDisabled(true);
		valueItem.setWidth(150);

		// Mechanisms:
		attributeSelect.addChangedHandler(new ChangedHandler() {
			public void onChanged(ChangedEvent event) {
				attributeChanged();
			}
		});

		// Finalize:
		DynamicForm form = new DynamicForm();
		form.setNumCols(6);
		form.setHeight(26);
		form.setFields(attributeSelect, operatorSelect, valueItem);
		addChild(form);
	}
60431
private SelectorBuilderImpl multipleValuePredicate(String field, String[] propertyValues,
      PredicateOperator operator) {
    if (propertyValues == null) {
      return this;
    }

    Predicate predicate = new Predicate();
    predicate.setOperator(operator);
    predicate.setField(field);

    String[] values = Arrays.copyOf(propertyValues, propertyValues.length);

    predicate.setValues(values);

    this.predicates.add(predicate);

    return this;
  }
433233
public static void setPropertyValue(BeanDefinitionBuilder builder, String propertyValue, String propertyName) {
        if (StringUtils.hasText(propertyValue)) {
            builder.addPropertyValue(propertyName, propertyValue);
        }
    }
315045
function createSelectorsManager() {
    var selectors = {};

    return {
        addSelector: addSelector,
        executeSelector: executeSelector
    };

    /*
     * Add a selector that matches source keys that start with the
     * specified prefix.
     *
     * @param {string} prefix
     * @param {function} [selector] The selector for the specified prefix.
     * @return {function} The selector for the specified prefix.
     */
    function addSelector(prefix, selector) {
        if (selector !== undefined) {
            selectors[prefix] = selector;
        }
        return selectors[prefix];
    }

    /*
     * Checks whether the source key matches one of the existing selectors.
     * If it does, the selector's handler is invoked on the source key.
     *
     * @param {object} source The source object.
     * @param {string} sourceKey The source object key.
     * @param {string} targetKey The target object key.
     * @param {object} sourceKeys The keys of the source properties to merge.
     * @param {object} overrideKeys
     *    The keys of the source properties to not report an error if the
     *    property already exists in the target object.
     */
    function executeSelector(source, sourceKey, targetKey,
        sourceKeys, overrideKeys) {

        for (var prefix in selectors) {
            // sourceKey starts with selector's prefix
            if (sourceKey.indexOf(prefix) === 0) {

                // Remove prefix from source key.
                sourceKey = sourceKey.substring(prefix.length);

                // Execute the selector's handler.
                selectors[prefix]({
                    source: source,
                    sourceKey: sourceKey,
                    targetKey: targetKey ? targetKey : sourceKey,
                    sourceKeys: sourceKeys,
                    overrideKeys: overrideKeys
                });

                return true;
            }
        }
        return false;
    }
}
600407
function overrideSelector(selectorContext) {
    selectorContext.overrideKeys[selectorContext.sourceKey] = true;
    selectorContext.sourceKeys[selectorContext.sourceKey] = selectorContext.targetKey;
}
635321
void select(String key) {
        Property hit = null;
        for (Property property : dataProvider.getList()) {
            if (property.getName().equals(key)) {
                hit = property;
                break;
            }
        }
        if (hit != null) {
            selectionModel.setSelected(hit, true);
        } else {
            table.selectDefaultEntity();
        }
    }