Skip to content

Package: TrackSelectedEventPublisherFileEntitySelectable

TrackSelectedEventPublisherFileEntitySelectable

nameinstructionbranchcomplexitylinemethod
lambda$select$0(GeoTrackProvider)
M: 10 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
select()
M: 13 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
static {...}
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: package it.tidalwave.bluemarine3.geoexplorer.impl;
2:
3: import jakarta.annotation.Nonnull;
4: import it.tidalwave.dam.model.io.FileEntity;
5: import it.tidalwave.dam.ui.message.EntitySelectedEvent;
6: import it.tidalwave.geo.GeoTrack;
7: import it.tidalwave.ui.core.role.Selectable;
8: import it.tidalwave.dci.annotation.DciRole;
9: import it.tidalwave.messagebus.MessageBus;
10: import lombok.RequiredArgsConstructor;
11: import lombok.extern.slf4j.Slf4j;
12: import static it.tidalwave.geo.GeoTrackProvider._GeoTrackProvider_;
13:
14: /***************************************************************************************************************************************************************
15: *
16: * A {@link Selectable} role for {@link FileEntity} that publishes {@link EntitySelectedEvent}s if the owners have the {@link it.tidalwave.geo.GeoTrackProvider}
17: * role.
18: *
19: * @author Fabrizio Giudici
20: *
21: **************************************************************************************************************************************************************/
22: // FIXME: add dcicontext
23: @RequiredArgsConstructor @DciRole(datumType = FileEntity.class) @Slf4j
24: public class TrackSelectedEventPublisherFileEntitySelectable implements Selectable
25: {
26: @Nonnull
27: private final FileEntity file;
28:
29: @Nonnull
30: private final MessageBus messageBus;
31:
32: @Override
33: public void select()
34: {
35: log.debug("selected {}", file);
36: file.maybeAs(_GeoTrackProvider_).ifPresent(gtp -> messageBus.publish(EntitySelectedEvent.of(file, GeoTrack.class, gtp.getTrackSupplier())));
37: }
38: }