|
44 | 44 | import org.apache.causeway.applib.annotation.Where; |
45 | 45 | import org.apache.causeway.applib.jaxb.JavaTimeXMLGregorianCalendarMarshalling; |
46 | 46 | import org.apache.causeway.applib.services.bookmark.Bookmark; |
| 47 | +import org.apache.causeway.applib.services.bookmark.BookmarkService; |
47 | 48 | import org.apache.causeway.applib.services.command.CommandExecutorService.InteractionContextPolicy; |
48 | 49 | import org.apache.causeway.commons.functional.Try; |
49 | 50 | import org.apache.causeway.commons.internal.base._Refs.ObjectReference; |
|
63 | 64 | import org.springframework.transaction.annotation.Propagation; |
64 | 65 |
|
65 | 66 | import lombok.AllArgsConstructor; |
| 67 | +import lombok.RequiredArgsConstructor; |
66 | 68 | import lombok.Value; |
67 | 69 | import lombok.experimental.Accessors; |
68 | 70 |
|
@@ -216,14 +218,21 @@ public String getTargetId() { |
216 | 218 |
|
217 | 219 | @Action(semantics = SemanticsOf.SAFE) |
218 | 220 | @ActionLayout( |
219 | | - associateWith = "targetType", sequence = "1", |
220 | 221 | cssClassFa = "fa-bullseye" |
221 | 222 | ) |
222 | | - public Object openTarget() { |
223 | | - return commandLogEntry().map(CommandLogEntry::getTarget).orElse(null); |
224 | | - } |
225 | | - @MemberSupport public String disableOpenTarget() { |
226 | | - return commandLogEntry().isPresent() ? null : "Unknown target"; |
| 223 | + public class openTarget { |
| 224 | + |
| 225 | + @MemberSupport public Object act() { |
| 226 | + return commandLogEntry() |
| 227 | + .map(CommandLogEntry::getTarget) |
| 228 | + .flatMap(bookmark -> bookmarkService.lookup(bookmark)) |
| 229 | + .orElse(null); |
| 230 | + } |
| 231 | + @MemberSupport public String disableAct() { |
| 232 | + return commandLogEntry().isPresent() ? null : "Unknown target"; |
| 233 | + } |
| 234 | + |
| 235 | + @Inject BookmarkService bookmarkService; |
227 | 236 | } |
228 | 237 |
|
229 | 238 |
|
|
0 commit comments