Statistics
| Revision:

gvsig-projects-pool / org.gvsig.online / trunk / org.gvsig.online / org.gvsig.online.swing / org.gvsig.online.swing.api / src / main / java / org / gvsig / online / swing / api / OnlineEntitySelectorController.java @ 9518

History | View | Annotate | Download (3.47 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.online.swing.api;
23

    
24
import java.util.Collection;
25
import java.util.List;
26
import java.util.function.Function;
27
import java.util.function.Predicate;
28
import org.gvsig.online.lib.api.workingcopy.OnlineEntity;
29
import org.gvsig.online.lib.api.workingcopy.OnlineWorkingcopy;
30
import org.gvsig.tools.swing.api.ActionListenerSupport;
31
import org.gvsig.tools.swing.api.ChangeListenerSupport;
32

    
33
/**
34
 *
35
 * @author gvSIG Team
36
 */
37
public interface OnlineEntitySelectorController extends ActionListenerSupport, ChangeListenerSupport { //, ListSelectionListenerSupport {
38

    
39
    public static Predicate<OnlineEntity> ALL_ENTITIES = (OnlineEntity t) -> true;
40
    public static Predicate<OnlineEntity> REMOTE_ENTITIES = (OnlineEntity t) -> !(t instanceof OnlineEntity);
41
    public static Predicate<OnlineEntity> LOCAL_ENTITIES = (OnlineEntity t) -> (t instanceof OnlineEntity);
42
   
43
    public static final int ACTION_SELECT_ID = 0;
44
    public static final int ACTION_CHECK_ID = 1;
45
    public static final int ACTION_RELOAD_ID = 2;
46
    public static final int ACTION_BEGIN_PROCESSING_ID = 3;
47
    public static final int ACTION_END_PROCESSING_ID = 4;
48
    
49
    public static final String ACTION_SELECT = "select";
50
    public static final String ACTION_CHECK = "check";
51
    public static final String ACTION_RELOAD = "reload";
52
    public static final String ACTION_BEGIN_PROCESSING = "begin_processing";
53
    public static final String ACTION_END_PROCESSING = "end_processing";
54
    
55
    public OnlineEntity getSelectedEntity();
56

    
57
    public void setSelectedEntity(OnlineEntity entity);
58

    
59
    public List<OnlineEntity> getCheckedEntities();
60

    
61
    public Collection<OnlineEntity> getEntities();
62

    
63
    public OnlineWorkingcopy getWorkspace();
64
    
65
    public void reloadEntities();
66

    
67
    public boolean isProcessing();
68
    
69
    public void setChecksEnabled(boolean enabled);
70
    
71
    public boolean isChecksEnabled();
72
    
73
    public void setEnabled(boolean enabled);
74

    
75
    public boolean isEnabled();
76
    
77
    public void setWorkspace(OnlineWorkingcopy workspace);
78
    
79
    public void setViewFilter(Predicate<OnlineEntity> viewFilter);
80

    
81
    public void setFilter(Predicate<OnlineEntity> filter);
82
    
83
    public void clearChecks();
84
    
85
    public void check(OnlineEntity entity);
86

    
87
    public void unCheck(OnlineEntity entity);
88
    
89
    public void setCheck(Collection<String> entityCodes, boolean check);
90

    
91
    public void checkAll();
92
    
93
    public void clear();
94
    
95
    public void setLabelEntityFormatter(Function<OnlineEntity,String> formatter);
96
    
97
    public String getCategory(OnlineEntity category);
98
    
99
    public void collapseAll();
100
    
101
    public void expandAll();
102
}