Ignore:
Timestamp:
2017-09-11T20:43:41+02:00 (7 years ago)
Author:
Don-vip
Message:

see #15229 - see #15182 - make FileWatcher generic so it has no more dependence on MapCSS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/loader/MapPaintStyleLoader.java

    r12651 r12825  
    66import java.util.ArrayList;
    77import java.util.Collection;
     8import java.util.Collections;
    89import java.util.List;
    910
     11import org.openstreetmap.josm.data.preferences.sources.SourceEntry;
    1012import org.openstreetmap.josm.gui.MainApplication;
    1113import org.openstreetmap.josm.gui.PleaseWaitRunnable;
     
    6769        MainApplication.worker.submit(new MapPaintStyleLoader(toReload));
    6870    }
     71
     72    /**
     73     * Reload style.
     74     * @param style {@link StyleSource} to reload
     75     * @throws IllegalArgumentException if {@code style} is not a {@code StyleSource} instance
     76     * @since 12825
     77     */
     78    public static void reloadStyle(SourceEntry style) {
     79        if (style instanceof StyleSource) {
     80            MainApplication.worker.submit(new MapPaintStyleLoader(Collections.singleton((StyleSource) style)));
     81        } else {
     82            throw new IllegalArgumentException(style + " is not a StyleSource");
     83        }
     84    }
    6985}
Note: See TracChangeset for help on using the changeset viewer.