<commit_before>/* 
@ITMillApache2LicenseForJavaFiles@
 */

package com.vaadin.ui;

import java.util.Collection;

import com.vaadin.data.Container;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;

/**
 * A filtering dropdown single-select. Suitable for newItemsAllowed, but it's
 * turned of by default to avoid mistakes. Items are filtered based on user
 * input, and loaded dynamically ("lazy-loading") from the server. You can turn
 * on newItemsAllowed and change filtering mode (and also turn it off), but you
 * can not turn on multi-select mode.
 * 
 */
@SuppressWarnings("serial")
public class ComboBox extends Select {

    private String inputPrompt = null;

    public ComboBox() {
        setMultiSelect(false);
        setNewItemsAllowed(false);
    }

    public ComboBox(String caption, Collection options) {
        super(caption, options);
        setMultiSelect(false);
        setNewItemsAllowed(false);
    }

    public ComboBox(String caption, Container dataSource) {
        super(caption, dataSource);
        setMultiSelect(false);
        setNewItemsAllowed(false);
    }

    public ComboBox(String caption) {
        super(caption);
        setMultiSelect(false);
        setNewItemsAllowed(false);
    }

    @Override
    public void setMultiSelect(boolean multiSelect) {
        if (multiSelect && !isMultiSelect()) {
            throw new UnsupportedOperationException("Multiselect not supported");
        }
        super.setMultiSelect(multiSelect);
    }

    /**
     * Gets the current input prompt.
     * 
     * @see #setInputPrompt(String)
     * @return the current input prompt, or null if not enabled
     */
    public String getInputPrompt() {
        return inputPrompt;
    }

    /**
     * Sets the input prompt - a textual prompt that is displayed when the
     * select would otherwise be empty, to prompt the user for input.
     * 
     * @param inputPrompt
     *            the desired input prompt, or null to disable
     */
    public void setInputPrompt(String inputPrompt) {
        this.inputPrompt = inputPrompt;
    }

    @Override
    public void paintContent(PaintTarget target) throws PaintException {
        if (inputPrompt != null) {
            target.addAttribute("prompt", inputPrompt);
        }
        super.paintContent(target);
    }

}
<commit_msg>added missing ClientWidget annotation<commit_after>/* 
@ITMillApache2LicenseForJavaFiles@
 */

package com.vaadin.ui;

import java.util.Collection;

import com.vaadin.data.Container;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.gwt.client.ui.VFilterSelect;

/**
 * A filtering dropdown single-select. Suitable for newItemsAllowed, but it's
 * turned of by default to avoid mistakes. Items are filtered based on user
 * input, and loaded dynamically ("lazy-loading") from the server. You can turn
 * on newItemsAllowed and change filtering mode (and also turn it off), but you
 * can not turn on multi-select mode.
 * 
 */
@SuppressWarnings("serial")
@ClientWidget(VFilterSelect.class)
public class ComboBox extends Select {

	private String inputPrompt = null;

	public ComboBox() {
		setMultiSelect(false);
		setNewItemsAllowed(false);
	}

	public ComboBox(String caption, Collection options) {
		super(caption, options);
		setMultiSelect(false);
		setNewItemsAllowed(false);
	}

	public ComboBox(String caption, Container dataSource) {
		super(caption, dataSource);
		setMultiSelect(false);
		setNewItemsAllowed(false);
	}

	public ComboBox(String caption) {
		super(caption);
		setMultiSelect(false);
		setNewItemsAllowed(false);
	}

	@Override
	public void setMultiSelect(boolean multiSelect) {
		if (multiSelect && !isMultiSelect()) {
			throw new UnsupportedOperationException("Multiselect not supported");
		}
		super.setMultiSelect(multiSelect);
	}

	/**
	 * Gets the current input prompt.
	 * 
	 * @see #setInputPrompt(String)
	 * @return the current input prompt, or null if not enabled
	 */
	public String getInputPrompt() {
		return inputPrompt;
	}

	/**
	 * Sets the input prompt - a textual prompt that is displayed when the
	 * select would otherwise be empty, to prompt the user for input.
	 * 
	 * @param inputPrompt
	 *            the desired input prompt, or null to disable
	 */
	public void setInputPrompt(String inputPrompt) {
		this.inputPrompt = inputPrompt;
	}

	@Override
	public void paintContent(PaintTarget target) throws PaintException {
		if (inputPrompt != null) {
			target.addAttribute("prompt", inputPrompt);
		}
		super.paintContent(target);
	}

}

{'fraction_non_alphanumeric': 0.08798328108672936, 'fraction_numerical': 0.0004179728317659352, 'mean_word_length': 2.948844884488449, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '2991261', 'n_tokens_mistral': 1434, 'n_tokens_neox': 1309, 'n_words': 386}