Changeset 4878


Ignore:
Timestamp:
04/02/14 12:37:13 (11 years ago)
Author:
Twan Goosen
Message:

extracted behaviour that sets the css class for a resource type (in resource links panel) into a separate class

Location:
vlo/branches/vlo-3.0/vlo-web-app/src/main
Files:
1 added
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/VloWicketApplication.java

    r4870 r4878  
    5858        // register the resource of field names (used by eu.clarin.cmdi.vlo.wicket.componentsSolrFieldNameLabel)
    5959        getResourceSettings().getStringResourceLoaders().add(new BundleStringResourceLoader("fieldNames"));
     60        // register the resource of resource type class properties
     61        getResourceSettings().getStringResourceLoaders().add(new BundleStringResourceLoader("resourceTypeClasses"));
    6062        // register the resource of application properties (version information filtered at build time)
    6163        getResourceSettings().getStringResourceLoaders().add(new BundleStringResourceLoader("application"));
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/ResourceLinksPanel.java

    r4877 r4878  
    1717package eu.clarin.cmdi.vlo.wicket.panels.record;
    1818
     19import eu.clarin.cmdi.vlo.service.ResourceStringConverter;
     20import eu.clarin.cmdi.vlo.wicket.ResourceTypeCssBehaviour;
     21import eu.clarin.cmdi.vlo.wicket.model.CollectionListModel;
    1922import eu.clarin.cmdi.vlo.wicket.model.ResourceInfoModel;
    20 import eu.clarin.cmdi.vlo.service.ResourceStringConverter;
    21 import eu.clarin.cmdi.vlo.wicket.model.CollectionListModel;
    2223import java.util.Collection;
    2324import java.util.List;
    2425import org.apache.wicket.ajax.AjaxRequestTarget;
    2526import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;
    26 import org.apache.wicket.behavior.AttributeAppender;
    2727import org.apache.wicket.markup.html.WebMarkupContainer;
    2828import org.apache.wicket.markup.html.basic.Label;
     
    3333import org.apache.wicket.model.IModel;
    3434import org.apache.wicket.model.PropertyModel;
    35 import org.apache.wicket.model.StringResourceModel;
    3635import org.apache.wicket.spring.injection.annot.SpringBean;
    3736
     
    101100            // set the file name as the link's text content
    102101            link.add(new Label("filename", new PropertyModel(resourceInfoModel, "fileName")));
    103 
    104             // set the class attribute on the link from the value associated
    105             // with the resource type as defined in the properties file
    106             final StringResourceModel linkClass = new StringResourceModel("class.${resourceType}", ResourceLinksPanel.this, resourceInfoModel, "");
    107             link.add(new AttributeAppender("class", linkClass).setSeparator(" "));
     102           
     103            // apply the css class matching the resource type
     104            link.add(new ResourceTypeCssBehaviour(resourceInfoModel));
    108105
    109106            return link;
Note: See TracChangeset for help on using the changeset viewer.