Package org.openstreetmap.josm.gui.tagging.ac

Examples of org.openstreetmap.josm.gui.tagging.ac.AutoCompletionListItem


        }

        private final void build(String initialText, final ActionListener listener) {
            input = new JosmTextField(30);
            cbInput = new HistoryComboBox();
            cbInput.setPrototypeDisplayValue(new AutoCompletionListItem("xxxx"));
            cbInput.setEditor(new BasicComboBoxEditor() {
                @Override
                protected JosmTextField createEditorComponent() {
                    return input;
                }
View Full Code Here


                +"<br><br>"+tr("Please select a key")), GBC.eol().fill(GBC.HORIZONTAL));

            AutoCompletionManager autocomplete = Main.main.getEditLayer().data.getAutoCompletionManager();
            List<AutoCompletionListItem> keyList = autocomplete.getKeys();

            AutoCompletionListItem itemToSelect = null;
            // remove the object's tag keys from the list
            Iterator<AutoCompletionListItem> iter = keyList.iterator();
            while (iter.hasNext()) {
                AutoCompletionListItem item = iter.next();
                if (item.getValue().equals(lastAddKey)) {
                    itemToSelect = item;
                }
                for (int i = 0; i < tagData.getRowCount(); ++i) {
                    if (item.getValue().equals(tagData.getValueAt(i, 0))) {
                        if (itemToSelect == item) {
                            itemToSelect = null;
                        }
                        iter.remove();
                        break;
View Full Code Here

    public ComboBoxHistory(int size) {
        maxSize = size;
    }

    public void addElement(String s) {
        addElement(new AutoCompletionListItem(s));
    }
View Full Code Here

    }

    public void setItemsAsString(List<String> items) {
        removeAllElements();
        for (int i = items.size()-1; i>=0; i--) {
            addElement(new AutoCompletionListItem(items.get(i)));
        }
    }
View Full Code Here

TOP

Related Classes of org.openstreetmap.josm.gui.tagging.ac.AutoCompletionListItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.