Ignore:
Timestamp:
2021-08-24T02:43:50+02:00 (3 years ago)
Author:
Don-vip
Message:

fix #20690 - fix #21240 - Refactoring of UploadDialog, HistoryComboBox and AutoCompletingComboBox (patch by marcello)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/search/SearchSetting.java

    r13887 r18173  
    77
    88import org.openstreetmap.josm.tools.Logging;
     9import org.openstreetmap.josm.tools.Utils;
    910
    1011/**
     
    5051    @Override
    5152    public String toString() {
     53        return Utils.shortenString(text,
     54            org.openstreetmap.josm.actions.search.SearchAction.MAX_LENGTH_SEARCH_EXPRESSION_DISPLAY);
     55    }
     56
     57    /**
     58     * A more talkative version of toString.
     59     * @return a bit more info than toString
     60     * @since 18173
     61     */
     62    public String toStringEx() {
    5263        String cs = caseSensitive ?
    5364                /*case sensitive*/  trc("search", "CS") :
     
    140151
    141152    /**
     153     * Build a SearchSetting from a plain unformatted string.
     154     * <p>
     155     * All attributes are defaulted, only the search string is set. This function is used in
     156     * {@link org.openstreetmap.josm.gui.download.OverpassQueryWizardDialog}.
     157     *
     158     * @param s The string
     159     * @return The instance
     160     * @since 18173
     161     */
     162    public static SearchSetting fromString(String s) {
     163        if (s.isEmpty())
     164            return null;
     165        SearchSetting result = new SearchSetting();
     166        result.text = s;
     167        return result;
     168    }
     169
     170    /**
    142171     * Builds a string representation of the {@code SearchSetting} object,
    143172     * see {@link #readFromString(String)} for more details.
Note: See TracChangeset for help on using the changeset viewer.