Revision 37761

View differences:

tags/v2_0_0_Build_2043/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app/distribution/distribution.xml
1
<assembly>
2
</assembly>
tags/v2_0_0_Build_2043/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app/buildNumber.properties
1
#maven.buildNumber.plugin properties file
2
#Thu Jan 12 18:41:15 CET 2012
3
buildNumber=9
tags/v2_0_0_Build_2043/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app/.project
1
<?xml version="1.0" encoding="UTF-8"?>
2
<projectDescription>
3
	<name>org.gvsig.app.document.table.app</name>
4
	<comment></comment>
5
	<projects>
6
	</projects>
7
	<buildSpec>
8
	</buildSpec>
9
	<natures>
10
	</natures>
11
</projectDescription>
tags/v2_0_0_Build_2043/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/distribution/distribution.xml
1
<assembly>
2
	<id>distribution</id>
3
	<formats>
4
		<format>dir</format>
5
	</formats>
6
	<fileSets>
7
		<!-- Estructure for the extension -->
8
		<fileSet>
9
			<directory>src/main/resources</directory>
10
			<outputDirectory>${extension.install.dir.name}
11
			</outputDirectory>
12
		</fileSet>
13
	</fileSets>
14
    <files>
15
        <file>
16
            <source>package.info</source>
17
            <outputDirectory>${extension.install.dir.name}</outputDirectory>
18
        </file>
19
    </files>
20
	<dependencySets>
21
		<dependencySet>
22
			<outputDirectory>${extension.install.dir.name}/${library-dir}
23
			</outputDirectory>
24
			<includes>
25
				<include>org.gvsig:org.gvsig.app.document.table.app.mainplugin</include>
26
			</includes>
27
		</dependencySet>
28
	</dependencySets>
29
</assembly>
tags/v2_0_0_Build_2043/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/buildNumber.properties
1
#maven.buildNumber.plugin properties file
2
#Thu Jan 12 18:41:16 CET 2012
3
buildNumber=9
tags/v2_0_0_Build_2043/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/test/resources/README.txt
1
Put into this folder the resources needed by your test classes.
2

  
3
This folder is added to the Tests classpath, so you can load any resources 
4
through the ClassLoader.
5

  
6
By default, in this folder you can find an example of log4j configuration,
7
prepared to log messages through the console, so logging works when you
8
run your tests classes.
tags/v2_0_0_Build_2043/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/test/resources/log4j.xml
1
<?xml version="1.0" encoding="ISO-8859-1" ?>
2
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
3

  
4
<!-- 
5
Log4J configuration file for unit tests execution.
6
 -->
7
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
8

  
9
	<!-- Appender configuration to show logging messages through the console -->
10
	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
11
		<layout class="org.apache.log4j.PatternLayout">
12
			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
13
		</layout>
14
	</appender>
15

  
16
	<!-- 
17
	Activate logging messages of DEBUG level of higher only for the
18
	org.gvsig.tools packages.
19
	You can put full classes names or packages instead, to configure
20
	logging for all the classes and subpackages of the package.
21
	-->
22
	<category name="org.gvsig.tools">
23
		<priority value="DEBUG" />
24
	</category>
25
	<category name="org.gvsig.app.document.table">
26
		<priority value="DEBUG" />
27
	</category>
28

  
29
	<!-- 
30
	By default, show only logging messages of INFO level or higher, 
31
	through the previously configured CONSOLE appender. 
32
	-->
33
	<root>
34
		<priority value="INFO" />
35
		<appender-ref ref="CONSOLE" />
36
	</root>
37
</log4j:configuration>
tags/v2_0_0_Build_2043/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/resources/config.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
	<libraries library-dir="lib"/>
4
    <depends plugin-name="org.gvsig.app" />
5
	<resourceBundle name="text"/>
6
    <extensions>
7
		<extension class-name="org.gvsig.app.extension.TableExtension"
8
			description="Extensi?n encargada de a?adir soporte a documentos tabla."
9
			active="true"
10
			priority="10">
11

  
12
			<menu text="Tabla"
13
				position="400"
14
				is_separator="true"/>
15
				
16
		</extension>
17

  
18
		<extension class-name="org.gvsig.app.extension.ClearSelectionExtension"
19
			description="Extensi?n encargada de limpiar la selecci?n."
20
			active="true">
21
			<menu text="Capa/clear_selection" position="35010" action-command="DEL_SELECTION" icon="view-clear-selection"/>
22
			<tool-bar name="Tools_Select" position="6">
23
				<action-tool icon="view-clear-selection" action-command="DEL_SELECTION"  tooltip="clear_selection" position="4"/>
24
			</tool-bar>
25
		</extension>
26

  
27
		<extension class-name="org.gvsig.app.extension.ShowTable"
28
			description="Extensi?n encargada de abrir la tabla asociada a la capa seleccionado."
29
			active="true">
30
			<menu text="Capa/ver_tabla_atributos" position="35020" icon="layer-show-attribute-table"/>
31
			<tool-bar name="Acciones" position="13">
32
				<action-tool icon="layer-show-attribute-table"
33
					enableText="Un_Layer"
34
					tooltip="Muestra_atributos" position="1"/>
35
			</tool-bar>
36
		</extension>
37

  
38
		<extension class-name="org.gvsig.app.extension.TableOperations"
