Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.swing / org.gvsig.fmap.dal.swing.impl / src / main / java / org / gvsig / featureform / swing / impl / DefaultFeaturesFormContext.java @ 46010

History | View | Annotate | Download (1.69 KB)

1
package org.gvsig.featureform.swing.impl;
2

    
3
import org.gvsig.expressionevaluator.ExpressionEvaluatorLocator;
4
import org.gvsig.featureform.swing.FeaturesFormContext;
5
import org.gvsig.featureform.swing.JFeaturesForm;
6
import org.gvsig.fmap.dal.StoresRepository;
7
import org.gvsig.fmap.dal.exception.DataException;
8
import org.gvsig.fmap.dal.feature.Feature;
9
import org.gvsig.fmap.dal.feature.FeatureStore;
10
import org.gvsig.fmap.dal.feature.FeatureType;
11
import org.gvsig.tools.resourcesstorage.ResourcesStorage;
12
import org.gvsig.tools.script.ScriptManager;
13

    
14
/**
15
 *
16
 * @author gvSIG Team
17
 */
18
public class DefaultFeaturesFormContext implements FeaturesFormContext {
19

    
20
    private final FeatureStore store;
21

    
22
    public DefaultFeaturesFormContext(FeatureStore store) {
23
        this.store = store;
24
    }
25

    
26
    @Override
27
    public FeatureStore getFeatureStore() {
28
        return store;
29
    }
30

    
31
    @Override
32
    public FeatureType getFeatureType() {
33
        try {
34
            return store.getDefaultFeatureType();
35
        } catch (DataException ex) {
36
            return null;
37
        }
38
    }
39

    
40
    @Override
41
    public ResourcesStorage getResourcesStorage() {
42
        if (store == null) {
43
            return null;
44
        }
45
        return store.getResourcesStorage();
46
    }
47

    
48
    @Override
49
    public StoresRepository getStoresRepository() {
50
        if (store == null) {
51
            return null;
52
        }
53
        return store.getStoresRepository();
54
    }
55

    
56
    @Override
57
    public ScriptManager getScriptManager() {
58
        return ExpressionEvaluatorLocator.getExpressionEvaluatorManager();
59
    }
60

    
61
    public JFeaturesForm getFeaturesForm() {
62
        return null;
63
    }
64

    
65
    public Feature getCurrentFeature() {    
66
        return null;
67
    }
68
}