/** * 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 <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); }
final AutoCompleteDocument document = createAutoCompleteDocument(adaptor, strictMatching, stringConverter, editorComponent.getDocument()); decorate(editorComponent, document, adaptor); removeKeyListener(editorComponent); removePropertyChangeListener(comboBox);
undecorate(textComponent); installMap(editorInputMap, document.isStrictMatching()); break;
undecorate(editorComponent);
/** * 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 <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); }
undecorate(textComponent); installMap(editorInputMap, document.isStrictMatching()); break;
undecorate(editorComponent);
final int TEXT_FIELD_SIZE = 12; final JTextField jtf_key = new JTextField(TEXT_FIELD_SIZE); if(!keys.isEmpty()) {AutoCompleteDecorator.decorate(jtf_key, keys, false);} final JTextField jtf_value = new JTextField(TEXT_FIELD_SIZE); jl_key.setDisplayedMnemonic('k');
strictMatching = ((AutoCompleteDocument) textComponent.getDocument()).strictMatching; undecorate(textComponent); AutoCompleteDocument document = createAutoCompleteDocument(adaptor, strictMatching, acEditor.stringConverter, editorComponent.getDocument()); decorate(editorComponent, 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) { 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 <tt>List</tt>. * @param textComponent the text component that will be used for automatic * completion. * @param items contains the items that are used for autocompletion * @param strictMatching <tt>true</tt>, if only given items should be allowed to be entered */ public static void decorate(JTextComponent textComponent, List<?> items, boolean strictMatching) { decorate(textComponent, items, strictMatching, null); }
strictMatching = ((AutoCompleteDocument) textComponent.getDocument()).strictMatching; undecorate(textComponent); AutoCompleteDocument document = createAutoCompleteDocument(adaptor, strictMatching, acEditor.stringConverter, editorComponent.getDocument()); decorate(editorComponent, 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); }
/** * Ajout l'auto-complétion sur une liste déroulante, en utilisant le * converteur donné pour afficher les données. * * @param combo la combo à décorer * @param convertor le converter utilisé pour afficher les données. */ public static void decorate(JComboBox combo, ObjectToStringConverter convertor) { org.jdesktop.swingx.autocomplete.AutoCompleteDecorator.decorate(combo, convertor); }
undecorate(comboBox); final AutoCompleteDocument document = createAutoCompleteDocument(adaptor, strictMatching, stringConverter, editorComponent.getDocument()); decorate(editorComponent, 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 enabled for automatic * completion */ public static void decorate(JList list, JTextComponent textComponent) { decorate(list, textComponent, null); }
undecorate(comboBox); final AutoCompleteDocument document = createAutoCompleteDocument(adaptor, strictMatching, stringConverter, editorComponent.getDocument()); decorate(editorComponent, document, adaptor);