/** * Enables automatic completion for the given JTextComponent based on the * items contained in the given <tt>List</tt>. * @param items contains the items that are used for autocompletion * @param textComponent the text component that will be used for automatic * completion. * @param strictMatching <tt>true</tt>, if only given items should be allowed to be entered * @param stringConverter the converter used to transform items to strings */ public static void decorate(JTextComponent textComponent, List<?> items, boolean strictMatching, ObjectToStringConverter stringConverter) { AbstractAutoCompleteAdaptor adaptor = new TextComponentAdaptor(textComponent, items); AutoCompleteDocument document = createAutoCompleteDocument(adaptor, strictMatching, stringConverter, textComponent.getDocument()); decorate(textComponent, document, adaptor); }
/** * Enables automatic completion for the given JTextComponent based on the * items contained in the given <tt>List</tt>. * @param items contains the items that are used for autocompletion * @param textComponent the text component that will be used for automatic * completion. * @param strictMatching <tt>true</tt>, if only given items should be allowed to be entered * @param stringConverter the converter used to transform items to strings */ public static void decorate(JTextComponent textComponent, List<?> items, boolean strictMatching, ObjectToStringConverter stringConverter) { AbstractAutoCompleteAdaptor adaptor = new TextComponentAdaptor(textComponent, items); AutoCompleteDocument document = createAutoCompleteDocument(adaptor, strictMatching, stringConverter, textComponent.getDocument()); decorate(textComponent, document, adaptor); }
/** * Enables automatic completion for the given JTextComponent based on the * items contained in the given <tt>List</tt>. * @param items contains the items that are used for autocompletion * @param textComponent the text component that will be used for automatic * completion. * @param strictMatching <tt>true</tt>, if only given items should be allowed to be entered * @param stringConverter the converter used to transform items to strings */ public static void decorate(JTextComponent textComponent, List<?> items, boolean strictMatching, ObjectToStringConverter stringConverter) { AbstractAutoCompleteAdaptor adaptor = new TextComponentAdaptor(textComponent, items); AutoCompleteDocument document = createAutoCompleteDocument(adaptor, strictMatching, stringConverter, textComponent.getDocument()); decorate(textComponent, document, adaptor); }