39
			description="Extensi?n encargada de gestionar las operaciones sobre las tablas."
40
			active="true">
41
			<menu text="Tabla/link" position="40010" icon="table-link" action-command="LINK"/>
42
			<tool-bar name="Herramientas" position="12">
43
				<action-tool icon="table-link" action-command="LINK" tooltip="link" position="2"/>
44
			</tool-bar>
45
		</extension>
46

  
47
		<extension class-name="org.gvsig.app.extension.RedoTableExtension"
48
			description="Extensi?n encargada de rehacer la edici?n sobre la capa activa."
49
			active="true">
50
			<menu text="Tabla/rehacer" position="40014" action-command="REDO" icon="table-redo"/>
51
			<tool-bar name="modificar" position="12">
52
				<action-tool name="rehacer" icon="table-redo" action-command="REDO" tooltip="rehacer" group="tabla" position="2"/>
53
			</tool-bar>
54
		</extension>
55

  
56
		<extension class-name="org.gvsig.app.extension.UndoTableExtension"
57
			description="Extensi?n encargada de dehacer la edici?n sobre la capa activa."
58
			active="true">
59
			<menu text="Tabla/deshacer" position="40016" action-command="UNDO" icon="table-undo"/>
60
			<tool-bar name="modificar" position="12">
61
				<action-tool name="deshacer" icon="table-undo" action-command="UNDO" tooltip="deshacer" group="tabla" position="1"/>
62
			</tool-bar>
63
		</extension>
64

  
65
		<extension class-name="org.gvsig.app.extension.TableEditStopExtension"
66
			description="Extensi?n encargada de gestionar las operaciones de edici?n sobre las tablas."
67
			active="true">
68
			<menu text="Tabla/stop_edition" position="40020" action-command="STOPEDITING"/>
69
		</extension>
70
		<extension class-name="org.gvsig.app.extension.TableEditStartExtension"
71
			description="Extensi?n encargada de gestionar las operaciones de edici?n sobre las tablas."
72
			active="true">
73
			<menu text="Tabla/start_edition" position="40024" action-command="STARTEDIT"/>
74
		</extension>
75
		<extension class-name="org.gvsig.app.extension.TableEditInsertExtension"
76
			description="Extensi?n encargada de gestionar las operaciones de edici?n sobre las tablas."
77
			active="true">
78
			<menu text="Tabla/insert_row" position="40026" action-command="INSERTROW"/>
79
		</extension>
80
		<extension class-name="org.gvsig.app.extension.TableEditRemoveRowExtension"
81
			description="Extensi?n encargada de gestionar las operaciones de edici?n sobre las tablas."
82
			active="true">
83
			<menu text="Tabla/remove_row" position="40030" action-command="REMOVEROW"/>
84
		</extension>
85
		<extension class-name="org.gvsig.app.extension.TableEditChangeColumnsExtension"
86
			description="Extensi?n encargada de gestionar las operaciones de edici?n de columnas sobre las tablas."
87
			active="true">
88
			<menu text="Tabla/add_column" position="40034" action-command="ADDCOLUMN"/>
89
			<menu text="Tabla/rename_column" position="40036" action-command="RENAMECOLUMN"/>
90
			<menu text="Tabla/remove_column" position="40040" action-command="REMOVECOLUMN"/>
91
		</extension>
92
		<extension class-name="org.gvsig.app.extension.TableEditAttributes"
93
			description="Extensi?n encargada de gestionar los campos de las tablas."
94
			active="true">
95
			<menu text="Tabla/manage_fields" position="40044" action-command="MANAGE_FIELDS"/>
96
		</extension>
97

  
98
		<extension class-name="org.gvsig.app.extension.TableEditCopyExtension"
99
			description="Extensi?n encargada de gestionar las operaciones de edici?n sobre las tablas."
100
			active="true">
101
			<menu text="Tabla/copy" position="40046" icon="edit-copy" action-command="COPY"/>
102
		</extension>
103

  
104
		<extension class-name="org.gvsig.app.extension.TableEditCutExtension"
105
			description="Extensi?n encargada de gestionar las operaciones de edici?n sobre las tablas."
106
			active="true">
107
			<menu text="Tabla/cut" position="40050" icon="edit-cut" action-command="CUT"/>
108
		</extension>
109

  
110
		<extension class-name="org.gvsig.app.extension.TableEditPasteExtension"
111
			description="Extensi?n encargada de gestionar las operaciones de edici?n sobre las tablas."
112
			active="true">
113
			<menu text="Tabla/paste" position="40054" icon="edit-paste" action-command="PASTE"/>
114
		</extension>
115

  
116
		<extension active="true" class-name="org.gvsig.app.extension.TableFieldOperations"
117
			description="Operaciones sobre los campos de las tablas">
118
			<menu text="Tabla/ascending_order" position="40056" icon="table-order-asc" action-command="ORDERASC"/>
119
			<menu text="Tabla/descending_order" position="40060" icon="table-order-desc" action-command="ORDERDESC"/>
120
			<tool-bar name="Herramientas" position="12">
121
				<action-tool icon="table-order-asc" tooltip="ascending_order_tooltip" action-command="ORDERASC" position="3"/>
122
				<action-tool icon="table-order-desc" tooltip="descending_order_tooltip" action-command="ORDERDESC" position="4"/>
123
			</tool-bar>
124
		</extension>
