/** * Enables automatic completion for the given JTextComponent based on the * items contained in the given JList. The two components will be * synchronized. The automatic completion will always be strict. * @param list a <tt>JList</tt> containing the items for automatic completion * @param textComponent the text component that will be used for automatic * completion * @param stringConverter the converter used to transform items to strings */ public static void decorate(JList list, JTextComponent textComponent, ObjectToStringConverter stringConverter) { undecorate(list); AbstractAutoCompleteAdaptor adaptor = new ListAdaptor(list, textComponent, stringConverter); AutoCompleteDocument document = createAutoCompleteDocument(adaptor, true, stringConverter, textComponent.getDocument()); decorate(textComponent, document, adaptor); }
/** * Enables automatic completion for the given JTextComponent based on the * items contained in the given JList. The two components will be * synchronized. The automatic completion will always be strict. * @param list a <tt>JList</tt> containing the items for automatic completion * @param textComponent the text component that will be used for automatic * completion * @param stringConverter the converter used to transform items to strings */ public static void decorate(JList list, JTextComponent textComponent, ObjectToStringConverter stringConverter) { undecorate(list); AbstractAutoCompleteAdaptor adaptor = new ListAdaptor(list, textComponent, stringConverter); AutoCompleteDocument document = createAutoCompleteDocument(adaptor, true, stringConverter, textComponent.getDocument()); decorate(textComponent, document, adaptor); }
strictMatching = ((AutoCompleteDocument) textComponent.getDocument()).strictMatching; undecorate(textComponent);
strictMatching = ((AutoCompleteDocument) textComponent.getDocument()).strictMatching; undecorate(textComponent);
undecorate(editorComponent);
undecorate(editorComponent);
undecorate(textComponent);
undecorate(textComponent);
undecorate(comboBox);