- Timestamp:
- 2018-08-11T19:19:44+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r14125 r14128 77 77 /** 78 78 * The file watcher service. 79 */ 80 public static final FileWatcher fileWatcher = new FileWatcher(); 79 * @deprecated Use {@link FileWatcher#getDefaultInstance} 80 */ 81 @Deprecated 82 public static final FileWatcher fileWatcher = FileWatcher.getDefaultInstance(); 81 83 82 84 /** -
trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
r13810 r14128 29 29 import java.util.regex.Pattern; 30 30 31 import org.openstreetmap.josm.Main;32 31 import org.openstreetmap.josm.command.ChangePropertyCommand; 33 32 import org.openstreetmap.josm.command.ChangePropertyKeyCommand; … … 62 61 import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.TokenMgrError; 63 62 import org.openstreetmap.josm.io.CachedFile; 63 import org.openstreetmap.josm.io.FileWatcher; 64 64 import org.openstreetmap.josm.io.IllegalDataException; 65 65 import org.openstreetmap.josm.io.UTFInputStreamReader; … … 762 762 addMapCSS(i); 763 763 if (Config.getPref().getBoolean("validator.auto_reload_local_rules", true) && source.isLocal()) { 764 Main.fileWatcher.registerSource(source);764 FileWatcher.getDefaultInstance().registerSource(source); 765 765 } 766 766 } catch (IOException | IllegalStateException | IllegalArgumentException ex) { -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r14125 r14128 410 410 protected List<InitializationTask> beforeInitializationTasks() { 411 411 return Arrays.asList( 412 new InitializationTask(tr("Starting file watcher"), fileWatcher::start),412 new InitializationTask(tr("Starting file watcher"), FileWatcher.getDefaultInstance()::start), 413 413 new InitializationTask(tr("Executing platform startup hook"), () -> platform.startupHook(MainApplication::askUpdateJava)), 414 414 new InitializationTask(tr("Building main menu"), this::initializeMainWindow), -
trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
r13845 r14128 15 15 import javax.swing.SwingUtilities; 16 16 17 import org.openstreetmap.josm.Main;18 17 import org.openstreetmap.josm.data.coor.LatLon; 19 18 import org.openstreetmap.josm.data.osm.DataSet; … … 27 26 import org.openstreetmap.josm.gui.mappaint.styleelement.StyleElement; 28 27 import org.openstreetmap.josm.io.CachedFile; 28 import org.openstreetmap.josm.io.FileWatcher; 29 29 import org.openstreetmap.josm.spi.preferences.Config; 30 30 import org.openstreetmap.josm.tools.ImageProvider; … … 327 327 if (Config.getPref().getBoolean("mappaint.auto_reload_local_styles", true) && source.isLocal()) { 328 328 try { 329 Main.fileWatcher.registerSource(source);329 FileWatcher.getDefaultInstance().registerSource(source); 330 330 } catch (IOException | IllegalStateException | IllegalArgumentException e) { 331 331 Logging.error(e); -
trunk/src/org/openstreetmap/josm/io/FileWatcher.java
r13173 r14128 34 34 private static final Map<SourceType, Consumer<SourceEntry>> loaderMap = new EnumMap<>(SourceType.class); 35 35 private final Map<Path, SourceEntry> sourceMap = new HashMap<>(); 36 37 private static class InstanceHolder { 38 static final FileWatcher INSTANCE = new FileWatcher(); 39 } 40 41 /** 42 * Returns the default instance. 43 * @return the default instance 44 * @since 14128 45 */ 46 public static FileWatcher getDefaultInstance() { 47 return InstanceHolder.INSTANCE; 48 } 36 49 37 50 /**
Note:
See TracChangeset
for help on using the changeset viewer.