125

  
126
		<extension class-name="org.gvsig.app.extension.TableNumericFieldOperations"
127
			description="Extensi?n encargada de gestionar las operaciones sobre los campos num?ricos."
128
			active="true">
129
			<menu text="Tabla/statistics" position="40064" icon="table-statistics"/>
130
			<tool-bar name="Herramientas" position="12">
131
				<action-tool icon="table-statistics" tooltip="statistics" position="5"/>
132
			</tool-bar>
133
		</extension>
134

  
135
		<extension class-name="org.gvsig.app.extension.TableRowsOperations"
136
			description="Extensi?n encargada de gestionar la selecci?n en la tabla."
137
			active="true">
138
			<menu text="Tabla/selection_up" position="40066" action-command="SELECTIONUP" icon="table-selection-up"/>
139
			<menu text="Tabla/invert_selection" position="40070" action-command="INVERTSELECTION" icon="table-invert"/>
140
			<tool-bar name="Herramientas" position="12">
141
				<action-tool icon="table-selection-up" action-command="SELECTIONUP" tooltip="selection_up" position="6"/>
142
				<action-tool icon="table-invert" action-command="INVERTSELECTION" tooltip="invert_selection" position="7"/>
143
			</tool-bar>
144
		</extension>
145

  
146
		<extension class-name="org.gvsig.app.extension.RemoveTableLink"
147
			description="Extensi?n encargada de quitar los enlaces de las tablas."
148
			active="true">
149
			<menu text="Tabla/quitar_enlaces" position="40076" />
150
		</extension>
151

  
152
		<extension class-name="org.gvsig.app.extension.PrintTable"
153
			description="Extensi?n encargada de la impresi?n de las tablas."
154
			active="true">
155
			<menu text="Tabla/Imprimir" position="40080" icon="document-print" action-command="PRINTTABLE" tooltip="Imprimir"/>
156
			<tool-bar name="Tabla" position="10">
157
				<action-tool icon="document-print" action-command="PRINTTABLE" tooltip="Imprimir"/>
158
			</tool-bar>
159
		</extension>
160
        
161
        <extension class-name="org.gvsig.app.extension.ZoomToSelectExtension"
162
            description="Extensi?n encargada de gestionar los eventos realizados sobre una capa."
163
            active="true">
164
            <menu text="Vista/navegacion/Zoom_Select" position="3002090" action-command="ZOOM_SELECT" icon="view-zoom-to-seleccion"/>
165
            <tool-bar name="View_Tools_Zooms" position="3">
166
                <action-tool icon="view-zoom-to-seleccion" action-command="ZOOM_SELECT"  tooltip="Zoom_Select" position="7"/>
167
            </tool-bar>
168
        </extension>
169

  
170
        <extension class-name="org.gvsig.app.extension.FiltroExtension"
171
            description="Extensi?n encargada de abrir el di?logo para filtrar una tabla."
172
            active="true">
173
            <menu text="Tabla/filtro" position="40074" icon="table-filter" action-command="FILTRO"/>
174
            <tool-bar name="Herramientas" position="12">
175
                <action-tool icon="table-filter" action-command="FILTRO" tooltip="filtro" position="7"/>
176
            </tool-bar>
177
        </extension>
178

  
179
	</extensions>
180
	<icon src="gvsig-logo-icon" text="gvSIG"/>
181
</plugin-config>
tags/v2_0_0_Build_2043/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/java/org/gvsig/app/project/documents/table/FieldSelectionModel.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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 2
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, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
 * MA  02110-1301, USA.
20
 * 
21
 */
22
package org.gvsig.app.project.documents.table;
23

  
24
import java.util.ArrayList;
25
import java.util.Iterator;
26
import java.util.List;
27

  
28
import org.gvsig.fmap.dal.exception.DataException;
29
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
30
import org.gvsig.fmap.dal.feature.FeatureStore;
31
import org.gvsig.tools.dataTypes.DataTypes;
32
import org.gvsig.utils.swing.objectSelection.ObjectSelectionModel;
33
import org.gvsig.utils.swing.objectSelection.SelectionException;
34

  
35
/**
36
 * @author Fernando Gonz?lez Cort?s
37
 */
38
public class FieldSelectionModel implements ObjectSelectionModel {
39

  
40
    // final static private Logger logger =
41
    // LoggerFactory.getLogger(FieldSelectionModel.class);
42

  
43
    private FeatureStore fs;
44
    private String msg;
45
    private int type = DataTypes.INVALID;
46
    private boolean selectAll = false;
47

  
48
    /**
49
     * Crea un nuevo FirstFieldSelectionModel.
50
     * 
51
     */
52
    public FieldSelectionModel(FeatureStore fs, String msg, int type) {
53
        this.fs = fs;
54
        this.msg = msg;
55
        this.type = type;
56
    }
57

  
58
    public FieldSelectionModel(FeatureStore fs, String msg) {
59
        this(fs, msg, DataTypes.UNKNOWN);
60
        selectAll = true;
61
    }
62

  
63
    @SuppressWarnings("unchecked")
64
    public Object[] getObjects() throws SelectionException {
65

  
66
        List<String> fields = new ArrayList<String>();
67
        Iterator<FeatureAttributeDescriptor> iterator = null;
68
        try {
69
            iterator = fs.getDefaultFeatureType().iterator();
70
        } catch (DataException e) {
71
            throw new SelectionException(
72
                "Can't create iterator for the atribute of feature type", e);
73
        }
74
        while (iterator.hasNext()) {
75
            FeatureAttributeDescriptor descriptor = iterator.next();
76
            if (type != DataTypes.INVALID) {
77
                if ((descriptor.getType() == type) || selectAll) {
78
                    fields.add(descriptor.getName());
79
                }
80
            } else {
81
                fields.add(descriptor.getName());
82
            }
83
        }
84

  
85
        return (String[]) fields.toArray(new String[fields.size()]);
86
    }
87

  
88
    /**
89
     * @see org.gvsig.utils.swing.objectSelection.ObjectSelectionModel#getMsg()
90
     */
91
    public String getMsg() {
92
        return msg;
93
    }
94
}
tags/v2_0_0_Build_2043/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/java/org/gvsig/app/project/documents/table/TableOperations.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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 2
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, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
 * MA  02110-1301, USA.
