Revision 39255
tags/v2_0_0_Build_2058/extensions/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_2058/extensions/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_2058/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/resources/text.properties | ||
---|---|---|
1 |
_Guardar=Guardar |
|
2 |
_Save_changes_performed=Guardar los cambios realizados. |
|
3 |
_Descartar=Descartar |
|
4 |
_Discard_and_lose_changes=Descartar y perder los cambios realizados. |
|
5 |
_Continuar=Continuar |
|
6 |
_Do_not_save_yet_Stay_in_editing_mode=No guardar a?n. Continuar en edici?n. |
|
7 |
_Attributes_table=Tabla de atributos |
|
8 |
_Show_attributes_table=Mostrar tabla de atributos |
|
9 |
_Cut_table=Cortar tabla |
|
10 |
_Cut_table_in_editing=Cortar tabla en edici?n |
|
11 |
_Print_table=Imprimir tabla |
|
12 |
_Start_editing=Comenzar edici?n |
|
13 |
_Stop_editing=Terminar edici?n |
|
14 |
_Create_link_between_tables=Enlazar tablas |
|
15 |
_Unable_to_rename_attribute=No se pudo renombrar el campo |
|
16 |
_Please_insert_new_field_name_Cannot_be_undone=Introduzca nuevo nombre de campo.\nAtenci?n: tras este cambio, se cerrar? la edici?n consolidando los cambios. |
|
17 |
_Create_link=Enlazar |
|
18 |
_Order_ascending=Ordenar ascendente |
|
19 |
_Order_descending=Ordenar descendente |
|
20 |
_Move_up=Mover arriba |
|
21 |
_Print=Imprimir |
|
22 |
Table=Tabla |
|
23 |
_Reverse=Invertir |
|
24 |
_Statistics=Estad?sticas |
|
25 |
_Cut=Cortar |
|
26 |
_Paste=Pegar |
|
27 |
_Rename_column=Renombrar columna |
|
28 |
_Add_column=A?adir columna |
|
29 |
_Remove_column=Eliminar columna |
|
30 |
_Add_row=A?adir fila |
|
31 |
_Remove_row=Eliminar fila |
|
32 |
_Remove_link=Eliminar enlace |
|
33 |
_Filter_table=Filtrar tabla |
|
34 |
_Filter=Filtrar |
|
35 |
_Clear_selection=Deseleccionar todo |
|
36 |
_Column_manager=Gestor de columnas |
|
37 |
_Move_up_selection=Mover arriba la selecci?n |
|
38 |
_Unable_to_rename_field=No se pudo renombrar el campo |
|
39 |
|
tags/v2_0_0_Build_2058/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/resources/text_en.properties | ||
---|---|---|
1 |
_Guardar=Save |
|
2 |
_Save_changes_performed=Save edits performed in layer. |
|
3 |
_Descartar=Discard |
|
4 |
_Discard_and_lose_changes=Discard and lose edits performed. |
|
5 |
_Continuar=Continue |
|
6 |
_Do_not_save_yet_Stay_in_editing_mode=Do not save yet. Continue editing. |
|
7 |
_Attributes_table=Attributes table |
|
8 |
_Show_attributes_table=Show attributes table |
|
9 |
_Cut_table=Cut table |
|
10 |
_Cut_table_in_editing=Cut current table |
|
11 |
_Print_table=Print table |
|
12 |
_Start_editing=Start editing |
|
13 |
_Stop_editing=Stop editing |
|
14 |
_Create_link_between_tables=Create link between tables |
|
15 |
_Unable_to_rename_attribute=Unable to rename attribute |
|
16 |
_Please_insert_new_field_name_Cannot_be_undone=Please insert new field name.\nWarning: after this change, editing mode will be closed and changes will be consolidated. |
|
17 |
_Create_link=Create link |
|
18 |
_Order_ascending=Sort ascending |
|
19 |
_Order_descending=Sort descending |
|
20 |
_Move_up=Move up |
|
21 |
_Print=Print |
|
22 |
Table=Table |
|
23 |
_Reverse=Reverse |
|
24 |
_Statistics=Statistics |
|
25 |
_Cut=Cut |
|
26 |
_Paste=Paste |
|
27 |
_Rename_column=Rename column |
|
28 |
_Add_column=Add column |
|
29 |
_Remove_column=Remove column |
|
30 |
_Add_row=Add row |
|
31 |
_Remove_row=Remove row |
|
32 |
_Remove_link=Remove link |
|
33 |
_Filter_table=Filter table |
|
34 |
_Filter=Filter |
|
35 |
_Clear_selection=Clear selection |
|
36 |
_Column_manager=Column manager |
|
37 |
_Move_up_selection=Move up selection |
|
38 |
_Unable_to_rename_field=Unable to rename field |
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
tags/v2_0_0_Build_2058/extensions/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 |
</extension> |
|
12 |
|
|
13 |
<extension class-name="org.gvsig.app.extension.ClearSelectionExtension" |
|
14 |
description="Extensi?n encargada de limpiar la selecci?n." |
|
15 |
active="true"> |
|
16 |
|
|
17 |
<action |
|
18 |
name="selection-clear-table" |
|
19 |
label="_Clear_selection" |
|
20 |
tooltip="_Clear_selection" |
|
21 |
position="300300000" |
|
22 |
action-command="selection-clear-table" |
|
23 |
icon="selection-clear" |
|
24 |
accelerator="" |
|
25 |
/> |
|
26 |
|
|
27 |
<menu |
|
28 |
name="selection-clear-table" |
|
29 |
text="Selection/_Clear" |
|
30 |
/> |
|
31 |
|
|
32 |
<tool-bar name="view_selection"> |
|
33 |
<action-tool |
|
34 |
name="selection-clear-table" |
|
35 |
/> |
|
36 |
</tool-bar> |
|
37 |
</extension> |
|
38 |
|
|
39 |
<extension class-name="org.gvsig.app.extension.ShowTable" |
|
40 |
description="Extensi?n encargada de abrir la tabla asociada a la capa seleccionado." |
|
41 |
active="true"> |
|
42 |
|
|
43 |
<action |
|
44 |
name="layer-show-attributes-table" |
|
45 |
label="_Attributes_table" |
|
46 |
tooltip="_Show_attributes_table" |
|
47 |
position="601200000" |
|
48 |
action-command="layer-show-attributes-table" |
|
49 |
icon="layer-show-attributes-table" |
|
50 |
accelerator="" |
|
51 |
/> |
|
52 |
|
|
53 |
<menu |
|
54 |
name="layer-show-attributes-table" |
|
55 |
text="Layer/_Show_attributes_table" |
|
56 |
/> |
|
57 |
|
|
58 |
<tool-bar name="view_actions"> |
|
59 |
<action-tool |
|
60 |
name="layer-show-attributes-table" |
|
61 |
/> |
|
62 |
</tool-bar> |
|
63 |
</extension> |
|
64 |
|
|
65 |
<extension class-name="org.gvsig.app.extension.TableOperations" |
|
66 |
description="Extensi?n encargada de gestionar las operaciones sobre las tablas." |
|
67 |
active="true"> |
|
68 |
|
|
69 |
<action |
|
70 |
name="table-create-link" |
|
71 |
label="_Create_link" |
|
72 |
tooltip="_Create_link_between_tables" |
|
73 |
position="501300000" |
|
74 |
action-command="table-create-link" |
|
75 |
icon="table-create-link" |
|
76 |
accelerator="" |
|
77 |
/> |
|
78 |
|
|
79 |
<menu |
|
80 |
name="table-create-link" |
|
81 |
text="Table/_Create_link" |
|
82 |
/> |
|
83 |
|
|
84 |
<tool-bar name="table_tools"> |
|
85 |
<action-tool |
|
86 |
name="table-create-link" |
|
87 |
/> |
|
88 |
</tool-bar> |
|
89 |
</extension> |
|
90 |
|
|
91 |
<extension class-name="org.gvsig.app.extension.RedoTableExtension" |
|
92 |
description="Extensi?n encargada de rehacer la edici?n sobre la capa activa." |
|
93 |
active="true"> |
|
94 |
|
|
95 |
<action |
|
96 |
name="edit-redo-table" |
|
97 |
label="_Redo" |
|
98 |
tooltip="_Redo" |
|
99 |
position="0200200000" |
|
100 |
action-command="edit-redo-table" |
|
101 |
icon="edit-redo" |
|
102 |
accelerator="" |
|
103 |
/> |
|
104 |
|
|
105 |
<menu |
|
106 |
name="edit-redo-table" |
|
107 |
text="Edit/_Redo" |
|
108 |
/> |
|
109 |
|
|
110 |
<tool-bar name="edit_actions"> |
|
111 |
<action-tool |
|
112 |
name="edit-redo-table" |
|
113 |
/> |
|
114 |
</tool-bar> |
|
115 |
</extension> |
|
116 |
|
|
117 |
<extension class-name="org.gvsig.app.extension.UndoTableExtension" |
|
118 |
description="Extensi?n encargada de dehacer la edici?n sobre la capa activa." |
|
119 |
active="true"> |
|
120 |
|
|
121 |
<action |
|
122 |
name="edit-undo-table" |
|
123 |
label="_Undo" |
|
124 |
tooltip="_Undo" |
|
125 |
position="0200100000" |
|
126 |
action-command="edit-undo-table" |
|
127 |
icon="edit-undo" |
|
128 |
accelerator="" |
|
129 |
/> |
|
130 |
|
|
131 |
<menu |
|
132 |
name="edit-undo-table" |
|
133 |
text="Edit/_Undo" |
|
134 |
/> |
|
135 |
|
|
136 |
<tool-bar name="edit_actions"> |
|
137 |
<action-tool |
|
138 |
name="edit-undo-table" |
|
139 |
/> |
|
140 |
</tool-bar> |
|
141 |
</extension> |
|
142 |
|
|
143 |
<extension class-name="org.gvsig.app.extension.TableEditStopExtension" |
|
144 |
description="Extensi?n encargada de gestionar las operaciones de edici?n sobre las tablas." |
|
145 |
active="true"> |
|
146 |
|
|
147 |
<action |
|
148 |
name="table-stop-editing" |
|
149 |
label="_Stop_editing" |
|
150 |
tooltip="_Stop_editing" |
|
151 |
position="500300000" |
|
152 |
action-command="table-stop-editing" |
|
153 |
icon="table-stop-editing" |
|
154 |
accelerator="" |
|
155 |
/> |
|
156 |
|
|
157 |
<menu |
|
158 |
name="table-stop-editing" |
|
159 |
text="Table/_Stop_editing" |
|
160 |
/> |
|
161 |
|
|
162 |
<tool-bar name="table_actions"> |
|
163 |
<action-tool |
|
164 |
name="table-stop-editing" |
|
165 |
/> |
|
166 |
</tool-bar> |
|
167 |
</extension> |
|
168 |
<extension class-name="org.gvsig.app.extension.TableEditStartExtension" |
|
169 |
description="Extensi?n encargada de gestionar las operaciones de edici?n sobre las tablas." |
|
170 |
active="true"> |
|
171 |
|
|
172 |
<action |
|
173 |
name="table-start-editing" |
|
174 |
label="_Start_editing" |
|
175 |
tooltip="_Start_editing" |
|
176 |
position="500200000" |
|
177 |
action-command="table-start-editing" |
|
178 |
icon="table-start-editing" |
|
179 |
accelerator="" |
|
180 |
/> |
|
181 |
|
|
182 |
<menu |
|
183 |
name="table-start-editing" |
|
184 |
text="Table/_Start_editing" |
|
185 |
/> |
|
186 |
|
|
187 |
<tool-bar name="table_actions"> |
|
188 |
<action-tool |
|
189 |
name="table-start-editing" |
|
190 |
/> |
|
191 |
</tool-bar> |
|
192 |
</extension> |
|
193 |
|
|
194 |
<extension class-name="org.gvsig.app.extension.TableEditInsertExtension" |
|
195 |
description="Extensi?n encargada de gestionar las operaciones de edici?n sobre las tablas." |
|
196 |
active="true"> |
|
197 |
<action |
|
198 |
name="table-add-row" |
|
199 |
label="_Add_row" |
|
200 |
tooltip="_Add_row" |
|
201 |
position="500500000" |
|
202 |
action-command="table-add-row" |
|
203 |
icon="table-add-row" |
|
204 |
accelerator="" |
|
205 |
/> |
|
206 |
|
|
207 |
<menu |
|
208 |
name="table-add-row" |
|
209 |
text="Table/_Add_row" |
|
210 |
/> |
|
211 |
|
|
212 |
<tool-bar name="table_actions"> |
|
213 |
<action-tool |
|
214 |
name="table-add-row" |
|
215 |
/> |
|
216 |
</tool-bar> |
|
217 |
</extension> |
|
218 |
|
|
219 |
<extension class-name="org.gvsig.app.extension.TableEditRemoveRowExtension" |
|
220 |
description="Extensi?n encargada de gestionar las operaciones de edici?n sobre las tablas." |
|
221 |
active="true"> |
|
222 |
|
|
223 |
<action |
|
224 |
name="table-remove-row" |
|
225 |
label="_Remove_row" |
|
226 |
tooltip="_Remove_row" |
|
227 |
position="500600000" |
|
228 |
action-command="table-remove-row" |
|
229 |
icon="table-remove-row" |
|
230 |
accelerator="" |
|
231 |
/> |
|
232 |
|
|
233 |
<menu |
|
234 |
name="table-remove-row" |
|
235 |
text="Table/_Remove_row" |
|
236 |
/> |
|
237 |
|
|
238 |
<tool-bar name="table_actions"> |
|
239 |
<action-tool |
|
240 |
name="table-remove-row" |
|
241 |
/> |
|
242 |
</tool-bar> |
|
243 |
</extension> |
|
244 |
<extension class-name="org.gvsig.app.extension.TableEditChangeColumnsExtension" |
|
245 |
description="Extensi?n encargada de gestionar las operaciones de edici?n de columnas sobre las tablas." |
|
246 |
active="true"> |
|
247 |
|
|
248 |
<action |
|
249 |
name="table-add-column" |
|
250 |
label="_Add_column" |
|
251 |
tooltip="_Add_column" |
|
252 |
position="500630000" |
|
253 |
action-command="table-add-column" |
|
254 |
icon="table-add-column" |
|
255 |
accelerator="" |
|
256 |
/> |
|
257 |
|
|
258 |
<action |
|
259 |
name="table-rename-column" |
|
260 |
label="_Rename_column" |
|
261 |
tooltip="_Rename_column" |
|
262 |
position="500650000" |
|
263 |
action-command="table-rename-column" |
|
264 |
icon="table-rename-column" |
|
265 |
accelerator="" |
|
266 |
/> |
|
267 |
|
|
268 |
<action |
|
269 |
name="table-remove-column" |
|
270 |
label="_Remove_column" |
|
271 |
tooltip="_Remove_column" |
|
272 |
position="500670000" |
|
273 |
action-command="table-remove-column" |
|
274 |
icon="table-remove-column" |
|
275 |
accelerator="" |
|
276 |
/> |
|
277 |
|
|
278 |
<menu |
|
279 |
name="table-add-column" |
|
280 |
text="Table/_Add_column" |
|
281 |
/> |
|
282 |
|
|
283 |
<menu |
|
284 |
name="table-remove-column" |
|
285 |
text="Table/_Remove_column" |
|
286 |
/> |
|
287 |
|
|
288 |
<menu |
|
289 |
name="table-rename-column" |
|
290 |
text="Table/_Rename_column" |
|
291 |
/> |
|
292 |
|
|
293 |
<tool-bar name="table_actions"> |
|
294 |
<action-tool |
|
295 |
name="table-add-column" |
|
296 |
/> |
|
297 |
<action-tool |
|
298 |
name="table-remove-column" |
|
299 |
/> |
|
300 |
<action-tool |
|
301 |
name="table-rename-column" |
|
302 |
/> |
|
303 |
</tool-bar> |
|
304 |
|
|
305 |
</extension> |
|
306 |
<extension class-name="org.gvsig.app.extension.TableEditAttributes" |
|
307 |
description="Extensi?n encargada de gestionar los campos de las tablas." |
|
308 |
active="true"> |
|
309 |
<action |
|
310 |
name="table-column-manager" |
|
311 |
label="_Column_manager" |
|
312 |
tooltip="_Column_manager" |
|
313 |
position="0500700000" |
|
314 |
action-command="table-column-manager" |
|
315 |
icon="table-column-manager" |
|
316 |
accelerator="" |
|
317 |
/> |
|
318 |
|
|
319 |
<menu |
|
320 |
name="table-column-manager" |
|
321 |
text="Table/_Column_manager" |
|
322 |
/> |
|
323 |
|
|
324 |
<tool-bar name="table_actions"> |
|
325 |
<action-tool |
|
326 |
name="table-column-manager" |
|
327 |
/> |
|
328 |
</tool-bar> |
|
329 |
</extension> |
|
330 |
|
|
331 |
<extension class-name="org.gvsig.app.extension.TableEditCopyExtension" |
|
332 |
description="Extensi?n encargada de gestionar las operaciones de edici?n sobre las tablas." |
|
333 |
active="true"> |
|
334 |
<action |
|
335 |
name="edit-copy-table" |
|
336 |
label="_Copy" |
|
337 |
tooltip="_Copy" |
|
338 |
position="200500000" |
|
339 |
action-command="edit-copy-table" |
|
340 |
icon="edit-copy" |
|
341 |
accelerator="" |
|
342 |
/> |
|
343 |
|
|
344 |
<menu |
|
345 |
name="edit-copy-table" |
|
346 |
text="Edit/_Copy" |
|
347 |
/> |
|
348 |
|
|
349 |
<tool-bar name="edit_actions"> |
|
350 |
<action-tool |
|
351 |
name="edit-copy-table" |
|
352 |
/> |
|
353 |
</tool-bar> |
|
354 |
</extension> |
|
355 |
|
|
356 |
<extension class-name="org.gvsig.app.extension.TableEditCutExtension" |
|
357 |
description="Extensi?n encargada de gestionar las operaciones de edici?n sobre las tablas." |
|
358 |
active="true"> |
|
359 |
<action |
|
360 |
name="edit-cut-table" |
|
361 |
label="_Cut_table" |
|
362 |
tooltip="_Cut_table_in_editing" |
|
363 |
position="200400000" |
|
364 |
action-command="edit-cut-table" |
|
365 |
icon="edit-cut" |
|
366 |
accelerator="" |
|
367 |
/> |
|
368 |
|
|
369 |
<menu |
|
370 |
name="edit-cut-table" |
|
371 |
text="Edit/_Cut" |
|
372 |
/> |
|
373 |
|
|
374 |
<tool-bar name="edit_actions"> |
|
375 |
<action-tool |
|
376 |
name="edit-cut-table" |
|
377 |
/> |
|
378 |
</tool-bar> |
|
379 |
</extension> |
|
380 |
|
|
381 |
<extension class-name="org.gvsig.app.extension.TableEditPasteExtension" |
|
382 |
description="Extensi?n encargada de gestionar las operaciones de edici?n sobre las tablas." |
|
383 |
active="true"> |
|
384 |
<action |
|
385 |
name="edit-paste-table" |
|
386 |
label="_Paste" |
|
387 |
tooltip="_Paste" |
|
388 |
position="200600000" |
|
389 |
action-command="edit-paste-table" |
|
390 |
icon="edit-paste" |
|
391 |
accelerator="" |
|
392 |
/> |
|
393 |
|
|
394 |
<menu |
|
395 |
name="edit-paste-table" |
|
396 |
text="Edit/_Paste" |
|
397 |
/> |
|
398 |
|
|
399 |
<tool-bar name="edit_actions"> |
|
400 |
<action-tool |
|
401 |
name="edit-paste-table" |
|
402 |
/> |
|
403 |
</tool-bar> |
|
404 |
</extension> |
|
405 |
|
|
406 |
<extension active="true" class-name="org.gvsig.app.extension.TableFieldOperations" |
|
407 |
description="Operaciones sobre los campos de las tablas"> |
|
408 |
<action |
|
409 |
name="table-order-asc" |
|
410 |
label="_Order_ascending" |
|
411 |
tooltip="_Order_ascending" |
|
412 |
position="500900000" |
|
413 |
action-command="table-order-asc" |
|
414 |
icon="table-order-asc" |
|
415 |
accelerator="" |
|
416 |
/> |
|
417 |
|
|
418 |
<action |
|
419 |
name="table-order-desc" |
|
420 |
label="_Order_descending" |
|
421 |
tooltip="_Order_descending" |
|
422 |
position="501000000" |
|
423 |
action-command="table-order-desc" |
|
424 |
icon="table-order-desc" |
|
425 |
accelerator="" |
|
426 |
/> |
|
427 |
|
|
428 |
<menu |
|
429 |
name="table-order-asc" |
|
430 |
text="Table/_Order_ascending" |
|
431 |
/> |
|
432 |
|
|
433 |
<menu |
|
434 |
name="table-order-desc" |
|
435 |
text="Table/_Order_descending" |
|
436 |
/> |
|
437 |
|
|
438 |
<tool-bar name="table_actions"> |
|
439 |
<action-tool |
|
440 |
name="table-order-asc" |
|
441 |
/> |
|
442 |
<action-tool |
|
443 |
name="table-order-desc" |
|
444 |
/> |
|
445 |
</tool-bar> |
|
446 |
</extension> |
|
447 |
|
|
448 |
<extension class-name="org.gvsig.app.extension.TableNumericFieldOperations" |
|
449 |
description="Extensi?n encargada de gestionar las operaciones sobre los campos num?ricos." |
|
450 |
active="true"> |
|
451 |
<action |
|
452 |
name="table-statistics" |
|
453 |
label="_Statistics" |
|
454 |
tooltip="_Statistics" |
|
455 |
position="508000000" |
|
456 |
action-command="table-statistics" |
|
457 |
icon="table-statistics" |
|
458 |
accelerator="" |
|
459 |
/> |
|
460 |
|
|
461 |
<menu |
|
462 |
name="table-statistics" |
|
463 |
text="Table/_Statistics" |
|
464 |
/> |
|
465 |
|
|
466 |
<tool-bar name="table_actions"> |
|
467 |
<action-tool |
|
468 |
name="table-statistics" |
|
469 |
/> |
|
470 |
</tool-bar> |
|
471 |
</extension> |
|
472 |
|
|
473 |
<extension class-name="org.gvsig.app.extension.TableRowsOperations" |
|
474 |
description="Extensi?n encargada de gestionar la selecci?n en la tabla." |
|
475 |
active="true"> |
|
476 |
<action |
|
477 |
name="selection-move-up" |
|
478 |
label="_Move_up_selection" |
|
479 |
tooltip="_Move_up_selection" |
|
480 |
position="300600000" |
|
481 |
action-command="selection-move-up" |
|
482 |
icon="selection-move-up" |
|
483 |
accelerator="" |
|
484 |
/> |
|
485 |
|
|
486 |
<action |
|
487 |
name="selection-reverse" |
|
488 |
label="_Reverse_selection" |
|
489 |
tooltip="_Reverse_selection" |
|
490 |
position="300500000" |
|
491 |
action-command="selection-reverse" |
|
492 |
icon="selection-reverse" |
|
493 |
accelerator="" |
|
494 |
/> |
|
495 |
|
|
496 |
<menu |
|
497 |
name="selection-move-up" |
|
498 |
text="Selection/_Move_up" |
|
499 |
/> |
|
500 |
|
|
501 |
<menu |
|
502 |
name="selection-reverse" |
|
503 |
text="Selection/_Reverse" |
|
504 |
/> |
|
505 |
|
|
506 |
<tool-bar name="selection_actions"> |
|
507 |
<action-tool |
|
508 |
name="selection-move-up" |
|
509 |
/> |
|
510 |
<action-tool |
|
511 |
name="selection-reverse" |
|
512 |
/> |
|
513 |
</tool-bar> |
|
514 |
</extension> |
|
515 |
|
|
516 |
<extension class-name="org.gvsig.app.extension.RemoveTableLink" |
|
517 |
description="Extensi?n encargada de quitar los enlaces de las tablas." |
|
518 |
active="true"> |
|
519 |
<action |
|
520 |
name="table-remove-link" |
|
521 |
label="_Remove_link" |
|
522 |
tooltip="_Remove_link" |
|
523 |
position="501400000" |
|
524 |
action-command="table-remove-link" |
|
525 |
icon="table-remove-link" |
|
526 |
accelerator="" |
|
527 |
/> |
|
528 |
|
|
529 |
<menu |
|
530 |
name="table-remove-link" |
|
531 |
text="Table/_Remove_link" |
|
532 |
/> |
|
533 |
|
|
534 |
<tool-bar name="table_actions"> |
|
535 |
<action-tool |
|
536 |
name="table-remove-link" |
|
537 |
/> |
|
538 |
</tool-bar> |
|
539 |
</extension> |
|
540 |
|
|
541 |
<extension class-name="org.gvsig.app.extension.PrintTable" |
|
542 |
description="Extensi?n encargada de la impresi?n de las tablas." |
|
543 |
active="true"> |
|
544 |
<action |
|
545 |
name="application-print-table" |
|
546 |
label="_Print_table" |
|
547 |
tooltip="_Print_table" |
|
548 |
position="100800000" |
|
549 |
action-command="application-print-table" |
|
550 |
icon="document-print" |
|
551 |
accelerator="" |
|
552 |
/> |
|
553 |
|
|
554 |
<menu |
|
555 |
name="application-print-table" |
|
556 |
text="File/_Print" |
|
557 |
/> |
|
558 |
|
|
559 |
<tool-bar name="table_actions"> |
|
560 |
<action-tool |
|
561 |
name="application-print-table" |
|
562 |
/> |
|
563 |
</tool-bar> |
|
564 |
</extension> |
|
565 |
|
|
566 |
<extension class-name="org.gvsig.app.extension.ZoomToSelectExtension" |
|
567 |
description="Extensi?n encargada de gestionar los eventos realizados sobre una capa." |
|
568 |
active="true"> |
|
569 |
<action |
|
570 |
name="view-navigation-zoom-to-selection-table" |
|
571 |
label="Zoom_to_selection" |
|
572 |
tooltip="Zoom_to_selection" |
|
573 |
position="650100900" |
|
574 |
action-command="view-navigation-zoom-to-selection-table" |
|
575 |
icon="view-navigation-zoom-to-selection" |
|
576 |
accelerator="" |
|
577 |
/> |
|
578 |
|
|
579 |
<menu |
|
580 |
name="view-navigation-zoom-to-selection-table" |
|
581 |
text="View/Navigation/Zoom_to_selection" |
|
582 |
/> |
|
583 |
|
|
584 |
<tool-bar name="view_navigation"> |
|
585 |
<action-tool |
|
586 |
name="view-navigation-zoom-to-selection-table" |
|
587 |
/> |
|
588 |
</tool-bar> |
|
589 |
</extension> |
|
590 |
|
|
591 |
<extension class-name="org.gvsig.app.extension.FiltroExtension" |
|
592 |
description="Extensi?n encargada de abrir el di?logo para filtrar una tabla." |
|
593 |
active="true"> |
|
594 |
<action |
|
595 |
name="table-filter" |
|
596 |
label="_Filter" |
|
597 |
tooltip="_Filter_table" |
|
598 |
position="500100000" |
|
599 |
action-command="table-filter" |
|
600 |
icon="table-filter" |
|
601 |
accelerator="" |
|
602 |
/> |
|
603 |
|
|
604 |
<menu |
|
605 |
name="table-filter" |
|
606 |
text="Table/_Filter" |
|
607 |
/> |
|
608 |
|
|
609 |
<tool-bar name="table_actions"> |
|
610 |
<action-tool |
|
611 |
name="table-filter" |
|
612 |
/> |
|
613 |
</tool-bar> |
|
614 |
</extension> |
|
615 |
|
|
616 |
</extensions> |
|
617 |
<icon src="gvsig-logo-icon" text="gvSIG"/> |
|
618 |
</plugin-config> |
tags/v2_0_0_Build_2058/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/java/org/gvsig/app/extension/TableEditPasteExtension.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.extension; |
|
23 |
|
|
24 |
import org.gvsig.fmap.dal.exception.DataException; |
|
25 |
|
|
26 |
/** |
|
27 |
* DOCUMENT ME! |
|
28 |
* |
|
29 |
* @author Vicente Caballero Navarro |
|
30 |
*/ |
|
31 |
public class TableEditPasteExtension extends AbstractTableEditExtension { |
|
32 |
|
|
33 |
/** |
|
34 |
* @see org.gvsig.andami.plugins.IExtension#initialize() |
|
35 |
*/ |
|
36 |
public void initialize() { |
|
37 |
super.initialize(); |
|
38 |
} |
|
39 |
|
|
40 |
/** |
|
41 |
* @see org.gvsig.andami.plugins.IExtension#execute(java.lang.String) |
|
42 |
*/ |
|
43 |
public void execute(String actionCommand) { |
|
44 |
if ("edit-paste-table".equals(actionCommand)) { |
|
45 |
try { |
|
46 |
featureTableOperations.setTablePanel(table); |
|
47 |
featureTableOperations.pasteFeatures(); |
|
48 |
} catch (DataException e) { |
|
49 |
e.printStackTrace(); |
|
50 |
} |
|
51 |
} |
|
52 |
} |
|
53 |
|
|
54 |
/** |
|
55 |
* @see org.gvsig.andami.plugins.IExtension#isEnabled() |
|
56 |
*/ |
|
57 |
public boolean isEnabled() { |
|
58 |
return featureTableOperations.hasSelection(); |
|
59 |
} |
|
60 |
|
|
61 |
} |
tags/v2_0_0_Build_2058/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/java/org/gvsig/app/extension/ShowTable.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.extension; |
|
23 |
|
|
24 |
import org.gvsig.andami.IconThemeHelper; |
|
25 |
import org.gvsig.andami.PluginServices; |
|
26 |
import org.gvsig.andami.plugins.Extension; |
|
27 |
import org.gvsig.app.project.ProjectManager; |
|
28 |
import org.gvsig.app.project.documents.table.TableDocument; |
|
29 |
import org.gvsig.app.project.documents.table.TableManager; |
|
30 |
import org.gvsig.app.project.documents.table.gui.FeatureTableDocumentPanel; |
|
31 |
import org.gvsig.app.project.documents.view.gui.AbstractViewPanel; |
|
32 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
33 |
import org.gvsig.fmap.mapcontext.layers.CancelationException; |
|
34 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
35 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
|
36 |
import org.gvsig.fmap.mapcontext.layers.LayerCollectionEvent; |
|
37 |
import org.gvsig.fmap.mapcontext.layers.LayerCollectionListener; |
|
38 |
import org.gvsig.fmap.mapcontext.layers.LayerPositionEvent; |
|
39 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
40 |
|
|
41 |
/** |
|
42 |
* Extensi?n que abre las tablas asociadas a las vistas. |
|
43 |
* |
|
44 |
* @author Vicente Caballero Navarro |
|
45 |
*/ |
|
46 |
public class ShowTable extends Extension implements LayerCollectionListener { |
|
47 |
|
|
48 |
/** |
|
49 |
* @see org.gvsig.andami.plugins.IExtension#isEnabled() |
|
50 |
*/ |
|
51 |
public boolean isEnabled() { |
|
52 |
AbstractViewPanel f = |
|
53 |
(AbstractViewPanel) PluginServices.getMDIManager() |
|
54 |
.getActiveWindow(); |
|
55 |
|
|
56 |
if (f == null) { |
|
57 |
return false; |
|
58 |
} |
|
59 |
|
|
60 |
FLayer[] selected = |
|
61 |
f.getViewDocument().getMapContext().getLayers().getActives(); |
|
62 |
|
|
63 |
boolean algunaTabla = false; |
|
64 |
|
|
65 |
for (int i = 0; i < selected.length; i++) { |
|
66 |
if (selected[i].isAvailable() && selected[i] instanceof FLyrVect) { |
|
67 |
FLyrVect co = (FLyrVect) selected[i]; |
|
68 |
|
|
69 |
try { |
|
70 |
if (co.getFeatureStore() != null) { |
|
71 |
algunaTabla = true; |
|
72 |
} |
|
73 |
// } catch (ReadException e) { |
|
74 |
// return false; |
|
75 |
} catch (NullPointerException e) { |
|
76 |
return false; |
|
77 |
} |
|
78 |
} |
|
79 |
} |
|
80 |
|
|
81 |
return algunaTabla; |
|
82 |
} |
|
83 |
|
|
84 |
/** |
|
85 |
* @see org.gvsig.andami.plugins.IExtension#isVisible() |
|
86 |
*/ |
|
87 |
public boolean isVisible() { |
|
88 |
org.gvsig.andami.ui.mdiManager.IWindow f = |
|
89 |
PluginServices.getMDIManager().getActiveWindow(); |
|
90 |
|
|
91 |
if (f == null) { |
|
92 |
return false; |
|
93 |
} |
|
94 |
|
|
95 |
return (f instanceof AbstractViewPanel); |
|
96 |
} |
|
97 |
|
|
98 |
/** |
|
99 |
* @see com.iver.mdiApp.plugins.IExtension#updateUI(java.lang.String) |
|
100 |
*/ |
|
101 |
public void execute(String s) { |
|
102 |
if ("layer-show-attributes-table".equalsIgnoreCase(s)) { |
|
103 |
AbstractViewPanel vista = (AbstractViewPanel) PluginServices |
|
104 |
.getMDIManager().getActiveWindow(); |
|
105 |
FLayer[] actives = vista.getViewDocument().getMapContext() |
|
106 |
.getLayers().getActives(); |
|
107 |
|
|
108 |
for (int i = 0; i < actives.length; i++) { |
|
109 |
if (actives[i] instanceof FLyrVect) { |
|
110 |
FLyrVect co = (FLyrVect) actives[i]; |
|
111 |
|
|
112 |
ProjectManager projectManager = getProjectManager(); |
|
113 |
TableManager tableManager = getTableManager(); |
|
114 |
|
|
115 |
TableDocument projectTable = tableManager |
|
116 |
.getTableDocument(co); |
|
117 |
FeatureStore fs = ((FLyrVect) actives[i]).getFeatureStore(); |
|
118 |
|
|
119 |
if (projectTable == null) { |
|
120 |
projectTable = (TableDocument) projectManager |
|
121 |
.createDocument( |
|
122 |
TableManager.TYPENAME, |
|
123 |
PluginServices.getText(this, |
|
124 |
"Tabla_de_Atributos") |
|
125 |
+ ": " |
|
126 |
+ actives[i].getName()); |
|
127 |
projectTable.setStore(fs); |
|
128 |
projectTable.setAssociatedLayer(co); |
|
129 |
co.getParentLayer().addLayerCollectionListener(this); |
|
130 |
projectManager.getCurrentProject().add(projectTable); |
|
131 |
} |
|
132 |
|
|
133 |
FeatureTableDocumentPanel featureTableDocumentPanel = (FeatureTableDocumentPanel) projectTable |
|
134 |
.getFactory().getMainWindow(projectTable); |
|
135 |
|
|
136 |
featureTableDocumentPanel.getModel().setModified(true); |
|
137 |
PluginServices.getMDIManager().addWindow( |
|
138 |
featureTableDocumentPanel); |
|
139 |
} |
|
140 |
} |
|
141 |
} |
|
142 |
} |
|
143 |
|
|
144 |
private ProjectManager getProjectManager() { |
|
145 |
return ProjectManager.getInstance(); |
|
146 |
} |
|
147 |
|
|
148 |
private TableManager getTableManager() { |
|
149 |
TableManager tableManager = |
|
150 |
(TableManager) getProjectManager().getDocumentManager( |
|
151 |
TableManager.TYPENAME); |
|
152 |
return tableManager; |
|
153 |
} |
|
154 |
|
|
155 |
/** |
|
156 |
* @see org.gvsig.andami.plugins.IExtension#initialize() |
|
157 |
*/ |
|
158 |
public void initialize() { |
|
159 |
IconThemeHelper.registerIcon("action", "layer-show-attributes-table", this); |
|
160 |
} |
|
161 |
|
|
162 |
public void layerAdded(LayerCollectionEvent e) { |
|
163 |
// Nothing to do |
|
164 |
} |
|
165 |
|
|
166 |
public void layerMoved(LayerPositionEvent e) { |
|
167 |
// Nothing to do |
|
168 |
} |
|
169 |
|
|
170 |
public void layerRemoved(LayerCollectionEvent e) { |
|
171 |
FLayer layer = e.getAffectedLayer(); |
|
172 |
// Just in case we where listening to a group of layers being removed |
|
173 |
// remove us from there |
|
174 |
if (layer instanceof FLayers) { |
|
175 |
((FLayers) layer).removeLayerCollectionListener(this); |
|
176 |
} |
|
177 |
// Remove the related table document, if any |
|
178 |
if (layer instanceof FLyrVect) { |
|
179 |
getTableManager().removeTableDocument((FLyrVect) layer); |
|
180 |
// If the parent layers has not other child layers, for sure there |
|
181 |
// are not related tables opened, don't need to listen |
|
182 |
// LayerCollectionEvents anymore. |
|
183 |
// TODO: remove us also when there are not any child layers with |
|
184 |
// related table documents |
|
185 |
FLayers layers = layer.getParentLayer(); |
|
186 |
if (layers != null && layers.getLayersCount() == 0) { |
|
187 |
layers.removeLayerCollectionListener(this); |
|
188 |
} |
|
189 |
} |
|
190 |
} |
|
191 |
|
|
192 |
public void layerAdding(LayerCollectionEvent e) throws CancelationException { |
|
193 |
// Nothing to do |
|
194 |
} |
|
195 |
|
|
196 |
public void layerMoving(LayerPositionEvent e) throws CancelationException { |
|
197 |
// Nothing to do |
|
198 |
} |
|
199 |
|
|
200 |
public void layerRemoving(LayerCollectionEvent e) |
|
201 |
throws CancelationException { |
|
202 |
// Nothing to do |
|
203 |
} |
|
204 |
|
|
205 |
public void visibilityChanged(LayerCollectionEvent e) |
|
206 |
throws CancelationException { |
|
207 |
// Nothing to do |
|
208 |
} |
|
209 |
} |
tags/v2_0_0_Build_2058/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/java/org/gvsig/app/extension/ClearSelectionExtension.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.extension; |
|
23 |
|
|
24 |
import org.gvsig.andami.IconThemeHelper; |
|
25 |
import org.gvsig.andami.PluginServices; |
|
26 |
import org.gvsig.andami.messages.NotificationManager; |
|
27 |
import org.gvsig.andami.plugins.Extension; |
|
28 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
|
29 |
import org.gvsig.app.project.documents.table.gui.FeatureTableDocumentPanel; |
|
30 |
import org.gvsig.fmap.dal.exception.DataException; |
|
31 |
import org.gvsig.fmap.dal.feature.FeatureSelection; |
|
32 |
|
|
33 |
/** |
|
34 |
* Extensi?n encargada de limpiar la selecci?n. |
|
35 |
* |
|
36 |
* @author Vicente Caballero Navarro |
|
37 |
*/ |
|
38 |
public class ClearSelectionExtension extends Extension { |
|
39 |
|
|
40 |
public void execute(String s) { |
|
41 |
if (s.compareTo("selection-clear-table") == 0) { |
|
42 |
IWindow activeWindow = |
|
43 |
PluginServices.getMDIManager().getActiveWindow(); |
|
44 |
|
|
45 |
if (isFeatureTableDocumentPanel(activeWindow)) { |
|
46 |
try { |
|
47 |
FeatureSelection selection = getSelection(activeWindow); |
|
48 |
selection.deselectAll(); |
|
49 |
} catch (DataException e) { |
|
50 |
NotificationManager.addError(e); |
|
51 |
} |
|
52 |
} |
|
53 |
} |
|
54 |
} |
|
55 |
|
|
56 |
public boolean isVisible() { |
|
57 |
IWindow activeWindow = PluginServices.getMDIManager().getActiveWindow(); |
|
58 |
return isFeatureTableDocumentPanel(activeWindow); |
|
59 |
} |
|
60 |
|
|
61 |
private boolean isFeatureTableDocumentPanel(IWindow activeWindow) { |
|
62 |
return activeWindow instanceof FeatureTableDocumentPanel; |
|
63 |
} |
|
64 |
|
|
65 |
public boolean isEnabled() { |
|
66 |
IWindow activeWindow = PluginServices.getMDIManager().getActiveWindow(); |
|
67 |
|
|
68 |
if (isFeatureTableDocumentPanel(activeWindow)) { |
|
69 |
try { |
|
70 |
return !getSelection(activeWindow).isEmpty(); |
|
71 |
} catch (DataException e) { |
|
72 |
throw new RuntimeException( |
|
73 |
"Error getting the selection to check if it is empty", e); |
|
74 |
} |
|
75 |
} |
|
76 |
|
|
77 |
return false; |
|
78 |
} |
|
79 |
|
|
80 |
private FeatureSelection getSelection(IWindow activeWindow) |
|
81 |
throws DataException { |
|
82 |
return (FeatureSelection) ((FeatureTableDocumentPanel) activeWindow) |
|
83 |
.getModel().getStore().getSelection(); |
|
84 |
} |
|
85 |
|
|
86 |
public void initialize() { |
|
87 |
IconThemeHelper.registerIcon("action", "selection-clear", this); |
|
88 |
} |
|
89 |
|
|
90 |
} |
tags/v2_0_0_Build_2058/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/java/org/gvsig/app/extension/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.extension; |
|
23 |
|
|
24 |
import java.awt.Component; |
|
25 |
import java.awt.Dimension; |
|
26 |
import java.util.List; |
|
27 |
|
|
28 |
import javax.swing.JOptionPane; |
|
29 |
|
|
30 |
import org.gvsig.andami.IconThemeHelper; |
|
31 |
import org.gvsig.andami.PluginServices; |
|
32 |
import org.gvsig.andami.messages.NotificationManager; |
|
33 |
import org.gvsig.andami.plugins.Extension; |
|
34 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
|
35 |
import org.gvsig.app.gui.filter.ExpressionListener; |
|
36 |
import org.gvsig.app.project.Project; |
|
37 |
import org.gvsig.app.project.ProjectManager; |
|
38 |
import org.gvsig.app.project.documents.Document; |
|
39 |
import org.gvsig.app.project.documents.gui.AndamiWizard; |
|
40 |
import org.gvsig.app.project.documents.gui.ObjectSelectionStep; |
|
41 |
import org.gvsig.app.project.documents.table.FieldSelectionModel; |
|
42 |
import org.gvsig.app.project.documents.table.TableDocument; |
|
43 |
import org.gvsig.app.project.documents.table.TableManager; |
|
44 |
import org.gvsig.app.project.documents.table.TableSelectionModel; |
|
45 |
import org.gvsig.app.project.documents.table.gui.FeatureTableDocumentPanel; |
|
46 |
import org.gvsig.fmap.dal.DALLocator; |
|
47 |
import org.gvsig.fmap.dal.exception.DataException; |
|
48 |
import org.gvsig.fmap.dal.feature.Feature; |
|
49 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
50 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
|
51 |
import org.gvsig.fmap.dal.feature.FeatureSelection; |
|
52 |
import org.gvsig.fmap.dal.feature.FeatureSet; |
|
53 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
54 |
import org.gvsig.tools.dispose.DisposableIterator; |
|
55 |
import org.gvsig.tools.dispose.DisposeUtils; |
|
56 |
import org.gvsig.utils.swing.objectSelection.SelectionException; |
|
57 |
import org.gvsig.utils.swing.wizard.WizardControl; |
|
58 |
import org.gvsig.utils.swing.wizard.WizardEvent; |
|
59 |
import org.gvsig.utils.swing.wizard.WizardListener; |
|
60 |
|
|
61 |
/** |
|
62 |
* Extensi?n que controla las operaciones realizadas sobre las tablas. |
|
63 |
* |
|
64 |
* @author Fernando Gonz?lez Cort?s |
|
65 |
*/ |
|
66 |
public class TableOperations extends Extension implements ExpressionListener { |
|
67 |
|
|
68 |
private FeatureStore featureStore = null; |
|
69 |
|
|
70 |
public void execute(String actionCommand) { |
|
71 |
final Project project = |
|
72 |
ProjectManager.getInstance().getCurrentProject(); |
|
73 |
List<Document> tableDcouments = |
|
74 |
project.getDocuments(TableManager.TYPENAME); |
|
75 |
TableDocument[] pts = |
|
76 |
tableDcouments |
|
77 |
.toArray(new TableDocument[tableDcouments.size()]); |
|
78 |
|
|
79 |
if ("table-create-link".equals(actionCommand)) { |
|
80 |
try { |
|
81 |
final ObjectSelectionStep sourceTable = |
|
82 |
new ObjectSelectionStep(); |
|
83 |
sourceTable.setModel(new TableSelectionModel(pts, |
|
84 |
PluginServices.getText(this, "seleccione_tabla_origen"))); |
|
85 |
|
|
86 |
final ObjectSelectionStep targetTable = |
|
87 |
new ObjectSelectionStep(); |
|
88 |
targetTable |
|
89 |
.setModel(new TableSelectionModel(pts, PluginServices |
|
90 |
.getText(this, "seleccione_tabla_a_enlazar"))); |
|
91 |
|
|
92 |
final ObjectSelectionStep firstTableField = |
|
93 |
new ObjectSelectionStep(); |
|
94 |
final ObjectSelectionStep secondTableField = |
|
95 |
new ObjectSelectionStep(); |
|
96 |
final AndamiWizard wiz = |
|
97 |
new AndamiWizard(PluginServices.getText(this, "back"), |
|
98 |
PluginServices.getText(this, "next"), |
|
99 |
PluginServices.getText(this, "finish"), |
|
100 |
PluginServices.getText(this, "cancel")); |
|
101 |
wiz.setSize(new Dimension(450, 200)); |
|
102 |
wiz.addStep(sourceTable); |
|
103 |
wiz.addStep(firstTableField); |
|
104 |
wiz.addStep(targetTable); |
|
105 |
wiz.addStep(secondTableField); |
|
106 |
|
|
107 |
wiz.addWizardListener(new WizardListener() { |
|
108 |
|
|
109 |
public void cancel(WizardEvent w) { |
|
110 |
PluginServices.getMDIManager().closeWindow(wiz); |
|
111 |
} |
|
112 |
|
|
113 |
public void finished(WizardEvent w) { |
|
114 |
PluginServices.getMDIManager().closeWindow(wiz); |
|
115 |
|
|
116 |
TableDocument sourceProjectTable = |
|
117 |
(TableDocument) sourceTable.getSelected(); |
|
118 |
|
|
119 |
TableDocument targetProjectTable = |
|
120 |
(TableDocument) targetTable.getSelected(); |
Also available in: Unified diff