Statistics
| Revision:

gvsig-scripting / org.gvsig.scripting / trunk / org.gvsig.scripting / org.gvsig.scripting.app / org.gvsig.scripting.app.mainplugin / src / main / resources-plugin / scripting / lib / gvsig_2_3_0 / table.py @ 468

History | View | Annotate | Download (1.97 KB)

1

    
2

    
3

    
4
from org.gvsig.app.project.documents.table import TableDocument as JTableDocument
5

    
6
from org.gvsig.fmap.dal import DALLocator
7

    
8
def _features(self, filter = None, sortby="", asc=True):
9
  return self.getFeatureStore().features(filter,sortby,asc)
10

    
11
def _iter_features(self):
12
  return self.getFeatureStore().getFeatureSet().__iter__()
13

    
14
def _len_features(self):
15
  return self.getFeatureStore().getFeatureSet().getSize()
16

    
17
def _edit(self):
18
  self.getFeatureStore().edit() 
19
    
20
def _append(self, *valuesList, **values):
21
  self.getFeatureStore().append(*valuesList, **values)
22
  
23
def _updateSchema(self, schema):
24
  self.getFeatureStore().update(schema)
25
  
26
def _update(self, feature):
27
  self.getFeatureStore().update(feature)
28

    
29
def _getSchema(self):
30
  return self.getFeatureStore().getDefaultFeatureType()
31

    
32
def _commit(self):
33
  self.getFeatureStore().finishEditing()
34

    
35
def _abort(self):
36
  self.getFeatureStore().cancelEditing()
37

    
38
def _getSelection(self):
39
  return self.getFeatureStore().getFeatureSelection()
40
  
41
def _select(self, selection):
42
  self.getFeatureStore().getFeatureSelection().select(selection)
43

    
44
def _deselect(self, selection):
45
  self.getFeatureStore().getFeatureSelection().deselect(selection)
46

    
47
def _isSelected(feature):
48
  self.getFeatureStore().getFeatureSelection().isSelect(feature)
49

    
50

    
51

    
52
def _getFeatureStore(self):
53
  return self.getStore()
54

    
55
def _call(self):
56
  return self
57
    
58

    
59

    
60
#
61
# Inject new methods in the class JTableDocument
62
#
63
JTableDocument.getFeatureStore = _getFeatureStore
64
JTableDocument.__call__ = _iter_features
65
JTableDocument.__len__ = _len_features
66
JTableDocument.__call__ = _call
67
JTableDocument.features = _features
68
JTableDocument.edit = _edit
69
JTableDocument.append = _append
70
JTableDocument.updateSchema = _updateSchema
71
JTableDocument.update = _update
72
JTableDocument.getSchema = _getSchema
73
JTableDocument.commit = _commit
74
JTableDocument.abort = _abort
75
JTableDocument.getSelection = _getSelection
76
JTableDocument.select = _select
77
JTableDocument.deselect = _deselect
78
JTableDocument.isSelected = _isSelected
79