20
 * 
21
 */
22
package org.gvsig.app.project.documents.table;
23

  
24
import java.awt.Component;
25
import java.text.ParseException;
26
import java.util.ArrayList;
27
import java.util.Iterator;
28

  
29
import javax.swing.JOptionPane;
30

  
31
import org.gvsig.andami.PluginServices;
32
import org.gvsig.andami.messages.NotificationManager;
33
import org.gvsig.app.project.documents.table.gui.CreateNewAttributePanel;
34
import org.gvsig.fmap.dal.DataTypes;
35
import org.gvsig.fmap.dal.exception.DataException;
36
import org.gvsig.fmap.dal.feature.EditableFeature;
37
import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor;
38
import org.gvsig.fmap.dal.feature.EditableFeatureType;
39
import org.gvsig.fmap.dal.feature.Feature;
40
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
41
import org.gvsig.fmap.dal.feature.FeatureSelection;
42
import org.gvsig.fmap.dal.feature.FeatureStore;
43
import org.gvsig.fmap.mapcontrol.dal.feature.swing.FeatureTable;
44
import org.gvsig.tools.dispose.DisposableIterator;
45

  
46
/**
47
 * Feature Table Operations.
48
 * 
49
 * @author Vicente Caballero Navarro
50
 * 
51
 */
52
public class TableOperations {
53

  
54
    public static final int MAX_FIELD_LENGTH = 254;
55
    private static TableOperations fto = null;
56
    private FeatureStore featureStore;
57
    private ArrayList<Feature> selectedFeatures = new ArrayList<Feature>();
58
    private boolean cutting = false;
59

  
60
    public static TableOperations getInstance() {
61
        if (fto == null) {
62
            fto = new TableOperations();
63
        }
64
        return fto;
65
    }
66

  
67
    public void setStore(FeatureStore store) {
68
        featureStore = store;
69
    }
70

  
71
    public void copyFeatures() throws DataException {
72
        cutting = false;
73
        copy();
74
    }
75

  
76
    public boolean hasSelection() {
77
        return !selectedFeatures.isEmpty();
78
    }
79

  
80
    public void pasteFeatures() throws DataException {
81
        if (cutting) {
82
            delete();
83
            cutting = false;
84
        }
85
        Iterator<Feature> features = selectedFeatures.iterator();
86
        while (features.hasNext()) {
87
            Feature feature = features.next();
88
            featureStore.insert(feature.getEditable());
89
        }
90
    }
91

  
92
    public void cutFeatures() throws DataException {
93
        cutting = true;
94
        copy();
95
    }
96

  
97
    private void copy() throws DataException {
98
        DisposableIterator features = null;
99
        try {
100
            features =
101
                ((FeatureSelection) featureStore.getSelection()).fastIterator();
102
            selectedFeatures.clear();
103
            while (features.hasNext()) {
104
                Feature feature = (Feature) features.next();
105
                selectedFeatures.add(feature);
106
            }
107
        } finally {
108
            if (features != null) {
109
                features.dispose();
110
            }
111
        }
112
    }
113

  
114
    private void delete() throws DataException {
115
        Iterator<Feature> features = selectedFeatures.iterator();
116
        while (features.hasNext()) {
117
            Feature feature = features.next();
118
            featureStore.delete(feature);
119
        }
120
    }
121

  
122
    public void deleteFeatures() throws DataException {
123
        DisposableIterator features = null;
124
        try {
125
            features =
126
                ((FeatureSelection) featureStore.getSelection()).fastIterator();
127
            while (features.hasNext()) {
128
                Feature feature = (Feature) features.next();
129
                featureStore.delete(feature);
130
            }
131
        } finally {
132
            if (features != null) {
133
                features.dispose();
134
            }
135
        }
136
    }
137

  
138
    public void insertNewFeature() throws DataException {
139
        // if (getModel().getAssociatedTable()!=null){
140
        // JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(),"No se puede a?adir una fila a una tabla asociada a una capa.");
141
        // return;
142
        // }
143
        EditableFeature feature = featureStore.createNewFeature();
144
        featureStore.insert(feature);
145
    }
146

  
147
    public void deleteAttributes(FeatureTable table) throws DataException {
148
        EditableFeatureType eft =
149
            featureStore.getDefaultFeatureType().getEditable();
150
        FeatureAttributeDescriptor[] selecteds =
151
            table.getSelectedColumnsAttributeDescriptor();
152
        for (int i = 0; i < selecteds.length; i++) {
153
            eft.remove(selecteds[i].getName());
154
        }
155
        featureStore.update(eft);
156
    }
157

  
158
    public void insertAttributes(FeatureTable table) throws DataException {
159
        EditableFeatureType eft =
160
            featureStore.getDefaultFeatureType().getEditable();
161

  
162
        try {
163
            CreateNewAttributePanel panelNewField =
164
                new CreateNewAttributePanel();
165

  
166
            EditableFeatureAttributeDescriptor ead =
167
                panelNewField.loadFieldDescription(eft);
168
            if (ead == null) {
169
                return;
170
            }
171
            if (ead.getType() == DataTypes.STRING
172
                && ead.getSize() > MAX_FIELD_LENGTH) {
173
                NotificationManager.showMessageInfo(
174
                    PluginServices.getText(this, "max_length_is") + ":"
175
                        + MAX_FIELD_LENGTH, null);
176
                ead.setSize(MAX_FIELD_LENGTH);
177
            }
178
            PluginServices.getMDIManager().closeWindow(panelNewField);
179
        } catch (ParseException e2) {
180
            NotificationManager.addError(e2);
181
        }
182
        featureStore.update(eft);
183

  
184
    }
185

  
186
    public void renameAttributes(FeatureTable table) throws DataException {
187
        EditableFeatureType eft =
188
            featureStore.getDefaultFeatureType().getEditable();
189
        FeatureAttributeDescriptor[] selecteds =
190
            table.getSelectedColumnsAttributeDescriptor();
191

  
192
        for (int i = selecteds.length - 1; i >= 0; i--) {
193
            String newName =
194
                JOptionPane.showInputDialog((Component) PluginServices
195
                    .getMDIManager().getActiveWindow(), PluginServices.getText(
196
                    this, "please_insert_new_field_name"), selecteds[i]
197
                    .getName());
198
            if (newName == null) {
199
                return;
200
            }
201
            if (eft.getIndex(newName) != -1) {
202
                NotificationManager.showMessageInfo(
203
                    PluginServices.getText(this, "field_already_exists"), null);
204
                return;
205
            }
206
            FeatureAttributeDescriptor ad =
207
                (FeatureAttributeDescriptor) eft.get(selecteds[i].getName());
208
            eft.remove(ad.getName());
209
            EditableFeatureAttributeDescriptor ead =
210
                eft.add(newName, ad.getType(), ad.getSize());
211
            ead.setPrecision(ad.getPrecision());
212
        }
213

  
214
        featureStore.update(eft);
215
    }
216

  
217
}
tags/v2_0_0_Build_2043/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/java/org/gvsig/app/project/documents/table/ExportStatisticsFile.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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 2
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, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
 * MA  02110-1301, USA.
