Revision 37780 branches/v2_0_0_prep/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.impl/src/main/java/org/gvsig/exportto/swing/impl/panel/ExportFiltersListModel.java
ExportFiltersListModel.java | ||
---|---|---|
32 | 32 |
import org.gvsig.exportto.ExporttoManager; |
33 | 33 |
import org.gvsig.exportto.swing.impl.DefaultJExporttoServicePanel; |
34 | 34 |
|
35 |
|
|
36 | 35 |
/** |
37 | 36 |
* @author gvSIG Team |
38 | 37 |
* @version $Id$ |
39 |
* |
|
38 |
*
|
|
40 | 39 |
*/ |
41 |
public class ExportFiltersListModel implements ListModel{ |
|
42 |
private static final ExporttoManager EXPORTTO_MANAGER = ExporttoLocator.getManager(); |
|
40 |
public class ExportFiltersListModel implements ListModel { |
|
41 |
|
|
42 |
private static final ExporttoManager EXPORTTO_MANAGER = ExporttoLocator |
|
43 |
.getManager(); |
|
43 | 44 |
@SuppressWarnings("rawtypes") |
44 | 45 |
private List filters = null; |
45 | 46 |
protected DefaultJExporttoServicePanel exporttoServicePanel = null; |
46 |
|
|
47 |
|
|
47 | 48 |
@SuppressWarnings({ "rawtypes", "unchecked" }) |
48 |
public ExportFiltersListModel(DefaultJExporttoServicePanel exporttoServicePanel) { |
|
49 |
super(); |
|
49 |
public ExportFiltersListModel( |
|
50 |
DefaultJExporttoServicePanel exporttoServicePanel) { |
|
51 |
super(); |
|
50 | 52 |
this.exporttoServicePanel = exporttoServicePanel; |
51 | 53 |
filters = new ArrayList(); |
52 | 54 |
Iterator it = EXPORTTO_MANAGER.getPredefinedFilters(); |
53 |
while(it.hasNext()){
|
|
54 |
filters.add(new Filter((String)it.next())); |
|
55 |
while (it.hasNext()) {
|
|
56 |
filters.add(new Filter((String) it.next()));
|
|
55 | 57 |
} |
56 | 58 |
} |
57 | 59 |
|
58 |
public int getSize() {
|
|
60 |
public int getSize() { |
|
59 | 61 |
return filters.size(); |
60 | 62 |
} |
61 | 63 |
|
62 |
public Object getElementAt(int index) {
|
|
64 |
public Object getElementAt(int index) { |
|
63 | 65 |
return filters.get(index); |
64 | 66 |
} |
65 | 67 |
|
... | ... | |
72 | 74 |
// TODO Auto-generated method stub |
73 | 75 |
|
74 | 76 |
} |
75 |
|
|
76 |
class Filter{ |
|
77 |
|
|
78 |
class Filter { |
|
79 |
|
|
77 | 80 |
private String filterKey; |
78 | 81 |
private String filterTanslation; |
79 |
|
|
82 |
|
|
80 | 83 |
public Filter(String filterKey) { |
81 | 84 |
super(); |
82 | 85 |
this.filterKey = filterKey; |
83 |
this.filterTanslation = exporttoServicePanel.getExporttoSwingManager().getTranslation(filterKey); |
|
86 |
this.filterTanslation = |
|
87 |
exporttoServicePanel.getExporttoSwingManager().getTranslation( |
|
88 |
filterKey); |
|
84 | 89 |
} |
85 |
|
|
90 |
|
|
86 | 91 |
/** |
87 | 92 |
* @return the filterKey |
88 | 93 |
*/ |
89 | 94 |
public String getFilterKey() { |
90 | 95 |
return filterKey; |
91 | 96 |
} |
92 |
|
|
93 |
public String toString(){ |
|
97 |
|
|
98 |
public String toString() {
|
|
94 | 99 |
return filterTanslation; |
95 | 100 |
} |
96 |
|
|
97 |
|
|
101 |
|
|
98 | 102 |
} |
99 | 103 |
|
100 | 104 |
} |
Also available in: Unified diff