Changeset 4877
- Timestamp:
- 04/02/14 11:45:24 (10 years ago)
- Location:
- vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/ResourceLinksPanel.java
r4872 r4877 17 17 package eu.clarin.cmdi.vlo.wicket.panels.record; 18 18 19 import eu.clarin.cmdi.vlo. pojo.ResourceInfo;19 import eu.clarin.cmdi.vlo.wicket.model.ResourceInfoModel; 20 20 import eu.clarin.cmdi.vlo.service.ResourceStringConverter; 21 21 import eu.clarin.cmdi.vlo.wicket.model.CollectionListModel; … … 32 32 import org.apache.wicket.markup.html.panel.Panel; 33 33 import org.apache.wicket.model.IModel; 34 import org.apache.wicket.model.LoadableDetachableModel;35 34 import org.apache.wicket.model.PropertyModel; 36 35 import org.apache.wicket.model.StringResourceModel; … … 79 78 @Override 80 79 protected void populateItem(ListItem<String> item) { 81 final ResourceInfoModel resourceInfoModel = new ResourceInfoModel( item.getModel());80 final ResourceInfoModel resourceInfoModel = new ResourceInfoModel(resourceStringConverter, item.getModel()); 82 81 // add a link that will show the resource details panel when clicked 83 82 item.add(createLink(resourceInfoModel)); … … 112 111 } 113 112 114 /**115 * Model for {@link ResourceInfo} that dynamically instantiates its objects116 * from a resource string (as retrieved from the Solr index) using the117 * {@link ResourceStringConverter}118 */119 private class ResourceInfoModel extends LoadableDetachableModel<ResourceInfo> {120 121 private final IModel<String> resourceStringModel;122 123 public ResourceInfoModel(IModel<String> resourceStringModel) {124 this.resourceStringModel = resourceStringModel;125 }126 127 @Override128 protected ResourceInfo load() {129 return resourceStringConverter.getResourceInfo(resourceStringModel.getObject());130 }131 132 @Override133 public void detach() {134 super.detach();135 resourceStringModel.detach();136 }137 138 }139 140 113 }
Note: See TracChangeset
for help on using the changeset viewer.