20
 * 
21
 */
22
package org.gvsig.app.project.documents.table;
23

  
24
import java.awt.Component;
25
import java.io.File;
26
import java.io.FileWriter;
27
import java.io.IOException;
28
import java.util.Hashtable;
29
import java.util.Iterator;
30
import java.util.List;
31

  
32
import javax.swing.JFileChooser;
33
import javax.swing.JOptionPane;
34
import javax.swing.filechooser.FileFilter;
35

  
36
import org.slf4j.Logger;
37
import org.slf4j.LoggerFactory;
38

  
39
import org.gvsig.andami.PluginServices;
40
import org.gvsig.andami.messages.NotificationManager;
41
import org.gvsig.app.project.documents.table.gui.CSVSeparatorOptionsPanel;
42
import org.gvsig.app.project.documents.table.gui.Statistics.MyObjectStatistics;
43
import org.gvsig.fmap.dal.DALLocator;
44
import org.gvsig.fmap.dal.DataManager;
45
import org.gvsig.fmap.dal.DataTypes;
46
import org.gvsig.fmap.dal.exception.DataException;
47
import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
48
import org.gvsig.fmap.dal.feature.EditableFeature;
49
import org.gvsig.fmap.dal.feature.EditableFeatureType;
50
import org.gvsig.fmap.dal.feature.FeatureStore;
51
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters;
52
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer;
53

  
54
/**
55
 * Class to create dbf and csv files at disk with the statistics group generated
56
 * from a table.
57
 * 
58
 * dbf -> Data Base File
59
 * csv -> Comma Separated Value
60
 * 
61
 * @author ?ngel Fraile Gri??n e-mail: angel.fraile@iver.es
62
 * 
63
 */
