Project

General

Profile

« Previous | Next » 

Revision 3dd178b8

Added by Patrick Plitzner about 5 years ago

ref #8011 Implement filter by facets

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/search/term/FilterComposite.java
24 24
 */
25 25
public class FilterComposite extends Composite{
26 26
    private Button btnCheck;
27
    private String facet;
27
    private Facet facet;
28 28

  
29
    public FilterComposite(String facet, TermSearchController controller, Composite parent, int style) {
29
    public FilterComposite(Facet facet, TermSearchController controller, Composite parent, int style) {
30 30
        super(parent, style);
31 31
        this.facet = facet;
32 32
        GridDataFactory.fillDefaults().applyTo(this);
33 33
        setLayout(new GridLayout(2, false));
34 34

  
35
        Composite content = new Composite(this, SWT.NONE);
36
        GridDataFactory.fillDefaults().applyTo(content);
37
        content.setLayout(new GridLayout());
38

  
39
        Label label = new Label(content, SWT.NONE);
40
        label.setText(facet);
41
        GridDataFactory.fillDefaults().applyTo(label);
42

  
43 35
        btnCheck = new Button(this, SWT.CHECK);
44 36
        btnCheck.addSelectionListener(new SelectionAdapter() {
45 37
            @Override
......
47 39
                controller.applyFilter(FilterComposite.this);
48 40
            }
49 41
        });
42

  
43
        Composite content = new Composite(this, SWT.NONE);
44
        GridDataFactory.fillDefaults().applyTo(content);
45
        content.setLayout(new GridLayout());
46

  
47
        Label label = new Label(content, SWT.NONE);
48
        label.setText(facet.getFacet());
49
        GridDataFactory.fillDefaults().applyTo(label);
50

  
50 51
    }
51 52

  
52
    public Button getBtnCheck() {
53
        return btnCheck;
53
    public boolean isFilterActive() {
54
        return btnCheck.getSelection();
54 55
    }
55 56

  
56
    public String getFacet() {
57
    public Facet getFacet() {
57 58
        return facet;
58 59
    }
59 60

  

Also available in: Unified diff