Changeset 4714 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2011-12-26T22:20:52+01:00 (13 years ago)
Author:
bastiK
Message:

change wording for ImageRequest builder (see #7182)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/ImageRequest.java

    r4712 r4714  
    1717 * or in funky double-brace style
    1818 *
    19  * ImageIcon icon = new ImageProvider.Request(){{name=imgName; width=100; height=120;}}.get();
     19 * ImageIcon icon = new ImageRequest(){{name=imgName; width=100; height=120;}}.get();
    2020 */
    2121public class ImageRequest {
     
    3030    protected int maxHeight = -1;
    3131    protected boolean sanitize;
    32     protected boolean required = true;
     32    protected boolean optional;
    3333
    3434    public ImageRequest setDirs(Collection<String> dirs) {
     
    8282    }
    8383
    84     public ImageRequest setRequired(boolean required) {
    85         this.required = required;
     84    public ImageRequest setOptional(boolean optional) {
     85        this.optional = optional;
    8686        return this;
    8787    }
     
    9090        ImageResource ir = ImageProvider.getIfAvailableImpl(dirs, id, subdir, name, archive);
    9191        if (ir == null) {
    92             if (required) {
     92            if (!optional) {
    9393                String ext = name.indexOf('.') != -1 ? "" : ".???";
    9494                throw new RuntimeException(tr("Fatal: failed to locate image ''{0}''. This is a serious configuration problem. JOSM will stop working.", name + ext));
Note: See TracChangeset for help on using the changeset viewer.