64

  
65
public class ExportStatisticsFile {
66

  
67
    private static final Logger logger = LoggerFactory
68
        .getLogger(ExportStatisticsFile.class);
69

  
70
    private String lastPath = null;
71
    private Hashtable<String, MyFileFilter> dbfExtensionsSupported; // Supported
72
                                                                    // extensions.
73
    private Hashtable<String, MyFileFilter> csvExtensionsSupported;
74

  
75
    public ExportStatisticsFile(List<MyObjectStatistics> valores) {
76

  
77
        JFileChooser jfc = new JFileChooser(lastPath);
78
        jfc.removeChoosableFileFilter(jfc.getAcceptAllFileFilter());
79

  
80
        // Adding required extensions (dbf, csv)
81
        dbfExtensionsSupported = new Hashtable<String, MyFileFilter>();
82
        csvExtensionsSupported = new Hashtable<String, MyFileFilter>();
83
        dbfExtensionsSupported.put("dbf", new MyFileFilter("dbf",
84
            PluginServices.getText(this, "Ficheros_dbf"), "dbf"));
85
        csvExtensionsSupported.put("csv", new MyFileFilter("csv",
86
            PluginServices.getText(this, "Ficheros_csv"), "csv"));
87

  
88
        Iterator<MyFileFilter> iter =
89
            csvExtensionsSupported.values().iterator();
90
        while (iter.hasNext()) {
91
            jfc.addChoosableFileFilter(iter.next());
92
        }
93

  
94
        iter = dbfExtensionsSupported.values().iterator();
95
        while (iter.hasNext()) {
96
            jfc.addChoosableFileFilter(iter.next());
97
        }
98

  
99
        // Opening a JFileCooser
100
        if (jfc.showSaveDialog((Component) PluginServices.getMainFrame()) == JFileChooser.APPROVE_OPTION) {
101
            File endFile = jfc.getSelectedFile();
102
            if (endFile.exists()) {// File exists in the directory.
103
                int resp =
104
                    JOptionPane.showConfirmDialog(
105
                        (Component) PluginServices.getMainFrame(),
106
                        PluginServices.getText(this,
107
                            "fichero_ya_existe_seguro_desea_guardarlo")
108
                            + "\n"
109
                            + endFile.getAbsolutePath(), PluginServices
110
                            .getText(this, "guardar"),
111
                        JOptionPane.YES_NO_OPTION);// Informing the user
112
                if (resp != JOptionPane.YES_OPTION) {// cancel pressed.
113
                    return;
114
                }
115
            }// end if exits.
116
            MyFileFilter filter = (MyFileFilter) jfc.getFileFilter();// dbf, csv
117
            endFile = filter.normalizeExtension(endFile);// "name" + "." +
118
                                                         // "dbf", "name" + "."
119
                                                         // + "csv"
120

  
121
            if (filter.getExtensionOfAFile(endFile).toLowerCase()
122
                .compareTo("csv") == 0) { // csv file
123
                exportToCSVFile(valores, endFile); // export to csv format
124
            } else
125
                if (filter.getExtensionOfAFile(endFile).toLowerCase()
126
                    .compareTo("dbf") == 0) {// dbf file
127
                    try {
128
                        exportToDBFFile(valores, endFile);
129
                    } catch (Exception e) {
130
                        NotificationManager.addError(e);
131
                    } // export to dbf format
132
                }
133
        }// end if aprove option.
134
    }
135

  
136
    /**
137
     * Creating cvs format file with the statistics.
138
     * Option to select the two columns separator.
139
     * 
140
     * Example with semicolon: Name;data\n
141
     * Name2;data2\n
142
     * 
143
     * @param valores
144
     *            - Pairs: String name (key) + Double value (
145
     * @param endFile
146
     *            - File to write the information
147
     */
148

  
149
    private void exportToCSVFile(List<MyObjectStatistics> valores, File endFile) {
150

  
151
        try {
152
            CSVSeparatorOptionsPanel csvSeparatorOptions =
153
                new CSVSeparatorOptionsPanel();
154
            PluginServices.getMDIManager().addWindow(csvSeparatorOptions);
155

  
156
            String separator = csvSeparatorOptions.getSeparator();
157

  
158
            if (separator != null) {
159

  
160
                FileWriter fileCSV = new FileWriter(endFile);
161

  
162
                fileCSV.write(PluginServices.getText(this, "Nombre")
163
                    + separator + PluginServices.getText(this, "Valor") + "\n");
164

  
165
                Iterator<MyObjectStatistics> iterador = valores.listIterator();
166

  
167
                while (iterador.hasNext()) {// Writing value,value\n
168
                    MyObjectStatistics data = iterador.next();
169
                    fileCSV.write(data.getKey() + separator + (data.getValue())
170
                        + "\n");
171
                }
172
                fileCSV.close();
173
                JOptionPane.showMessageDialog(
174
                    null,
175
                    PluginServices.getText(this, "fichero_creado_en") + " "
176
                        + endFile.getAbsolutePath(),
177
                    PluginServices.getText(this, "fichero_creado_en_formato")
178
                        + " csv "
179
                        + PluginServices.getText(this, "mediante_el_separador")
180
                        + " \"" + separator + "\"",
181
                    JOptionPane.INFORMATION_MESSAGE);// Informing the user
182
            } else {
183
                return;
184
            }
185

  
186
        } catch (IOException e) {// Informing the user
187
            logger.error("Error exportando a formato csv");
188
            JOptionPane.showMessageDialog(
189
                null,
190
                PluginServices.getText(this,
191
                    "Error_exportando_las_estadisticas")
192
                    + " "
193
                    + endFile.getAbsolutePath(), PluginServices.getText(this,
194
                    "Error"), JOptionPane.ERROR_MESSAGE);
195
        }
196

  
197
    }
198

  
199
    public void exportToDBFFile(List<MyObjectStatistics> valores, File endFile)
200
        throws DataException, ValidateDataParametersException {
201
        DataManager datamanager = DALLocator.getDataManager();
202

  
203
        //
204
        // Averigua el proveedor en funcion del fichero
205
        // preguntandoselo al FilesystemServerExplorer.
206
        FilesystemServerExplorer explorer =
207
            (FilesystemServerExplorer) datamanager.openServerExplorer(
208
                FilesystemServerExplorer.NAME, null //
209
                );
210
        String providerName = explorer.getProviderName(endFile);
211

  
212
        try {
213
            NewFeatureStoreParameters parameters =
214
                (NewFeatureStoreParameters) datamanager
215
                    .createNewStoreParameters(FilesystemServerExplorer.NAME,
216
                        providerName);
217
            EditableFeatureType type =
218
                parameters.getDefaultFeatureType().getEditable();
219
            type.add(PluginServices.getText(this, "Nombre"), DataTypes.STRING,
220
                50);
221
            type.add(PluginServices.getText(this, "Valor"), DataTypes.DOUBLE,
222
                100).setPrecision(25);
223

  
224
            parameters.setDefaultFeatureType(type);
225
            datamanager.newStore(FilesystemServerExplorer.NAME, providerName,
226
                parameters, true);
227

  
228
            FeatureStore target =
229
                (FeatureStore) datamanager.openStore(providerName, parameters);
230
            target.edit(FeatureStore.MODE_APPEND);
231
            Iterator<MyObjectStatistics> iterador = valores.listIterator();
232
            while (iterador.hasNext()) {
233
                MyObjectStatistics data = iterador.next();
234
                EditableFeature ef = target.createNewFeature().getEditable();
235
                ef.set(PluginServices.getText(this, "Nombre"), data.getKey());
236
                ef.set(PluginServices.getText(this, "Valor"), data.getValue());
237
                target.insert(ef);
238
            }
239
            target.finishEditing();
240
            target.dispose();
241
            JOptionPane.showMessageDialog(
242
                (Component) PluginServices.getMainFrame(),
243
                PluginServices.getText(this, "fichero_creado_en") + " "
244
                    + endFile.getAbsolutePath(),
245
                PluginServices.getText(this, "fichero_creado_en_formato")
246
                    + " dbf", JOptionPane.INFORMATION_MESSAGE);// Informing the
247
                                                               // user
248
        } catch (Exception e) {
249
            e.printStackTrace();
250
        }
251
    }
252
}
253

  
254
/**
255
 * @author ?ngel Fraile Gri??n e-mail: angel.fraile@iver.es
256
 * 
257
 *         Class to work with the file extensions.
258
 */
