src/main/java/de/blau/android/presets/Preset.java
/**
     * Add a PresetItem to the Presets indices
     * 
     * @param currentItem the item
     */
Add a PresetItem to the Presets indices

@param currentItem the item
Add a PresetItem to the Presets indices @param currentItem the item
void addToIndices(@NonNull PresetItem currentItem) {
        final StringWithDescription dummy = new StringWithDescription("");
        for (Entry<String, PresetField> e : currentItem.getFields().entrySet()) {
            PresetField field = e.getValue();
            String key = e.getKey();
            if (field instanceof PresetCheckGroupField) {
                for (PresetCheckField check : ((PresetCheckGroupField) field).getCheckFields()) {
                    String checkKey = check.getKey();
                    addToTagItems(checkKey, currentItem);
                    if (isObjectKey(checkKey)) {
                        addToObjectItems(key, currentItem);
                    }
                    addToAutosuggest(currentItem, checkKey, dummy);
                }
            } else {
                addToTagItems(key, currentItem);
                if (field instanceof PresetFixedField) {
                    addToTagItems(key, ((PresetFixedField) field).getValue(), currentItem);
                    addToObjectItems(key, (PresetFixedField) field, currentItem);
                    addToAutosuggest(currentItem, key, ((PresetFixedField) field).getValue());
                } else {
                    boolean isObjectKey = isObjectKey(key);
                    if (isObjectKey) {
                        addToObjectItems(key, currentItem);
                    }
                    if (field instanceof PresetComboField) {
                        StringWithDescription[] values = ((PresetComboField) field).getValues();
                        if (values != null) {
                            for (StringWithDescription v : values) {
                                String value = "";
                                if (v != null && v.getValue() != null) {
                                    value = v.getValue();
                                }
                                addToTagItems(key, value, currentItem);
                                if (isObjectKey) {
                                    addToObjectItems(key, value, currentItem);
                                }
                            }
                            addToAutosuggest(currentItem, key, values);
                        }
                    } else { 
                        addToAutosuggest(currentItem, key, dummy);
                    }
                }
            }
        }
    }
void addToIndices ( @ NonNull PresetItem currentItem ) { final StringWithDescription dummy = new StringWithDescription ( "" ) ; for ( Entry < String , PresetField > e : currentItem . getFields ( ) . entrySet ( ) ) { PresetField field = e . getValue ( ) ; String key = e . getKey ( ) ; if ( field instanceof PresetCheckGroupField ) { for ( PresetCheckField check : ( ( PresetCheckGroupField ) field ) . getCheckFields ( ) ) { String checkKey = check . getKey ( ) ; addToTagItems ( checkKey , currentItem ) ; if ( isObjectKey ( checkKey ) ) { addToObjectItems ( key , currentItem ) ; } addToAutosuggest ( currentItem , checkKey , dummy ) ; } } else { addToTagItems ( key , currentItem ) ; if ( field instanceof PresetFixedField ) { addToTagItems ( key , ( ( PresetFixedField ) field ) . getValue ( ) , currentItem ) ; addToObjectItems ( key , ( PresetFixedField ) field , currentItem ) ; addToAutosuggest ( currentItem , key , ( ( PresetFixedField ) field ) . getValue ( ) ) ; } else { boolean isObjectKey = isObjectKey ( key ) ; if ( isObjectKey ) { addToObjectItems ( key , currentItem ) ; } if ( field instanceof PresetComboField ) { StringWithDescription [ ] values = ( ( PresetComboField ) field ) . getValues ( ) ; if ( values != null ) { for ( StringWithDescription v : values ) { String value = "" ; if ( v != null && v . getValue ( ) != null ) { value = v . getValue ( ) ; } addToTagItems ( key , value , currentItem ) ; if ( isObjectKey ) { addToObjectItems ( key , value , currentItem ) ; } } addToAutosuggest ( currentItem , key , values ) ; } } else { addToAutosuggest ( currentItem , key , dummy ) ; } } } } }
Add a PresetItem to the Presets indices
Add a PresetItem to the Presets indices
// text fields and anything else