View Javadoc
1   package org.argeo.connect.ui.widgets;
2   
3   import java.util.List;
4   
5   import javax.jcr.Session;
6   
7   import org.argeo.connect.resources.ResourcesService;
8   import org.eclipse.swt.widgets.Text;
9   
10  /**
11   * DropDown that displays the list of possible values for a property given a
12   * template ID and a propertyName a given node type business instance
13   */
14  public class TemplateCatalogueDropDown extends ConnectAbstractDropDown {
15  
16  	private final Session session;
17  	private final ResourcesService resourcesService;
18  	private final String templateId;
19  	private final String propertyName;
20  
21  	/**
22  	 * @param session
23  	 * @param resourceService
24  	 * @param templateId
25  	 * @param propertyName
26  	 * @param text
27  	 */
28  	public TemplateCatalogueDropDown(Session session, ResourcesService resourceService, String templateId,
29  			String propertyName, Text text) {
30  		super(text);
31  		this.resourcesService = resourceService;
32  		this.session = session;
33  		this.templateId = templateId;
34  		this.propertyName = propertyName;
35  		init();
36  	}
37  
38  	@Override
39  	protected List<String> getFilteredValues(String filter) {
40  		List<String> values = resourcesService.getTemplateCatalogue(session, templateId, propertyName, filter);
41  		return values;
42  	}
43  }