Revision 44304 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/ViewManager.java
ViewManager.java | ||
---|---|---|
52 | 52 |
import org.gvsig.app.project.documents.view.gui.DefaultViewPanel; |
53 | 53 |
import org.gvsig.app.project.documents.view.gui.ViewProperties; |
54 | 54 |
import org.gvsig.app.project.documents.view.toc.AbstractActionInfoAdapterToTocContextMenuAction; |
55 |
import org.gvsig.fmap.dal.AbstractStoresRepository; |
|
55 | 56 |
import org.gvsig.fmap.dal.DALLocator; |
56 | 57 |
import org.gvsig.fmap.dal.DataManager; |
57 | 58 |
import org.gvsig.fmap.dal.DataStore; |
... | ... | |
86 | 87 |
|
87 | 88 |
private static final Logger LOGGER = LoggerFactory.getLogger(ViewManager.class); |
88 | 89 |
|
89 |
private static class ViewDocumentStoresRepository implements UnmodifiableBasicMap<String, DataStoreParameters> {
|
|
90 |
private static class ViewDocumentStoresRepository extends AbstractStoresRepository {
|
|
90 | 91 |
|
92 |
public ViewDocumentStoresRepository(String name) { |
|
93 |
super(name); |
|
94 |
} |
|
95 |
|
|
91 | 96 |
private Map<String, DataStoreParameters> getAll(Predicate<DataStore> filter, int limit) { |
92 | 97 |
Map<String, DataStoreParameters> all = new HashMap<>(); |
93 | 98 |
Project project = ProjectManager.getInstance().getCurrentProject(); |
... | ... | |
120 | 125 |
} |
121 | 126 |
|
122 | 127 |
@Override |
123 |
public DataStoreParameters get(final String name) {
|
|
128 |
protected DataStoreParameters getMyParameters(final String name) {
|
|
124 | 129 |
Map<String, DataStoreParameters> all = this.getAll(new Predicate<DataStore>() { |
125 | 130 |
@Override |
126 | 131 |
public boolean test(DataStore t) { |
... | ... | |
148 | 153 |
} |
149 | 154 |
|
150 | 155 |
@Override |
151 |
public UnmodifiableBasicSet<String> keySet() {
|
|
156 |
protected UnmodifiableBasicSet<String> getMyKeySet() {
|
|
152 | 157 |
Map<String, DataStoreParameters> all = this.getAll(null, 0); |
153 | 158 |
if (all == null) { |
154 | 159 |
return null; |
... | ... | |
157 | 162 |
} |
158 | 163 |
|
159 | 164 |
@Override |
160 |
public Map<String, DataStoreParameters> toMap() { |
|
161 |
Map<String, DataStoreParameters> all = this.getAll(null, 0); |
|
162 |
return all; |
|
163 |
} |
|
164 |
|
|
165 |
@Override |
|
166 |
public boolean isEmpty() { |
|
165 |
protected boolean isEmptyMyRepository() { |
|
167 | 166 |
Map<String, DataStoreParameters> all = this.getAll(null, 1); |
168 | 167 |
return all.isEmpty(); |
169 | 168 |
} |
170 | 169 |
|
171 | 170 |
@Override |
172 |
public int size() {
|
|
171 |
protected int getMySize() {
|
|
173 | 172 |
Map<String, DataStoreParameters> all = this.getAll(null, 0); |
174 | 173 |
return all.size(); |
175 | 174 |
} |
... | ... | |
182 | 181 |
|
183 | 182 |
public static void selfRegister() { |
184 | 183 |
DataManager dataManager = DALLocator.getDataManager(); |
185 |
dataManager.addStoresRepository("ViewDocuments", new ViewDocumentStoresRepository());
|
|
184 |
dataManager.getStoresRepository().addRepository(new ViewDocumentStoresRepository("Layers"));
|
|
186 | 185 |
} |
187 | 186 |
} |
188 | 187 |
private static final String PERSISTENCE_VIEW_DOCUMENT_DEFINITION_NAME |
Also available in: Unified diff