259
class MyFileFilter extends FileFilter {
260

  
261
    private String[] extensiones = new String[1];
262
    private String description;
263
    private boolean dirs = true;
264
    private String info = null;
265

  
266
    public MyFileFilter(String[] ext, String desc) {
267
        extensiones = ext;
268
        description = desc;
269
    }
270

  
271
    public MyFileFilter(String[] ext, String desc, String info) {
272
        extensiones = ext;
273
        description = desc;
274
        this.info = info;
275
    }
276

  
277
    public MyFileFilter(String ext, String desc) {
278
        extensiones[0] = ext;
279
        description = desc;
280
    }
281

  
282
    public MyFileFilter(String ext, String desc, String info) {
283
        extensiones[0] = ext;
284
        description = desc;
285
        this.info = info;
286
    }
287

  
288
    public MyFileFilter(String ext, String desc, boolean dirs) {
289
        extensiones[0] = ext;
290
        description = desc;
291
        this.dirs = dirs;
292
    }
293

  
294
    public MyFileFilter(String ext, String desc, boolean dirs, String info) {
295
        extensiones[0] = ext;
296
        description = desc;
297
        this.dirs = dirs;
298
        this.info = info;
299
    }
300

  
301
    public boolean accept(File f) {
302
        if (f.isDirectory()) {
303
            if (dirs) {
304
                return true;
305
            } else {
306
                return false;
307
            }
308
        }
309
        for (int i = 0; i < extensiones.length; i++) {
310
            if (extensiones[i].equals("")) {
311
                continue;
312
            }
313
            if (getExtensionOfAFile(f).equalsIgnoreCase(extensiones[i])) {
314
                return true;
315
            }
316
        }
317
        return false;
318
    }
319

  
320
    public String getDescription() {
321
        return description;
322
    }
323

  
324
    public String[] getExtensions() {
325
        return extensiones;
326
    }
327

  
328
    public boolean isDirectory() {
329
        return dirs;
330
    }
331

  
332
    public String getExtensionOfAFile(File file) {
333
        String name;
334
        int dotPos;
335
        name = file.getName();
336
        dotPos = name.lastIndexOf(".");
337
        if (dotPos < 1) {
338
            return "";
339
        }
340
        return name.substring(dotPos + 1);
341
    }
342

  
343
    public File normalizeExtension(File file) {
344
        String ext = getExtensionOfAFile(file);
345
        if (ext.equals("") || !(this.accept(file))) {
346
            return new File(file.getAbsolutePath() + "." + extensiones[0]);
347
        }
348
        return file;
349
    }
350

  
351
    public String getInfo() {
352
        return this.info;
353
    }
354

  
355
    public void setInfo(String info) {
356
        this.info = info;
357
    }
358
}
tags/v2_0_0_Build_2043/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/java/org/gvsig/app/project/documents/table/TableSelectionModel.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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 2
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, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
 * MA  02110-1301, USA.
20
 * 
21
 */
