1 | package org.medias.eccad.presentation.composant; |
---|
2 | |
---|
3 | import javax.faces.component.*; |
---|
4 | import javax.faces.context.*; |
---|
5 | import java.io.*; |
---|
6 | |
---|
7 | |
---|
8 | public class ComposantPopup extends UIOutput { |
---|
9 | |
---|
10 | |
---|
11 | //**************************************// |
---|
12 | // VARIABLES |
---|
13 | //**************************************// |
---|
14 | |
---|
15 | private String classe; |
---|
16 | // private String onclick; |
---|
17 | private String style; |
---|
18 | // private String value; |
---|
19 | |
---|
20 | //**************************************// |
---|
21 | // CONSTRUCTEUR |
---|
22 | //**************************************// |
---|
23 | |
---|
24 | public ComposantPopup() { |
---|
25 | // TODO Auto-generated constructor stub |
---|
26 | } |
---|
27 | |
---|
28 | //**************************************// |
---|
29 | // DEBUT ENCODAGE COMPOSANT |
---|
30 | //**************************************// |
---|
31 | |
---|
32 | public void encodeBegin(FacesContext context) throws IOException { |
---|
33 | //system.out.println("encodebegin " ); |
---|
34 | //system.out.println(getAttributes().entrySet()); |
---|
35 | /** RECUPERARTION DES ATTRIBUTS DU COMPOSANT CARTE **/ |
---|
36 | |
---|
37 | if (getAttributes().containsKey("styleClass")) |
---|
38 | classe=(String)getAttributes().get("styleClass"); |
---|
39 | if (getAttributes().containsKey("style")) { |
---|
40 | //system.out.println("ici"); |
---|
41 | style=(String)getAttributes().get("style"); |
---|
42 | } |
---|
43 | // if (getAttributes().containsKey("onclick")) |
---|
44 | // onclick=(String)getAttributes().get("onclick"); |
---|
45 | |
---|
46 | /** ENCODAGE **/ |
---|
47 | |
---|
48 | ResponseWriter writer = context.getResponseWriter(); |
---|
49 | |
---|
50 | /** JAVASCRIPT **/ |
---|
51 | //String appel_javascript="<SCRIPT Language='Javascript' Src='/Mapscript/javascript/script_navigation.js'></SCRIPT>\n"; |
---|
52 | //writer.write(appel_javascript); |
---|
53 | |
---|
54 | /** BARRE DE NAVIGATION **/ |
---|
55 | |
---|
56 | |
---|
57 | String div= "<div class=\"" + classe + "\" style=\"" + style + "\">\n"; |
---|
58 | writer.write(div); |
---|
59 | } |
---|
60 | |
---|
61 | |
---|
62 | |
---|
63 | |
---|
64 | |
---|
65 | |
---|
66 | |
---|
67 | //**************************************// |
---|
68 | // FIN ENCODAGE COMPOSANT |
---|
69 | //**************************************// |
---|
70 | |
---|
71 | public void encodeEnd(FacesContext context) throws IOException { |
---|
72 | ResponseWriter writer = context.getResponseWriter(); |
---|
73 | String fin_tableau="</div>\n"; |
---|
74 | writer.write(fin_tableau); |
---|
75 | } |
---|
76 | |
---|
77 | //**************************************// |
---|
78 | // DECODAGE COMPOSANT |
---|
79 | //**************************************// |
---|
80 | |
---|
81 | public void decode(FacesContext context){ |
---|
82 | } |
---|
83 | |
---|
84 | //**************************************// |
---|
85 | // AUTORISE LES TAGS ENFANTS |
---|
86 | //**************************************// |
---|
87 | public boolean getRendersChildren() { |
---|
88 | return true; |
---|
89 | } |
---|
90 | |
---|
91 | //**************************************// |
---|
92 | //FAMILLE DU COMPOSANT |
---|
93 | //**************************************// |
---|
94 | public String getFamily() { |
---|
95 | return "ComposantPerso"; |
---|
96 | } |
---|
97 | |
---|
98 | |
---|
99 | } |
---|
100 | |
---|
101 | |
---|
102 | |
---|