Statistics
| Revision:

gvsig-projects-pool / org.gvsig.vcsgis / trunk / org.gvsig.vcsgis / org.gvsig.vcsgis.swing / org.gvsig.vcsgis.swing.impl / src / main / java / org / gvsig / vcsgis / swing / impl / VCSGisEntitySelectorController.java @ 3365

History | View | Annotate | Download (2.85 KB)

1
/*
2
 * gvSIG. Desktop Geographic Information System.
3
 * 
4
 * Copyright (C) 2007-2020 gvSIG Association.
5
 * 
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 * 
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 * 
16
 * You should have received a copy of the GNU General Public License 
17
 * along with this program. If not, see <https://www.gnu.org/licenses/>. 
18
 * 
19
 * For any additional information, do not hesitate to contact us
20
 * at info AT gvsig.com, or visit our website www.gvsig.com.
21
 */
22
package org.gvsig.vcsgis.swing.impl;
23

    
24
import java.util.List;
25
import java.util.function.Predicate;
26
import javax.swing.JButton;
27
import javax.swing.JList;
28
import javax.swing.JTextField;
29
import javax.swing.ListSelectionModel;
30
import org.gvsig.tools.swing.api.ActionListenerSupport;
31
import org.gvsig.tools.swing.api.ChangeListenerSupport;
32
import org.gvsig.vcsgis.lib.VCSGisEntity;
33
import org.gvsig.vcsgis.lib.workspace.VCSGisWorkspace;
34
import org.gvsig.vcsgis.lib.workspace.VCSGisWorkspaceEntity;
35

    
36
/**
37
 *
38
 * @author gvSIG Team
39
 */
40
public interface VCSGisEntitySelectorController extends ActionListenerSupport, ChangeListenerSupport { //, ListSelectionListenerSupport {
41

    
42
    public static Predicate<VCSGisEntity> ALL_ENTITIES = (VCSGisEntity t) -> true;
43
    public static Predicate<VCSGisEntity> REMOTE_ENTITIES = (VCSGisEntity t) -> !(t instanceof VCSGisWorkspaceEntity);
44
    public static Predicate<VCSGisEntity> LOCAL_ENTITIES = (VCSGisEntity t) -> (t instanceof VCSGisWorkspaceEntity);
45
   
46
    public static VCSGisEntitySelectorController create(JList lstTables, JTextField txtFilter, JButton btnTable) {
47
        return new VCSGisEntitySelectorControllerImpl(lstTables, txtFilter, btnTable);
48
    }
49
    
50
    public static VCSGisEntitySelectorController create(JList lstTables) {
51
        return new VCSGisEntitySelectorControllerImpl(lstTables, null, null);
52
    }
53
    
54
    public VCSGisEntity getSelectedEntity();
55

    
56
    public List<VCSGisEntity> getCheckedEntities();
57

    
58
    public VCSGisWorkspace getWorkspace();
59

    
60
    public boolean isProcessing();
61
    
62
    public void setChecksEnabled(boolean enabled);
63
    
64
    public boolean isChecksEnabled();
65
    
66
    public void setEnabled(boolean enabled);
67

    
68
    public boolean isEnabled();
69
    
70
    public void setWorkspace(VCSGisWorkspace workspace);
71
    
72
    public void setViewFilter(Predicate<VCSGisEntity> viewFilter);
73

    
74
    public void setFilter(Predicate<VCSGisEntity> filter);
75
    
76
    public ListSelectionModel getCheckedModel();
77

    
78
    public void check(VCSGisEntity entity);
79
    
80
}