22
package org.gvsig.app.project.documents.table;
23

  
24
import org.gvsig.utils.swing.objectSelection.ObjectSelectionModel;
25

  
26
/**
27
 * @author Fernando Gonz?lez Cort?s
28
 */
29
public class TableSelectionModel implements ObjectSelectionModel {
30

  
31
    private TableDocument[] tables;
32
    private String msg;
33

  
34
    public TableSelectionModel(TableDocument[] tables, String msg) {
35
        this.tables = tables;
36
        this.msg = msg;
37
    }
38

  
39
    /**
40
     * @see org.gvsig.app.project.documents.table.TableSelectionModel#getTables()
41
     */
42
    public Object[] getObjects() {
43
        return tables;
44
    }
45

  
46
    /**
47
     * @see org.gvsig.utils.swing.objectSelection.ObjectSelectionModel#getMsg()
48
     */
49
    public String getMsg() {
50
        return msg;
51
    }
52

  
53
}
tags/v2_0_0_Build_2043/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/java/org/gvsig/app/project/documents/table/package.html
1
<?xml version="1.0" encoding="UTF-8" ?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml">
4
<head>
5
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
<title>org.gvsig.landregistryviewer package documentation</title>
7
</head>
8
<body>
9

  
10
	<p>Table document support</p>
11

  
12
</body>
13
</html>
tags/v2_0_0_Build_2043/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/java/org/gvsig/app/project/documents/table/exceptions/TableEditingException.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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 2
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, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
 * MA  02110-1301, USA.
20
 * 
21
 */
22
package org.gvsig.app.project.documents.table.exceptions;
23

  
24
import org.gvsig.tools.exception.BaseException;
25

  
26
/**
27
 * @author gvSIG Team
28
 * @version $Id$
29
 */
30
public class TableEditingException extends BaseException {
31

  
32
    private static final long serialVersionUID = -3672330283934624242L;
33
    private static final String KEY = "error_editing_table";
34
    private static final String FORMAT = "Can't edit the table: %(table) ";
35

  
36
    public TableEditingException(String table, Throwable exception) {
37
        super(FORMAT, exception, KEY, serialVersionUID);
38
        setValue("table", table);
39
    }
40
}
tags/v2_0_0_Build_2043/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/java/org/gvsig/app/project/documents/table/exceptions/package.html
1
<?xml version="1.0" encoding="UTF-8" ?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml">
4
<head>
5
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
<title>org.gvsig.landregistryviewer package documentation</title>
7
</head>
8
<body>
9

  
10
	<p>Table document exceptions</p>
11

  
12
</body>
13
</html>
tags/v2_0_0_Build_2043/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/java/org/gvsig/app/project/documents/table/exceptions/CancelEditingTableException.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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 2
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, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
 * MA  02110-1301, USA.
20
 * 
21
 */
22
package org.gvsig.app.project.documents.table.exceptions;
23

  
24
/**
25
 * @author Vicente Caballero Navarro
26
 */
27
public class CancelEditingTableException extends TableEditingException {
28

  
29
    /**
30
	 * 
31
	 */
32
    private static final long serialVersionUID = 5231674331725098637L;
33

  
34
    public CancelEditingTableException(String table, Throwable exception) {
35
        super(table, exception);
36
        init();
37
        initCause(exception);
38
    }
39

  
40
    private void init() {
41
        messageKey = "error_cancel_editing_table";
42
        formatString = "Can�t cancel editing the table: %(table) ";
43
    }
44

  
45
}
tags/v2_0_0_Build_2043/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/java/org/gvsig/app/project/documents/table/exceptions/StopEditingTableException.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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 2
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, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
 * MA  02110-1301, USA.
20
 * 
21
 */
22
package org.gvsig.app.project.documents.table.exceptions;
23

  
24
/**
25
 * @author Vicente Caballero Navarro
26
 */
27
public class StopEditingTableException extends TableEditingException {
28

  
29
    /**
30
	 * 
31
	 */
32
    private static final long serialVersionUID = 1663393663065092896L;
33

  
34
    public StopEditingTableException(String table, Throwable exception) {
35
        super(table, exception);
36
        init();
37
        initCause(exception);
38
    }
39

  
40
    private void init() {
41
        messageKey = "error_stop_editing_table";
42
        formatString = "Can�t stop editing the table: %(table) ";
43
    }
44

  
45
}
tags/v2_0_0_Build_2043/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/java/org/gvsig/app/project/documents/table/exceptions/StartEditingTableException.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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 2
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, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
 * MA  02110-1301, USA.
20
 * 
21
 */
22
package org.gvsig.app.project.documents.table.exceptions;
23

  
24
/**
25
 * @author Vicente Caballero Navarro
26
 */
27
public class StartEditingTableException extends TableEditingException {
28

  
29
    /**
30
	 * 
31
	 */
32
    private static final long serialVersionUID = 8031152738000164873L;
33

  
34
    public StartEditingTableException(String table, Throwable exception) {
35
        super(table, exception);
36
        init();
37
        initCause(exception);
38
    }
39

  
40
    private void init() {
41
        messageKey = "error_start_editing_table";
42
        formatString = "Can�t start editing the table: %(table) ";
43
    }
44

  
45
}
tags/v2_0_0_Build_2043/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/java/org/gvsig/app/project/documents/table/TableManager.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff