- Timestamp:
- 2018-06-18T00:43:12+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/history
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialogManager.java
r12678 r13947 64 64 private final Predicate<PrimitiveId> notNewPredicate = p -> !p.isNew(); 65 65 66 private static final List<HistoryHook> hooks = new ArrayList<>(); 67 66 68 protected HistoryBrowserDialogManager() { 67 69 dialogs = new HashMap<>(); … … 194 196 195 197 /** 198 * Adds a new {@code HistoryHook}. 199 * @param hook hook to add 200 * @return <tt>true</tt> (as specified by {@link Collection#add}) 201 * @since 13947 202 */ 203 public static boolean addHistoryHook(HistoryHook hook) { 204 return hooks.add(Objects.requireNonNull(hook)); 205 } 206 207 /** 208 * Removes an existing {@code HistoryHook}. 209 * @param hook hook to remove 210 * @return <tt>true</tt> if this list contained the specified element 211 * @since 13947 212 */ 213 public static boolean removeHistoryHook(HistoryHook hook) { 214 return hooks.remove(Objects.requireNonNull(hook)); 215 } 216 217 /** 196 218 * Show history dialog(s) for the given primitive(s). 197 219 * @param primitives The primitive(s) for which history will be displayed 198 220 */ 199 221 public void showHistory(final Collection<? extends PrimitiveId> primitives) { 222 hooks.forEach(h -> h.modifyRequestedIds(primitives)); 200 223 final Collection<? extends PrimitiveId> notNewPrimitives = SubclassFilteredCollection.filter(primitives, notNewPredicate); 201 224 if (notNewPrimitives.isEmpty()) {
Note:
See TracChangeset
for help on using the changeset viewer.