Revision 36851
tags/v2_0_0_Build_2038/frameworks/_fwAndami/theme/andami-theme.xml | ||
---|---|---|
1 |
<AndamiProperties> |
|
2 |
<ApplicationImages> |
|
3 |
<SplashImages> |
|
4 |
<Splash |
|
5 |
path="splash.png" |
|
6 |
timer="10000" |
|
7 |
version="2.0" x="270" y="240" |
|
8 |
fontsize="18" color="80,170,240" |
|
9 |
version="2.0.0"/> |
|
10 |
</SplashImages> |
|
11 |
<BackgroundImage path="icon.png"/> |
|
12 |
<WallpaperType value="CENTERED"/> |
|
13 |
<Icon path="icon.png"/> |
|
14 |
</ApplicationImages> |
|
15 |
<ApplicationName value="Andami 2.0.0"/> |
|
16 |
</AndamiProperties> |
|
0 | 17 |
tags/v2_0_0_Build_2038/frameworks/_fwAndami/theme/README.txt | ||
---|---|---|
1 |
Use those files as a template for your own andami theme. |
|
2 |
|
|
3 |
If none provided by any plugin, this theme will be used as the default one. |
tags/v2_0_0_Build_2038/frameworks/_fwAndami/schemas/sample-plugins-persistence.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<plugins-status> |
|
3 |
<plugin name="gvsig" lastUpdate="237628686"> |
|
4 |
<xml-entity name="config"> |
|
5 |
<property name="dataDirectory" value="c:\"/> |
|
6 |
<xml-entity> |
|
7 |
<property name="dataDirectory" value="c:\"/> |
|
8 |
<property name="dataDirectory" value="c:\"/> |
|
9 |
<property name="dataDirectory" value="c:\"/> |
|
10 |
</xml-entity> |
|
11 |
</xml-entity> |
|
12 |
<bookmarks> |
|
13 |
<bookmark text="Recientes/raster"> |
|
14 |
<xml-entity> |
|
15 |
<property name="projection" value="EPSG:3403"/> |
|
16 |
<property name="boundinBox" value="12,12,115,115"/> |
|
17 |
</xml-entity> |
|
18 |
</bookmark> |
|
19 |
</bookmarks> |
|
20 |
<windows> |
|
21 |
<window id="0" rectangle="0,0,150,150"/> |
|
22 |
<window id="2" rectangle="50,50,150,150"/> |
|
23 |
<window id="8" rectangle="100,100,150,150"/> |
|
24 |
<window id="12" rectangle="150,150,150,150"/> |
|
25 |
</windows> |
|
26 |
</plugin> |
|
27 |
<tool-bars> |
|
28 |
<tool-bar name="gvsig.herramientas" x-position="0" y-position="1"/> |
|
29 |
<tool-bar name="gvsig.herramientas" x-position="0" y-position="0"/> |
|
30 |
</tool-bars> |
|
31 |
</plugins-status> |
|
0 | 32 |
tags/v2_0_0_Build_2038/frameworks/_fwAndami/schemas/sample-config.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<plugin-config> |
|
3 |
<icon src="images/logoGVA.gif" text="gvSIG"/> |
|
4 |
<resourceBundle name="text"/> |
|
5 |
<import plugin-name="com.iver.cit.gvsig" /> |
|
6 |
<labelSet class="com.iver.cit.gvsig.gui.View"> |
|
7 |
<label id="1" size="100"/> |
|
8 |
<label id="2" size="230"/> |
|
9 |
</labelSet> |
|
10 |
<libraries> |
|
11 |
<library file="com.iver.cit.gvsig.jar"/> |
|
12 |
<library file="wmsclient.jar"/> |
|
13 |
</libraries> |
|
14 |
<extensions> |
|
15 |
<extension> |
|
16 |
<class name="com.iver.cit.gvsig.ProjectExtension"/> |
|
17 |
<menu text="Archivo/nuevo_proyecto" |
|
18 |
key="n" mnemonic="n" |
|
19 |
tooltip="nuevo_tooltip" |
|
20 |
action-command="NUEVO" icon="images/new.png"/> |
|
21 |
<menu text="Archivo/abrir_proyecto" |
|
22 |
key="a" mnemonic="a" |
|
23 |
tooltip="abrir_tooltip" |
|
24 |
action-command="ABRIR" icon="images/open.png"/> |
|
25 |
<menu text="Archivo/guardar_proyecto" |
|
26 |
key="g" mnemonic="g" |
|
27 |
tooltip="guardar_tooltip" |
|
28 |
action-command="GUARDAR" icon="images/save.png"/> |
|
29 |
|
|
30 |
<toolBar> |
|
31 |
<tool icon="images/new.png" tooltip="nuevo_tooltip" |
|
32 |
action-command="NUEVO"/> |
|
33 |
<tool icon="images/open.png" tooltip="abrir_tooltip" |
|
34 |
action-command="ABRIR"/> |
|
35 |
<tool icon="images/save.png" tooltip="guardar_tooltip" |
|
36 |
action-command="GUARDAR"/> |
|
37 |
|
|
38 |
<!-- these will be added to the containing toolbar --> |
|
39 |
<combo-scale |
|
40 |
name="JPEG Quality" |
|
41 |
elements="15;30;60;70;80;90;100" |
|
42 |
value="80" |
|
43 |
action-command="JPEG_QUALITY" /> |
|
44 |
|
|
45 |
<combo-button |
|
46 |
name="Copy/paste tools"> |
|
47 |
<combo-button-element icon="images/scissor.png" action-command="CUT" /> |
|
48 |
<combo-button-element icon="images/paste.png" action-command="PASTE" /> |
|
49 |
<combo-button-element icon="images/copy.png" action-command="COPY" /> |
|
50 |
</combo-button> |
|
51 |
</toolBar> |
|
52 |
|
|
53 |
</extension> |
|
54 |
|
|
55 |
<extension> |
|
56 |
<class name="com.iver.cit.gvsig.ZoomPrev"/> |
|
57 |
<menu text="Vista/Zoom_Previo" icon="images/ZoomPrevio.png"/> |
|
58 |
<tool-bar name="Herramientas"> |
|
59 |
<action-tool icon="images/ZoomPrevio.png" action-command="ZOOM_PREV" tooltip="Zoom_Previo" position="11"/> |
|
60 |
</tool-bar> |
|
61 |
|
|
62 |
<!-- these will be added to the status-bar (because they are not contained in any toolbar) --> |
|
63 |
<combo-scale |
|
64 |
name="Scale" |
|
65 |
label="Scale:" |
|
66 |
elements="1000;2000;5000;10000;25000;50000;100000;200000;500000;1000000;2000000;5000000" |
|
67 |
value="10000" |
|
68 |
action-command="CHANGE_SCALE" /> |
|
69 |
|
|
70 |
<combo-button |
|
71 |
name="Tool Mode"> |
|
72 |
<combo-button-element icon="images/once.png" action-command="USE_ONCE" /> |
|
73 |
<combo-button-element icon="images/sticky-tool.png" action-command="UNTIL_CHANGED" /> |
|
74 |
</combo-button> |
|
75 |
</extension> |
|
76 |
<extension processing-position="2"> |
|
77 |
<class name="com.iver.cit.gvsig.ViewControls"/> |
|
78 |
<menus> |
|
79 |
<menu text="Vista/Zoom_Completo" action-command="FULL" icon="images/MapContents.png" tooltip="Zoom completo a la v?sta"/> |
|
80 |
<menu text="Vista/Zoom_Select" action-command="ZOOM_SELECT" icon="image/Select.png"/> |
|
81 |
<menu text="Vista/Encuadre" action-command="ENCUADRE" icon="images/encuadre.png"/> |
|
82 |
<menu text="Vista/Seleccion_por_tema" action-command="SELECTIONBYSHAPE"/> |
|
83 |
<menu text="Vista/configurar_localizador" action-command="CONFIG_LOCATOR"/> |
|
84 |
<menu text="Vista/propiedades" action-command="PROPERTIES"/> |
|
85 |
</menus> |
|
86 |
<tool-bar name="Herramientas" y-position="1"> |
|
87 |
<action-tool icon="images/MapContents.png" action-command="FULL" tooltip="Zoom_Completo" position="1"/> |
|
88 |
<action-tool icon="images/encuadre.png" action-command="ENCUADRE" tooltip="gestion_encuadre" last="true" position="2"/> |
|
89 |
<selectable-tool group="grupo1" default="true" icon="images/ZoomIn.png" action-command="ZOOM_IN" tooltip="Zoom_M?s" position="3"/> |
|
90 |
<selectable-tool group="grupo1" icon="images/ZoomOut.png" action-command="ZOOM_OUT" position="4"/> |
|
91 |
<selectable-tool group="grupo1" icon="images/Pan.png" action-command="PAN" tooltip="Encuadre" position="5"/> |
|
92 |
<selectable-tool group="grupo1" icon="images/Identify.png" action-command="INFO" tooltip="informacion" position="6" /> |
|
93 |
<selectable-tool group="grupo2" icon="images/Distancia.png" action-command="MEDICION" tooltip="medir_distancias" position="7"/> |
|
94 |
<selectable-tool group="grupo2" icon="images/Poligono16.png" action-command="AREA" tooltip="medir_area" position="8"/> |
|
95 |
<selectable-tool group="grupo2" default="true" icon="images/Select.png" action-command="SELPOINT" tooltip="seleccionar_por_punto" position="9"/> |
|
96 |
<selectable-tool group="grupo2" icon="images/SelEspacial2b.png" action-command="SELRECT" tooltip="seleccionar_por_rectangulo" position="10"/> |
|
97 |
</tool-bar> |
|
98 |
</extension> |
|
99 |
<extension> |
|
100 |
<class name="com.iver.cit.gvsig.ThemeControls"/> |
|
101 |
<menu text="Tema/propiedades"/> |
|
102 |
</extension> |
|
103 |
</extensions> |
|
104 |
|
|
105 |
<file-extensions> |
|
106 |
<file-extension description="DGNfiles" ends-with="dgn" dialog="openLayer"> |
|
107 |
<class name="com.iver.cit.gvsig.DGNFileExtension"/> |
|
108 |
</file-extension> |
|
109 |
<file-extension description="Rasterfiles" ends-with="ecw,tif,tiff,jpg,png" dialog="openLayer"> |
|
110 |
<class name="com.iver.cit.gvsig.RasterFileExtension"/> |
|
111 |
</file-extension> |
|
112 |
</file-extensions> |
|
113 |
</plugin-config> |
|
0 | 114 |
tags/v2_0_0_Build_2038/frameworks/_fwAndami/schemas/andami-config.xml | ||
---|---|---|
1 |
<andami-config locale-language="es" locale-country="ES" locale-variant="es" pluginsDirectory="c:\tirar"> |
|
2 |
<andami update="yes"/> |
|
3 |
<plugin name="com.iver.cit.gvsig" update="yes"/> |
|
4 |
<plugin name="com.iver.core" update="no"/> |
|
5 |
<andami-options> |
|
6 |
<option name="CustomOption1" value="customValue1"/> |
|
7 |
<icon-theme name="DefaultTheme" resource="iconThemes/default" basedir="iconThemes" /> |
|
8 |
</andami-options> |
|
9 |
</andami-config> |
|
0 | 10 |
tags/v2_0_0_Build_2038/frameworks/_fwAndami/gvSIG.bat | ||
---|---|---|
1 |
d: |
|
2 |
cd d:\eclipse\workspace\fwAndami |
|
3 |
java -cp andami.jar;lib/beans.jar;./lib/castor-0.9.5.3-xml.jar;./lib/gvsig-i18n.jar;./lib/iver-utiles.jar;./lib/javaws.jar;lib/JWizardComponent.jar;./lib/log4j-1.2.8.jar;lib/looks-2.0.2.jar;./lib/xerces_2_5_0.jar;./lib/xml-apis.jar -Xmx500M com.iver.andami.Launcher gvSIG gvSIG/extensiones %1 |
|
0 | 4 |
tags/v2_0_0_Build_2038/frameworks/_fwAndami/src-test/org/gvsig/andami/AllTests.java | ||
---|---|---|
1 |
package org.gvsig.andami; |
|
2 |
|
|
3 |
import junit.framework.Test; |
|
4 |
import junit.framework.TestSuite; |
|
5 |
|
|
6 |
public class AllTests { |
|
7 |
|
|
8 |
public static Test suite() { |
|
9 |
TestSuite suite = new TestSuite("Test for com.iver.andami"); |
|
10 |
//$JUnit-BEGIN$ |
|
11 |
|
|
12 |
//$JUnit-END$ |
|
13 |
return suite; |
|
14 |
} |
|
15 |
|
|
16 |
} |
|
0 | 17 |
tags/v2_0_0_Build_2038/frameworks/_fwAndami/castor.properties | ||
---|---|---|
1 |
org.exolab.castor.indent=true |
|
0 | 2 |
tags/v2_0_0_Build_2038/frameworks/_fwAndami/compile-classpath.xml | ||
---|---|---|
1 |
<project name="_fwAndami.compile-classpath" basedir="."> |
|
2 |
<!-- defines the classpath to be used for batch-compilation --> |
|
3 |
<property name="andami" location="../_fwAndami"/> |
|
4 |
<property name="andamiLibs" location="${andami}/lib"/> |
|
5 |
<path id="_fwAndami.compile-classpath"> |
|
6 |
<pathelement location="${andamiLibs}/beans.jar"/> |
|
7 |
<pathelement location="${andamiLibs}/castor-0.9.5.3-xml.jar"/> |
|
8 |
<pathelement location="${andamiLibs}/gvsig-i18n.jar"/> |
|
9 |
<pathelement location="${andamiLibs}/iver-utiles.jar"/> |
|
10 |
<pathelement location="${andamiLibs}/javaws.jar"/> |
|
11 |
<pathelement location="${andamiLibs}/JWizardComponent.jar"/> |
|
12 |
<pathelement location="${andamiLibs}/log4j-1.2.8.jar"/> |
|
13 |
<pathelement location="${andamiLibs}/tempFileManager.jar"/> |
|
14 |
<pathelement location="${andamiLibs}/xercesImpl.jar"/> |
|
15 |
<pathelement location="${andamiLibs}/xml-apis.jar"/> |
|
16 |
<pathelement location="${andamiLibs}/kxml2.jar"/> |
|
17 |
<pathelement location="${andamiLibs}/jcalendar.jar"/> |
|
18 |
</path> |
|
19 |
</project> |
|
0 | 20 |
tags/v2_0_0_Build_2038/frameworks/_fwAndami/src/iso_639.tab | ||
---|---|---|
1 |
|
|
2 |
## iso-639.tab |
|
3 |
## |
|
4 |
## Copyright (C) 2005 Alastair McKinstry <mckinstry@computer.org> |
|
5 |
## Released under the GNU License; see file COPYING for details |
|
6 |
## |
|
7 |
## PLEASE NOTE: THIS FILE IS DEPRECATED AND SCHEDULED TO BE REMOVED. |
|
8 |
## IT IS FOR BACKWARD-COMPATIBILITY ONLY: PLEASE USE THE ISO-639.XML |
|
9 |
## FILE INSTEAD. |
|
10 |
## |
|
11 |
## This file gives a list of all languages in the ISO-639 |
|
12 |
## standard, and is used to provide translations (via gettext) |
|
13 |
## |
|
14 |
## Status: ISO 639-2:1998 + additions and changes until 2003-03-05 |
|
15 |
## Source: http://lcweb.loc.gov/standards/iso639-2/englangn.html |
|
16 |
## |
|
17 |
## Columns: |
|
18 |
## iso-639-2 terminology code |
|
19 |
## iso-639-2 bibliography code |
|
20 |
## iso-639-1 code (XX if none exists) |
|
21 |
## Name (English) |
|
22 |
## |
|
23 |
## |
|
24 |
aar aar aa Afar |
|
25 |
abk abk ab Abkhazian |
|
26 |
ace ace XX Achinese |
|
27 |
ach ach XX Acoli |
|
28 |
ada ada XX Adangme |
|
29 |
ady ady XX Adyghe; Adygei |
|
30 |
afa afa XX Afro-Asiatic (Other) |
|
31 |
afh afh XX Afrihili |
|
32 |
afr afr af Afrikaans |
|
33 |
ain ain XX Ainu |
|
34 |
aka aka ak Akan |
|
35 |
akk akk XX Akkadian |
|
36 |
ale ale XX Aleut |
|
37 |
alg alg XX Algonquian languages |
|
38 |
alt alt XX Southern Altai |
|
39 |
amh amh am Amharic |
|
40 |
ang ang XX English, Old (ca. 450-1100) |
|
41 |
anp anp XX Angika |
|
42 |
apa apa XX Apache languages |
|
43 |
ara ara ar Arabic |
|
44 |
arc arc XX Aramaic |
|
45 |
arg arg an Aragonese |
|
46 |
arn arn XX Araucanian |
|
47 |
arp arp XX Arapaho |
|
48 |
art art XX Artificial (Other) |
|
49 |
arw arw XX Arawak |
|
50 |
asm asm as Assamese |
|
51 |
ast ast XX Asturian; Bable |
|
52 |
ath ath XX Athapascan languages |
|
53 |
aus aus XX Australian languages |
|
54 |
ava ava av Avaric |
|
55 |
ave ave ae Avestan |
|
56 |
awa awa XX Awadhi |
|
57 |
aym aym ay Aymara |
|
58 |
aze aze az Azerbaijani |
|
59 |
bad bad XX Banda |
|
60 |
bai bai XX Bamileke languages |
|
61 |
bak bak ba Bashkir |
|
62 |
bal bal XX Baluchi |
|
63 |
bam bam bm Bambara |
|
64 |
ban ban XX Balinese |
|
65 |
bas bas XX Basa |
|
66 |
bat bat XX Baltic (Other) |
|
67 |
bej bej XX Beja |
|
68 |
bel bel be Belarusian |
|
69 |
bem bem XX Bemba |
|
70 |
ben ben bn Bengali |
|
71 |
ber ber XX Berber (Other) |
|
72 |
bho bho XX Bhojpuri |
|
73 |
bih bih bh Bihari |
|
74 |
bik bik XX Bikol |
|
75 |
bin bin XX Bini |
|
76 |
bis bis bi Bislama |
|
77 |
bla bla XX Siksika |
|
78 |
bnt bnt XX Bantu (Other) |
|
79 |
bod tib bo Tibetan |
|
80 |
bos bos bs Bosnian |
|
81 |
bra bra XX Braj |
|
82 |
bre bre br Breton |
|
83 |
btk btk XX Batak (Indonesia) |
|
84 |
bua bua XX Buriat |
|
85 |
bug bug XX Buginese |
|
86 |
bul bul bg Bulgarian |
|
87 |
byn byn XX Blin; Bilin |
|
88 |
cad cad XX Caddo |
|
89 |
cai cai XX Central American Indian (Other) |
|
90 |
car car XX Carib |
|
91 |
cat cat ca Catalan; Valencian |
|
92 |
cau cau XX Caucasian (Other) |
|
93 |
ceb ceb XX Cebuano |
|
94 |
cel cel XX Celtic (Other) |
|
95 |
ces cze cs Czech |
|
96 |
cha cha ch Chamorro |
|
97 |
chb chb XX Chibcha |
|
98 |
che che ce Chechen |
|
99 |
chg chg XX Chagatai |
|
100 |
chk chk XX Chuukese |
|
101 |
chm chm XX Mari |
|
102 |
chn chn XX Chinook jargon |
|
103 |
cho cho XX Choctaw |
|
104 |
chp chp XX Chipewyan |
|
105 |
chr chr XX Cherokee |
|
106 |
chu chu cu Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic |
|
107 |
chv chv cv Chuvash |
|
108 |
chy chy XX Cheyenne |
|
109 |
cmc cmc XX Chamic languages |
|
110 |
cop cop XX Coptic |
|
111 |
cor cor kw Cornish |
|
112 |
cos cos co Corsican |
|
113 |
cpe cpe XX Creoles and pidgins, English based (Other) |
|
114 |
cpf cpf XX Creoles and pidgins, French-based (Other) |
|
115 |
cpp cpp XX Creoles and pidgins, Portuguese-based (Other) |
|
116 |
cre cre cr Cree |
|
117 |
crh crh XX Crimean Tatar; Crimean Turkish |
|
118 |
crp crp XX Creoles and pidgins (Other) |
|
119 |
csb csb XX Kashubian |
|
120 |
cus cus XX Cushitic (Other) |
|
121 |
cym wel cy Welsh |
|
122 |
dak dak XX Dakota |
|
123 |
dan dan da Danish |
|
124 |
dar dar XX Dargwa |
|
125 |
day day XX Dayak |
|
126 |
del del XX Delaware |
|
127 |
den den XX Slave (Athapascan) |
|
128 |
deu ger de German |
|
129 |
dgr dgr XX Dogrib |
|
130 |
din din XX Dinka |
|
131 |
div div dv Divehi; Dhivehi; Maldivian |
|
132 |
doi doi XX Dogri |
|
133 |
dra dra XX Dravidian (Other) |
|
134 |
dsb dsb XX Lower Sorbian |
|
135 |
dua dua XX Duala |
|
136 |
dum dum XX Dutch, Middle (ca. 1050-1350) |
|
137 |
dyu dyu XX Dyula |
|
138 |
dzo dzo dz Dzongkha |
|
139 |
efi efi XX Efik |
|
140 |
egy egy XX Egyptian (Ancient) |
|
141 |
eka eka XX Ekajuk |
|
142 |
ell gre el Greek, Modern (1453-) |
|
143 |
elx elx XX Elamite |
|
144 |
eng eng en English |
|
145 |
enm enm XX English, Middle (1100-1500) |
|
146 |
epo epo eo Esperanto |
|
147 |
est est et Estonian |
|
148 |
eus baq eu Basque |
|
149 |
ewe ewe ee Ewe |
|
150 |
ewo ewo XX Ewondo |
|
151 |
fan fan XX Fang |
|
152 |
fao fao fo Faroese |
|
153 |
fas per fa Persian |
|
154 |
fat fat XX Fanti |
|
155 |
fij fij fj Fijian |
|
156 |
fil fil XX Filipino; Pilipino |
|
157 |
fin fin fi Finnish |
|
158 |
fiu fiu XX Finno-Ugrian (Other) |
|
159 |
fon fon XX Fon |
|
160 |
fra fre fr French |
|
161 |
frm frm XX French, Middle (ca. 1400-1600) |
|
162 |
fro fro XX French, Old (842-ca. 1400) |
|
163 |
frr frr XX Northern Frisian |
|
164 |
frs frs XX Eastern Frisian |
|
165 |
fry fry fy Western Frisian |
|
166 |
ful ful ff Fulah |
|
167 |
fur fur XX Friulian |
|
168 |
gaa gaa XX Ga |
|
169 |
gay gay XX Gayo |
|
170 |
gba gba XX Gbaya |
|
171 |
gem gem XX Germanic (Other) |
|
172 |
gez gez XX Geez |
|
173 |
gil gil XX Gilbertese |
|
174 |
gla gla gd Gaelic; Scottish Gaelic |
|
175 |
gle gle ga Irish |
|
176 |
glg glg gl Galician |
|
177 |
glv glv gv Manx |
|
178 |
gmh gmh XX German, Middle High (ca. 1050-1500) |
|
179 |
goh goh XX German, Old High (ca. 750-1050) |
|
180 |
gon gon XX Gondi |
|
181 |
gor gor XX Gorontalo |
|
182 |
got got XX Gothic |
|
183 |
grb grb XX Grebo |
|
184 |
grc grc XX Greek, Ancient (to 1453) |
|
185 |
grn grn gn Guarani |
|
186 |
gsw gsw XX Alemanic; Swiss German |
|
187 |
guj guj gu Gujarati |
|
188 |
gwi gwi XX Gwich´in |
|
189 |
hai hai XX Haida |
|
190 |
hat hat ht Haitian; Haitian Creole |
|
191 |
hau hau ha Hausa |
|
192 |
haw haw XX Hawaiian |
|
193 |
heb heb he Hebrew |
|
194 |
her her hz Herero |
|
195 |
hil hil XX Hiligaynon |
|
196 |
him him XX Himachali |
|
197 |
hin hin hi Hindi |
|
198 |
hit hit XX Hittite |
|
199 |
hmn hmn XX Hmong |
|
200 |
hmo hmo ho Hiri Motu |
|
201 |
hrv scr hr Croatian |
|
202 |
hsb hsb XX Upper Sorbian |
|
203 |
hun hun hu Hungarian |
|
204 |
hup hup XX Hupa |
|
205 |
hye arm hy Armenian |
|
206 |
iba iba XX Iban |
|
207 |
ibo ibo ig Igbo |
|
208 |
ido ido io Ido |
|
209 |
iii iii ii Sichuan Yi |
|
210 |
ijo ijo XX Ijo |
|
211 |
iku iku iu Inuktitut |
|
212 |
ile ile ie Interlingue |
|
213 |
ilo ilo XX Iloko |
|
214 |
ina ina ia Interlingua (International Auxiliary Language Association) |
|
215 |
inc inc XX Indic (Other) |
|
216 |
ind ind id Indonesian |
|
217 |
ine ine XX Indo-European (Other) |
|
218 |
inh inh XX Ingush |
|
219 |
ipk ipk ik Inupiaq |
|
220 |
ira ira XX Iranian (Other) |
|
221 |
iro iro XX Iroquoian languages |
|
222 |
isl ice is Icelandic |
|
223 |
ita ita it Italian |
|
224 |
jav jav jv Javanese |
|
225 |
jbo jbo XX Lojban |
|
226 |
jpn jpn ja Japanese |
|
227 |
jpr jpr XX Judeo-Persian |
|
228 |
jrb jrb XX Judeo-Arabic |
|
229 |
kaa kaa XX Kara-Kalpak |
|
230 |
kab kab XX Kabyle |
|
231 |
kac kac XX Kachin |
|
232 |
kal kal kl Kalaallisut; Greenlandic |
|
233 |
kam kam XX Kamba |
|
234 |
kan kan kn Kannada |
|
235 |
kar kar XX Karen |
|
236 |
kas kas ks Kashmiri |
|
237 |
kat geo ka Georgian |
|
238 |
kau kau kr Kanuri |
|
239 |
kaw kaw XX Kawi |
|
240 |
kaz kaz kk Kazakh |
|
241 |
kbd kbd XX Kabardian |
|
242 |
kha kha XX Khasi |
|
243 |
khi khi XX Khoisan (Other) |
|
244 |
khm khm km Khmer |
|
245 |
kho kho XX Khotanese |
|
246 |
kik kik ki Kikuyu; Gikuyu |
|
247 |
kin kin rw Kinyarwanda |
|
248 |
kir kir ky Kirghiz |
|
249 |
kmb kmb XX Kimbundu |
|
250 |
kok kok XX Konkani |
|
251 |
kom kom kv Komi |
|
252 |
kon kon kg Kongo |
|
253 |
kor kor ko Korean |
|
254 |
kos kos XX Kosraean |
|
255 |
kpe kpe XX Kpelle |
|
256 |
krc krc XX Karachay-Balkar |
|
257 |
krl krl XX Karelian |
|
258 |
kro kro XX Kru |
|
259 |
kru kru XX Kurukh |
|
260 |
kua kua kj Kuanyama; Kwanyama |
|
261 |
kum kum XX Kumyk |
|
262 |
kur kur ku Kurdish |
|
263 |
kut kut XX Kutenai |
|
264 |
lad lad XX Ladino |
|
265 |
lah lah XX Lahnda |
|
266 |
lam lam XX Lamba |
|
267 |
lao lao lo Lao |
|
268 |
lat lat la Latin |
|
269 |
lav lav lv Latvian |
|
270 |
lez lez XX Lezghian |
|
271 |
lim lim li Limburgan; Limburger; Limburgish |
|
272 |
lin lin ln Lingala |
|
273 |
lit lit lt Lithuanian |
|
274 |
lol lol XX Mongo |
|
275 |
loz loz XX Lozi |
|
276 |
ltz ltz lb Luxembourgish; Letzeburgesch |
|
277 |
lua lua XX Luba-Lulua |
|
278 |
lub lub lu Luba-Katanga |
|
279 |
lug lug lg Ganda |
|
280 |
lui lui XX Luiseno |
|
281 |
lun lun XX Lunda |
|
282 |
luo luo XX Luo (Kenya and Tanzania) |
|
283 |
lus lus XX Lushai |
|
284 |
mad mad XX Madurese |
|
285 |
mag mag XX Magahi |
|
286 |
mah mah mh Marshallese |
|
287 |
mai mai XX Maithili |
|
288 |
mak mak XX Makasar |
|
289 |
mal mal ml Malayalam |
|
290 |
man man XX Mandingo |
|
291 |
map map XX Austronesian (Other) |
|
292 |
mar mar mr Marathi |
|
293 |
mas mas XX Masai |
|
294 |
mdf mdf XX Moksha |
|
295 |
mdr mdr XX Mandar |
|
296 |
men men XX Mende |
|
297 |
mga mga XX Irish, Middle (900-1200) |
|
298 |
mic mic XX Mi'kmaq; Micmac |
|
299 |
min min XX Minangkabau |
|
300 |
mis mis XX Miscellaneous languages |
|
301 |
mkd mac mk Macedonian |
|
302 |
mkh mkh XX Mon-Khmer (Other) |
|
303 |
mlg mlg mg Malagasy |
|
304 |
mlt mlt mt Maltese |
|
305 |
mnc mnc XX Manchu |
|
306 |
mni mni XX Manipuri |
|
307 |
mno mno XX Manobo languages |
|
308 |
moh moh XX Mohawk |
|
309 |
mol mol mo Moldavian |
|
310 |
mon mon mn Mongolian |
|
311 |
mos mos XX Mossi |
|
312 |
mri mao mi Maori |
|
313 |
msa may ms Malay |
|
314 |
mul mul XX Multiple languages |
|
315 |
mun mun XX Munda languages |
|
316 |
mus mus XX Creek |
|
317 |
mwl mwl XX Mirandese |
|
318 |
mwr mwr XX Marwari |
|
319 |
mya bur my Burmese |
|
320 |
myn myn XX Mayan languages |
|
321 |
myv myv XX Erzya |
|
322 |
nah nah XX Nahuatl |
|
323 |
nai nai XX North American Indian |
|
324 |
nap nap XX Neapolitan |
|
325 |
nau nau na Nauru |
|
326 |
nav nav nv Navajo; Navaho |
|
327 |
nbl nbl nr Ndebele, South; South Ndebele |
|
328 |
nde nde nd Ndebele, North; North Ndebele |
|
329 |
ndo ndo ng Ndonga |
|
330 |
nds nds XX Low German; Low Saxon; German, Low; Saxon, Low |
|
331 |
nep nep ne Nepali |
|
332 |
new new XX Newari; Nepal Bhasa |
|
333 |
nia nia XX Nias |
|
334 |
nic nic XX Niger-Kordofanian (Other) |
|
335 |
niu niu XX Niuean |
|
336 |
nld dut nl Dutch; Flemish |
|
337 |
nno nno nn Norwegian Nynorsk; Nynorsk, Norwegian |
|
338 |
nob nob nb Norwegian Bokmål; Bokmål, Norwegian |
|
339 |
nog nog XX Nogai |
|
340 |
non non XX Norse, Old |
|
341 |
nor nor no Norwegian |
|
342 |
nqo nqo XX N'ko |
|
343 |
nso nso XX Northern Sotho, Pedi; Sepedi |
|
344 |
nub nub XX Nubian languages |
|
345 |
nwc nwc XX Classical Newari; Old Newari; Classical Nepal Bhasa |
|
346 |
nya nya ny Chichewa; Chewa; Nyanja |
|
347 |
nym nym XX Nyamwezi |
|
348 |
nyn nyn XX Nyankole |
|
349 |
nyo nyo XX Nyoro |
|
350 |
nzi nzi XX Nzima |
|
351 |
oci oci oc Occitan (post 1500); Provençal |
|
352 |
oji oji oj Ojibwa |
|
353 |
ori ori or Oriya |
|
354 |
orm orm om Oromo |
|
355 |
osa osa XX Osage |
|
356 |
oss oss os Ossetian; Ossetic |
|
357 |
ota ota XX Turkish, Ottoman (1500-1928) |
|
358 |
oto oto XX Otomian languages |
|
359 |
paa paa XX Papuan (Other) |
|
360 |
pag pag XX Pangasinan |
|
361 |
pal pal XX Pahlavi |
|
362 |
pam pam XX Pampanga |
|
363 |
pan pan pa Panjabi; Punjabi |
|
364 |
pap pap XX Papiamento |
|
365 |
pau pau XX Palauan |
|
366 |
peo peo XX Persian, Old (ca. 600-400 B.C.) |
|
367 |
phi phi XX Philippine (Other) |
|
368 |
phn phn XX Phoenician |
|
369 |
pli pli pi Pali |
|
370 |
pol pol pl Polish |
|
371 |
pon pon XX Pohnpeian |
|
372 |
por por pt Portuguese |
|
373 |
pra pra XX Prakrit languages |
|
374 |
pro pro XX Provençal, Old (to 1500) |
|
375 |
pus pus ps Pushto |
|
376 |
qaa-qtz qaa-qtz XX Reserved for local use |
|
377 |
que que qu Quechua |
|
378 |
raj raj XX Rajasthani |
|
379 |
rap rap XX Rapanui |
|
380 |
rar rar XX Rarotongan |
|
381 |
roa roa XX Romance (Other) |
|
382 |
roh roh rm Raeto-Romance |
|
383 |
rom rom XX Romany |
|
384 |
ron rum ro Romanian |
|
385 |
run run rn Rundi |
|
386 |
rup rup XX Aromanian; Arumanian; Macedo-Romanian |
|
387 |
rus rus ru Russian |
|
388 |
sad sad XX Sandawe |
|
389 |
sag sag sg Sango |
|
390 |
sah sah XX Yakut |
|
391 |
sai sai XX South American Indian (Other) |
|
392 |
sal sal XX Salishan languages |
|
393 |
sam sam XX Samaritan Aramaic |
|
394 |
san san sa Sanskrit |
|
395 |
sas sas XX Sasak |
|
396 |
sat sat XX Santali |
|
397 |
scn scn XX Sicilian |
|
398 |
sco sco XX Scots |
|
399 |
sel sel XX Selkup |
|
400 |
sem sem XX Semitic (Other) |
|
401 |
sga sga XX Irish, Old (to 900) |
|
402 |
sgn sgn XX Sign Languages |
|
403 |
shn shn XX Shan |
|
404 |
sid sid XX Sidamo |
|
405 |
sin sin si Sinhala; Sinhalese |
|
406 |
sio sio XX Siouan languages |
|
407 |
sit sit XX Sino-Tibetan (Other) |
|
408 |
sla sla XX Slavic (Other) |
|
409 |
slk slo sk Slovak |
|
410 |
slv slv sl Slovenian |
|
411 |
sma sma XX Southern Sami |
|
412 |
sme sme se Northern Sami |
|
413 |
smi smi XX Sami languages (Other) |
|
414 |
smj smj XX Lule Sami |
|
415 |
smn smn XX Inari Sami |
|
416 |
smo smo sm Samoan |
|
417 |
sms sms XX Skolt Sami |
|
418 |
sna sna sn Shona |
|
419 |
snd snd sd Sindhi |
|
420 |
snk snk XX Soninke |
|
421 |
sog sog XX Sogdian |
|
422 |
som som so Somali |
|
423 |
son son XX Songhai |
|
424 |
sot sot st Sotho, Southern |
|
425 |
spa spa es Spanish; Castilian |
|
426 |
sqi alb sq Albanian |
|
427 |
srd srd sc Sardinian |
|
428 |
srn srn XX Sranan Tongo |
|
429 |
srp scc sr Serbian |
|
430 |
srr srr XX Serer |
|
431 |
ssa ssa XX Nilo-Saharan (Other) |
|
432 |
ssw ssw ss Swati |
|
433 |
suk suk XX Sukuma |
|
434 |
sun sun su Sundanese |
|
435 |
sus sus XX Susu |
|
436 |
sux sux XX Sumerian |
|
437 |
swa swa sw Swahili |
|
438 |
swe swe sv Swedish |
|
439 |
syr syr XX Syriac |
|
440 |
tah tah ty Tahitian |
|
441 |
tai tai XX Tai (Other) |
|
442 |
tam tam ta Tamil |
|
443 |
tat tat tt Tatar |
|
444 |
tel tel te Telugu |
|
445 |
tem tem XX Timne |
|
446 |
ter ter XX Tereno |
|
447 |
tet tet XX Tetum |
|
448 |
tgk tgk tg Tajik |
|
449 |
tgl tgl tl Tagalog |
|
450 |
tha tha th Thai |
|
451 |
tig tig XX Tigre |
|
452 |
tir tir ti Tigrinya |
|
453 |
tiv tiv XX Tiv |
|
454 |
tkl tkl XX Tokelau |
|
455 |
tlh tlh XX Klingon; tlhIngan-Hol |
|
456 |
tli tli XX Tlingit |
|
457 |
tmh tmh XX Tamashek |
|
458 |
tog tog XX Tonga (Nyasa) |
|
459 |
ton ton to Tonga (Tonga Islands) |
|
460 |
tpi tpi XX Tok Pisin |
|
461 |
tsi tsi XX Tsimshian |
|
462 |
tsn tsn tn Tswana |
|
463 |
tso tso ts Tsonga |
|
464 |
tuk tuk tk Turkmen |
|
465 |
tum tum XX Tumbuka |
|
466 |
tup tup XX Tupi languages |
|
467 |
tur tur tr Turkish |
|
468 |
tut tut XX Altaic (Other) |
|
469 |
tvl tvl XX Tuvalu |
|
470 |
twi twi tw Twi |
|
471 |
tyv tyv XX Tuvinian |
|
472 |
udm udm XX Udmurt |
|
473 |
uga uga XX Ugaritic |
|
474 |
uig uig ug Uighur; Uyghur |
|
475 |
ukr ukr uk Ukrainian |
|
476 |
umb umb XX Umbundu |
|
477 |
und und XX Undetermined |
|
478 |
urd urd ur Urdu |
|
479 |
uzb uzb uz Uzbek |
|
480 |
vai vai XX Vai |
|
481 |
ven ven ve Venda |
|
482 |
vie vie vi Vietnamese |
|
483 |
vol vol vo Volapük |
|
484 |
vot vot XX Votic |
|
485 |
wak wak XX Wakashan languages |
|
486 |
wal wal XX Walamo |
|
487 |
war war XX Waray |
|
488 |
was was XX Washo |
|
489 |
wen wen XX Sorbian languages |
|
490 |
wln wln wa Walloon |
|
491 |
wol wol wo Wolof |
|
492 |
xal xal XX Kalmyk; Oirat |
|
493 |
xho xho xh Xhosa |
|
494 |
yao yao XX Yao |
|
495 |
yap yap XX Yapese |
|
496 |
yid yid yi Yiddish |
|
497 |
yor yor yo Yoruba |
|
498 |
ypk ypk XX Yupik languages |
|
499 |
zap zap XX Zapotec |
|
500 |
zen zen XX Zenaga |
|
501 |
zha zha za Zhuang; Chuang |
|
502 |
zho chi zh Chinese |
|
503 |
znd znd XX Zande |
|
504 |
zul zul zu Zulu |
|
505 |
zun zun XX Zuni |
|
506 |
zxx zxx XX No linguistic content |
|
0 | 507 |
tags/v2_0_0_Build_2038/frameworks/_fwAndami/src/org/gvsig/andami/plugins/PluginClassLoader.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
* |
|
19 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ib??ez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* IVER T.I. S.A |
|
34 |
* Salamanca 50 |
|
35 |
* 46005 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963163400 |
|
39 |
* dac@iver.es |
|
40 |
*/ |
|
41 |
package org.gvsig.andami.plugins; |
|
42 |
|
|
43 |
import java.io.DataInputStream; |
|
44 |
import java.io.File; |
|
45 |
import java.io.FileInputStream; |
|
46 |
import java.io.IOException; |
|
47 |
import java.io.InputStream; |
|
48 |
import java.net.MalformedURLException; |
|
49 |
import java.net.URL; |
|
50 |
import java.net.URLClassLoader; |
|
51 |
import java.security.AllPermission; |
|
52 |
import java.security.CodeSource; |
|
53 |
import java.security.PermissionCollection; |
|
54 |
import java.util.ArrayList; |
|
55 |
import java.util.Enumeration; |
|
56 |
import java.util.Hashtable; |
|
57 |
import java.util.List; |
|
58 |
import java.util.StringTokenizer; |
|
59 |
import java.util.zip.ZipEntry; |
|
60 |
import java.util.zip.ZipException; |
|
61 |
import java.util.zip.ZipFile; |
|
62 |
|
|
63 |
import org.slf4j.Logger; |
|
64 |
import org.slf4j.LoggerFactory; |
|
65 |
|
|
66 |
import org.gvsig.andami.messages.Messages; |
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
/** |
|
71 |
* <p>Class loader which loads the classes requested by the |
|
72 |
* plugins. It first tries to search in the classpath, then it requests |
|
73 |
* the class to the parent classloader, then it searches in the owns |
|
74 |
* plugins' library dir, and if all these methods fail, it tries to load |
|
75 |
* the class from any of the depended plugins. Finally, if this also |
|
76 |
* fails, the other classloaders provided in the <code>addLoaders</code> method |
|
77 |
* are requested to load the class.</p> |
|
78 |
* |
|
79 |
* <p>The class loader can also be used to load resources from the |
|
80 |
* plugin's directory by using the <code>getResource()</code> method.</p> |
|
81 |
* |
|
82 |
* @author Fernando Gonz?lez Cort?s |
|
83 |
*/ |
|
84 |
public class PluginClassLoader extends URLClassLoader { |
|
85 |
/** DOCUMENT ME! */ |
|
86 |
private static Logger logger = LoggerFactory.getLogger(PluginClassLoader.class.getName()); |
|
87 |
|
|
88 |
/** DOCUMENT ME! */ |
|
89 |
private Hashtable clasesJar = new Hashtable(); |
|
90 |
|
|
91 |
/** DOCUMENT ME! */ |
|
92 |
private File baseDir; |
|
93 |
private PluginClassLoader[] pluginLoaders; |
|
94 |
private static ArrayList otherLoaders=new ArrayList(); |
|
95 |
private boolean isOtherLoader=false; |
|
96 |
|
|
97 |
/** |
|
98 |
* Creates a new PluginClassLoader object. |
|
99 |
* |
|
100 |
* @param jars Array with the search paths where classes will be searched |
|
101 |
* @param baseDir Base directory for this plugin. This is the directory |
|
102 |
* which will be used as basedir in the <code>getResources</code> method. |
|
103 |
* @param cl The parent classloader of this classloader. It will be used to |
|
104 |
* search classes before trying to search in the plugin's directory |
|
105 |
* @param pluginLoaders The classloaders of the depended plugins. |
|
106 |
* |
|
107 |
* @throws IOException |
|
108 |
*/ |
|
109 |
public PluginClassLoader(URL[] jars, String baseDir, ClassLoader cl, |
|
110 |
PluginClassLoader[] pluginLoaders) throws IOException { |
|
111 |
super(jars, cl); |
|
112 |
this.baseDir = new File(new File(baseDir).getAbsolutePath()); |
|
113 |
this.pluginLoaders = pluginLoaders; |
|
114 |
|
|
115 |
ZipFile[] jarFiles = new ZipFile[jars.length]; |
|
116 |
|
|
117 |
for (int i = 0; i < jars.length; i++) { |
|
118 |
try { |
|
119 |
jarFiles[i] = new ZipFile(jars[i].getPath()); |
|
120 |
|
|
121 |
Enumeration entradas = jarFiles[i].entries(); |
|
122 |
|
|
123 |
while (entradas.hasMoreElements()) { |
|
124 |
ZipEntry file = (ZipEntry) entradas.nextElement(); |
|
125 |
String fileName = file.getName(); |
|
126 |
|
|
127 |
if (!fileName.toLowerCase().endsWith(".class")) { //$NON-NLS-1$ |
|
128 |
|
|
129 |
continue; |
|
130 |
} |
|
131 |
|
|
132 |
fileName = fileName.substring(0, fileName.length() - 6) |
|
133 |
.replace('/', '.'); |
|
134 |
|
|
135 |
if (clasesJar.get(fileName) != null) { |
|
136 |
logger.warn(Messages |
|
137 |
.getString( |
|
138 |
"PluginClassLoader.Dos_clases_con_el_mismo_nombre_en_el_plugin") + |
|
139 |
": " + fileName + " "+ Messages.getString("en") + " " + |
|
140 |
jarFiles[i].getName() + " " + Messages.getString("y_en") + " " + |
|
141 |
((ZipFile) clasesJar.get(fileName)).getName()); |
|
142 |
} |
|
143 |
else { |
|
144 |
clasesJar.put(fileName, jarFiles[i]); |
|
145 |
} |
|
146 |
} |
|
147 |
} catch (ZipException e) { |
|
148 |
throw new IOException(e.getMessage() + " Jar: " + |
|
149 |
jars[i].getPath() + ": " + jarFiles[i]); |
|
150 |
} catch (IOException e) { |
|
151 |
throw e; |
|
152 |
} |
|
153 |
} |
|
154 |
} |
|
155 |
|
|
156 |
/** |
|
157 |
* DOCUMENT ME! |
|
158 |
* |
|
159 |
* @param name DOCUMENT ME! |
|
160 |
* |
|
161 |
* @return DOCUMENT ME! |
|
162 |
* |
|
163 |
* @throws ClassNotFoundException DOCUMENT ME! |
|
164 |
*/ |
|
165 |
protected Class singleLoadClass(String name) throws ClassNotFoundException { |
|
166 |
// Buscamos en las clases de las librer?as del plugin |
|
167 |
Class c = findLoadedClass(name); |
|
168 |
|
|
169 |
if (c != null) { |
|
170 |
return c; |
|
171 |
} |
|
172 |
|
|
173 |
try { |
|
174 |
ZipFile jar = (ZipFile) clasesJar.get(name); |
|
175 |
|
|
176 |
//No est? en ning?n jar |
|
177 |
if (jar == null) { |
|
178 |
//Buscamos en el directorio de clases |
|
179 |
String classFileName = baseDir + "/classes/" + |
|
180 |
name.replace('.', '/') + ".class"; |
|
181 |
File f = new File(classFileName); |
|
182 |
if (f.exists()){ |
|
183 |
byte[] data = loadClassData(f); |
|
184 |
c = defineClass(name, data, 0, data.length); |
|
185 |
|
|
186 |
if (logger.isDebugEnabled()) { |
|
187 |
logger.debug("Class {} found in the classes folder by the " |
|
188 |
+ "classloader for the plugin {}", |
|
189 |
name, baseDir); |
|
190 |
} |
|
191 |
|
|
192 |
}else{ |
|
193 |
//Buscamos en los otros plugins |
|
194 |
for (int i = 0; i < pluginLoaders.length; i++) { |
|
195 |
try |
|
196 |
{ |
|
197 |
if (pluginLoaders[i] != null){ |
|
198 |
c = pluginLoaders[i].singleLoadClass(name); |
|
199 |
}else{ |
|
200 |
//TODO El pluginLoaders[i] puede ser nulo? |
|
201 |
logger.warn("PluginLoaders[i] es nulo"); |
|
202 |
} |
|
203 |
} |
|
204 |
catch (ClassNotFoundException e) |
|
205 |
{ |
|
206 |
// Si no la encontramos en el primer plugin, capturamos la exceptci?n |
|
207 |
// porque es probable que la encontremos en el resto de plugins. |
|
208 |
} |
|
209 |
|
|
210 |
if (c != null) { |
|
211 |
break; |
|
212 |
} |
|
213 |
} |
|
214 |
} |
|
215 |
} else { |
|
216 |
String fileName = name.replace('.', '/') + ".class"; |
|
217 |
ZipEntry classFile = jar.getEntry(fileName); |
|
218 |
byte[] data = loadClassData(classFile, |
|
219 |
jar.getInputStream(classFile)); |
|
220 |
|
|
221 |
c = defineClass(name, data, 0, data.length); |
|
222 |
|
|
223 |
if (logger.isDebugEnabled()) { |
|
224 |
logger.debug("Class {} found in the jar file {} by the " |
|
225 |
+ "classloader for the plugin {}", |
|
226 |
new Object[] { name, jar.getName(), baseDir }); |
|
227 |
} |
|
228 |
} |
|
229 |
|
|
230 |
if (c == null) { |
|
231 |
throw new ClassNotFoundException(name); |
|
232 |
} |
|
233 |
|
|
234 |
return c; |
|
235 |
} catch (IOException e) { |
|
236 |
throw new ClassNotFoundException(Messages.getString( |
|
237 |
"PluginClassLoader.Error_reading_file") + name); |
|
238 |
} |
|
239 |
} |
|
240 |
|
|
241 |
/** |
|
242 |
* Carga la clase |
|
243 |
* |
|
244 |
* @param name Nombre de la clase |
|
245 |
* @param resolve Si se ha de resolver la clase o no |
|
246 |
* |
|
247 |
* @return Clase cargada |
|
248 |
* |
|
249 |
* @throws ClassNotFoundException Si no se pudo encontrar la clase |
|
250 |
*/ |
|
251 |
protected Class loadClass(String name, boolean resolve) |
|
252 |
throws ClassNotFoundException { |
|
253 |
Class c = null; |
|
254 |
|
|
255 |
// Intentamos cargar con el system classloader |
|
256 |
try { |
|
257 |
if (!isOtherLoader) |
|
258 |
c = super.loadClass(name, resolve); |
|
259 |
logger.debug("Class {} found by the system classloader", name); |
|
260 |
} catch (ClassNotFoundException e1) { |
|
261 |
try { |
|
262 |
c = singleLoadClass(name); |
|
263 |
} catch (ClassNotFoundException e2) { |
|
264 |
try { |
|
265 |
isOtherLoader=true; |
|
266 |
c = loadOtherClass(name); |
|
267 |
}catch (ClassNotFoundException e3) { |
|
268 |
// throw new ClassNotFoundException(Messages.getString( |
|
269 |
// "PluginClassLoader.Error_reading_file") |
|
270 |
// + name, e3); |
|
271 |
throw new ClassNotFoundException("Class " + name |
|
272 |
+ " not found through the plugin " + baseDir, e3); |
|
273 |
}finally { |
|
274 |
isOtherLoader=false; |
|
275 |
} |
|
276 |
} |
|
277 |
} |
|
278 |
if (c==null) |
|
279 |
throw new ClassNotFoundException(Messages.getString( |
|
280 |
"PluginClassLoader.Error_reading_file") + name); |
|
281 |
if (resolve) { |
|
282 |
resolveClass(c); |
|
283 |
} |
|
284 |
return c; |
|
285 |
} |
|
286 |
private Class loadOtherClass(String name) |
|
287 |
throws ClassNotFoundException |
|
288 |
{ |
|
289 |
ClassLoader[] ocl=(ClassLoader[])otherLoaders.toArray(new ClassLoader[0]); |
|
290 |
Class c=null; |
|
291 |
for (int i=0;i<ocl.length;i++) { |
|
292 |
c=ocl[i].loadClass(name); |
|
293 |
if (c != null) { |
|
294 |
logger |
|
295 |
.debug( |
|
296 |
"Class {} found by the alternative classloaders of the plugin {}", |
|
297 |
name, baseDir); |
|
298 |
|
|
299 |
return c; |
|
300 |
} |
|
301 |
} |
|
302 |
throw new ClassNotFoundException(name); |
|
303 |
} |
|
304 |
|
|
305 |
/** |
|
306 |
* obtiene el array de bytes de la clase |
|
307 |
* |
|
308 |
* @param classFile Entrada dentro del jar contiene los bytecodes de la |
|
309 |
* clase (el .class) |
|
310 |
* @param is InputStream para leer la entrada del jar |
|
311 |
* |
|
312 |
* @return Bytes de la clase |
|
313 |
* |
|
314 |
* @throws IOException Si no se puede obtener el .class del jar |
|
315 |
*/ |
|
316 |
private byte[] loadClassData(ZipEntry classFile, InputStream is) |
|
317 |
throws IOException { |
|
318 |
// Get size of class file |
|
319 |
int size = (int) classFile.getSize(); |
|
320 |
|
|
321 |
// Reserve space to read |
|
322 |
byte[] buff = new byte[size]; |
|
323 |
|
|
324 |
// Get stream to read from |
|
325 |
DataInputStream dis = new DataInputStream(is); |
|
326 |
|
|
327 |
// Read in data |
|
328 |
dis.readFully(buff); |
|
329 |
|
|
330 |
// close stream |
|
331 |
dis.close(); |
|
332 |
|
|
333 |
// return data |
|
334 |
return buff; |
|
335 |
} |
|
336 |
|
|
337 |
/** |
|
338 |
* Gets the bytes of a File |
|
339 |
* |
|
340 |
* @param file File |
|
341 |
* |
|
342 |
* @return bytes of file |
|
343 |
* |
|
344 |
* @throws IOException If the operation fails |
|
345 |
*/ |
|
346 |
private byte[] loadClassData(File file) throws IOException { |
|
347 |
InputStream is = new FileInputStream(file); |
|
348 |
|
|
349 |
// Get the size of the file |
|
350 |
long length = file.length(); |
|
351 |
|
|
352 |
// You cannot create an array using a long type. |
|
353 |
// It needs to be an int type. |
|
354 |
// Before converting to an int type, check |
|
355 |
// to ensure that file is not larger than Integer.MAX_VALUE. |
|
356 |
if (length > Integer.MAX_VALUE) { |
|
357 |
// File is too large |
|
358 |
} |
|
359 |
|
|
360 |
// Create the byte array to hold the data |
|
361 |
byte[] bytes = new byte[(int) length]; |
|
362 |
|
|
363 |
// Read in the bytes |
|
364 |
int offset = 0; |
|
365 |
int numRead = 0; |
|
366 |
|
|
367 |
while ((offset < bytes.length) && |
|
368 |
((numRead = is.read(bytes, offset, bytes.length - offset)) >= 0)) { |
|
369 |
offset += numRead; |
|
370 |
} |
|
371 |
|
|
372 |
// Ensure all the bytes have been read in |
|
373 |
if (offset < bytes.length) { |
|
374 |
throw new IOException("Could not completely read file " + |
|
375 |
file.getName()); |
|
376 |
} |
|
377 |
|
|
378 |
// Close the input stream and return bytes |
|
379 |
is.close(); |
|
380 |
|
|
381 |
return bytes; |
|
382 |
} |
|
383 |
|
|
384 |
/** |
|
385 |
* Gets the requested resource. If the path is relative, its base directory |
|
386 |
* will be the one provided in the PluginClassLoader's constructor. |
|
387 |
* If the resource is not found, the parent classloader will be invoked |
|
388 |
* to try to get it. If it is not found, it will return null. |
|
389 |
* |
|
390 |
* @param res An absolute or relative path to the requested resource. |
|
391 |
* |
|
392 |
* @return Resource's URL if it was found, nul otherwise. |
|
393 |
*/ |
|
394 |
public URL getResource(String res) { |
|
395 |
try { |
|
396 |
ArrayList resource = new ArrayList(); |
|
397 |
StringTokenizer st = new StringTokenizer(res, "\\/"); |
|
398 |
|
|
399 |
while (st.hasMoreTokens()) { |
|
400 |
String token = st.nextToken(); |
|
401 |
resource.add(token); |
|
402 |
} |
|
403 |
|
|
404 |
URL ret = getResource(baseDir, resource); |
|
405 |
|
|
406 |
if (ret != null) { |
|
407 |
return ret; |
|
408 |
} |
|
409 |
} catch (Exception e) { |
|
410 |
e.printStackTrace(); |
|
411 |
} |
|
412 |
|
|
413 |
return super.getResource(res); |
|
414 |
} |
|
415 |
|
|
416 |
/** |
|
417 |
* Gets the requested resource. If the path is relative, its base directory |
|
418 |
* will be the one provided in the PluginClassLoader's constructor. |
|
419 |
* If the resource is not found, the parent classloader will be invoked |
|
420 |
* to try to get it. If it is not found, it will return null. |
|
421 |
* |
|
422 |
* @param res An absolute or relative path to the requested resource. |
|
423 |
* |
|
424 |
* @return Resource's URL if it was found, nul otherwise. |
|
425 |
*/ |
|
426 |
private URL getResource(File base, List res) { |
|
427 |
File[] files = base.listFiles(); |
|
428 |
|
|
429 |
String parte = (String) res.get(0); |
|
430 |
|
|
431 |
for (int i = 0; i < files.length; i++) { |
|
432 |
if (files[i].getName().compareTo(parte) == 0) { |
|
433 |
if (res.size() == 1) { |
|
434 |
try { |
|
435 |
return new URL("file:" + files[i].toString()); |
|
436 |
} catch (MalformedURLException e) { |
|
437 |
return null; |
|
438 |
} |
|
439 |
} else { |
|
440 |
return getResource(files[i], res.subList(1, res.size())); |
|
441 |
} |
|
442 |
} |
|
443 |
} |
|
444 |
|
|
445 |
return null; |
|
446 |
} |
|
447 |
|
|
448 |
/** |
|
449 |
* Returns the name of the plugin (the name of the directory containing |
|
450 |
* the plugin). |
|
451 |
* |
|
452 |
* @return An String containing the plugin's name. |
|
453 |
*/ |
|
454 |
public String getPluginName() { |
|
455 |
String ret = baseDir.getAbsolutePath().substring(baseDir.getAbsolutePath() |
|
456 |
.lastIndexOf(File.separatorChar) + |
|
457 |
1); |
|
458 |
|
|
459 |
return ret; |
|
460 |
} |
|
461 |
|
|
462 |
/* |
|
463 |
* @see java.security.SecureClassLoader#getPermissions(java.security.CodeSource) |
|
464 |
*/ |
|
465 |
protected PermissionCollection getPermissions(CodeSource codesource) { |
|
466 |
PermissionCollection perms = super.getPermissions(codesource); |
|
467 |
perms.add(new AllPermission()); |
|
468 |
|
|
469 |
return perms; |
|
470 |
} |
|
471 |
|
|
472 |
/** |
|
473 |
* Gets the plugin's base dir, the directory which will be used to |
|
474 |
* search resources. |
|
475 |
* |
|
476 |
* @return Returns the baseDir. |
|
477 |
*/ |
|
478 |
public String getBaseDir() { |
|
479 |
return baseDir.getAbsolutePath(); |
|
480 |
} |
|
481 |
|
|
482 |
/** |
|
483 |
* Adds other classloader to use when all the normal methods fail. |
|
484 |
* |
|
485 |
* @param classLoaders An ArrayList of ClassLoaders which will |
|
486 |
* be used to load classes when all the normal methods fail. |
|
487 |
*/ |
|
488 |
public static void addLoaders(ArrayList classLoaders) { |
|
489 |
otherLoaders.addAll(classLoaders); |
|
490 |
} |
|
491 |
|
|
492 |
@Override |
|
493 |
public String toString() { |
|
494 |
return super.toString() + " (" + getPluginName() + ")"; |
|
495 |
} |
|
496 |
} |
|
0 | 497 |
tags/v2_0_0_Build_2038/frameworks/_fwAndami/src/org/gvsig/andami/plugins/Extension.java | ||
---|---|---|
1 |
package org.gvsig.andami.plugins; |
|
2 |
|
|
3 |
import org.gvsig.andami.PluginServices; |
|
4 |
import org.gvsig.andami.PluginsLocator; |
|
5 |
import org.gvsig.andami.plugins.status.IExtensionStatus; |
|
6 |
|
|
7 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
8 |
* |
|
9 |
* Copyright (C) 2004-2007 IVER T.I. and Generalitat Valenciana. |
|
10 |
* |
|
11 |
* This program is free software; you can redistribute it and/or |
|
12 |
* modify it under the terms of the GNU General Public License |
|
13 |
* as published by the Free Software Foundation; either version 2 |
|
14 |
* of the License, or (at your option) any later version. |
|
15 |
* |
|
16 |
* This program is distributed in the hope that it will be useful, |
|
17 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
18 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
19 |
* GNU General Public License for more details. |
|
20 |
* |
|
21 |
* You should have received a copy of the GNU General Public License |
|
22 |
* along with this program; if not, write to the Free Software |
|
23 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
24 |
* |
|
25 |
* For more information, contact: |
|
26 |
* |
|
27 |
* Generalitat Valenciana |
|
28 |
* Conselleria d'Infraestructures i Transport |
|
29 |
* Av. Blasco Ib??ez, 50 |
|
30 |
* 46010 VALENCIA |
|
31 |
* SPAIN |
|
32 |
* |
|
33 |
* +34 963862235 |
|
34 |
* gvsig@gva.es |
|
35 |
* www.gvsig.gva.es |
|
36 |
* |
|
37 |
* or |
|
38 |
* |
|
39 |
* IVER T.I. S.A |
|
40 |
* Salamanca 50 |
|
41 |
* 46005 Valencia |
|
42 |
* Spain |
|
43 |
* |
|
44 |
* +34 963163400 |
|
45 |
* dac@iver.es |
|
46 |
*/ |
|
47 |
/* CVS MESSAGES: |
|
48 |
* |
|
49 |
* $Id$ |
|
50 |
* $Log$ |
|
51 |
* Revision 1.12 2007-09-17 06:33:34 caballero |
|
52 |
* unsaveddata |
|
53 |
* |
|
54 |
* Revision 1.11 2007/07/19 12:01:06 cesar |
|
55 |
* Add support for the new Andami termination process (and the unsaved data dialog) |
|
56 |
* |
|
57 |
* Revision 1.10 2007/05/31 07:42:17 cesar |
|
58 |
* Add ExclusiveUIExtension interface and clean the IExtension interface; update Extension, ExtensionDecorator and Launcher to reflect this change; add missing comments, translate existing ones to english |
|
59 |
* |
|
60 |
* Revision 1.9 2007/05/31 07:00:47 cesar |
|
61 |
* Add missing comments, translate existing ones to english |
|
62 |
* |
|
63 |
* Revision 1.8 2006/11/27 11:33:05 jmvivo |
|
64 |
* Soporte para que una clase tenga el control de la visibilidad y estado de las acciones del resto de extensiones. |
|
65 |
* |
|
66 |
* Revision 1.7 2006/09/15 10:39:18 caballero |
|
67 |
* multisplah y postInitialize |
|
68 |
* |
|
69 |
* Revision 1.6 2006/07/31 18:22:13 cesar |
|
70 |
* Rename finalize method to terminate method |
|
71 |
* |
|
72 |
* Revision 1.5 2006/05/02 15:53:06 jorpiell |
|
73 |
* Se ha cambiado la interfaz Extension por dos clases: una interfaz (IExtension) y una clase abstract(Extension). A partir de ahora todas las extensiones deben heredar de Extension |
|
74 |
* |
|
75 |
* |
|
76 |
*/ |
|
77 |
/** |
|
78 |
* Extensions are the way in which plugins extend Andami. Extensions |
|
79 |
* can add controls to user interface (GUI) and execute some code |
|
80 |
* when controls are activated. Every class implementing |
|
81 |
* {@link IExtension} is an extension, but directly implementing |
|
82 |
* that interface is discouraged. The preferred way to create |
|
83 |
* an extension is extending this absctract class. |
|
84 |
* |
|
85 |
* @see IExtension |
|
86 |
* |
|
87 |
* @author Jorge Piera Llodr? (piera_jor@gva.es) |
|
88 |
*/ |
|
89 |
public abstract class Extension implements IExtension { |
|
90 |
|
|
91 |
/* |
|
92 |
* (non-Javadoc) |
|
93 |
* @see com.iver.andami.plugins.IExtension#terminate() |
|
94 |
*/ |
|
95 |
public void terminate(){ |
|
96 |
|
Also available in: Unified diff