116,6 → 116,8 |
int colonne = Integer.parseInt(appletteNoeud.getAttribute("colonne")); |
int index = Integer.parseInt(appletteNoeud.getAttribute("index")); |
HashMap<String, String> infoApplette = new HashMap<String, String>(); |
infoApplette.put("reduite", appletteNoeud.getAttribute("reduite")); |
infoApplette.put("epingle", appletteNoeud.getAttribute("epingle")); |
infoApplette.put("type", appletteNoeud.getAttribute("type")); |
infoApplette.put("colonne", appletteNoeud.getAttribute("colonne")); |
infoApplette.put("index", appletteNoeud.getAttribute("index")); |
126,7 → 128,11 |
while (it.hasNext()) { |
String id = it.next(); |
HashMap<String, String> infoApplette = tableApplettes.get(id); |
ajouterPortlet(infoApplette.get("type"), Integer.parseInt(infoApplette.get("colonne")), Integer.parseInt(infoApplette.get("index")), infoApplette.get("contenu")); |
boolean reduite = (infoApplette.get("reduite") != null && infoApplette.get("reduite").equals("true")) ? true : false; |
boolean epingle = (infoApplette.get("epingle") != null && infoApplette.get("epingle").equals("true")) ? true : false; |
int index = Integer.parseInt(infoApplette.get("index")); |
int colonne = Integer.parseInt(infoApplette.get("colonne")); |
ajouterPortlet(reduite, epingle, infoApplette.get("type"), colonne, index, infoApplette.get("contenu")); |
} |
} |
Debug.log("Nbre aplletes c0 :"+portail.getItem(0).getItemCount()); |
164,14 → 170,20 |
// Ajout des noeuds "applette" au noeud "accueil" |
while (it.hasNext()) { |
Portlet applette = it.next(); |
String reduite = (applette.isCollapsed() ? "true" : "false"); |
String epingle = (applette.isPinned() ? "true" : "false"); |
String index = Integer.toString(portail.getPortletIndex(applette)); |
String colonne = Integer.toString(portail.getPortletColumn(applette)); |
String contenu = applette.getData("contenu"); |
|
Element appletteElement = paramXml.createElement("applette"); |
appletteElement.setAttribute("reduite", reduite); |
appletteElement.setAttribute("epingle", epingle); |
appletteElement.setAttribute("type", "statistique"); |
appletteElement.setAttribute("colonne", colonne); |
appletteElement.setAttribute("index", index); |
appletteElement.setAttribute("contenu", contenu); |
|
accueilNoeud.appendChild(appletteElement); |
} |
|
194,16 → 206,21 |
} |
|
private void ajouterPortlet() { |
ajouterPortlet("statistique", 0, 0, null); |
ajouterPortlet(false, false, "statistique", 0, 0, null); |
} |
|
private void ajouterPortlet(String type, int colonne, int index, String contenu) { |
Debug.log("Ajout:"+type+"-"+colonne+"-"+index+"-"+contenu); |
Portlet portlet = null; |
private void ajouterPortlet(boolean reduite, boolean epingle, String type, int colonne, int index, String contenu) { |
Debug.log("Ajout:"+reduite+"-"+epingle+"-"+type+"-"+colonne+"-"+index+"-"+contenu); |
Applette applette = null; |
if (type.equals("statistique")) { |
portlet = new AppletteStatistique(contenu); |
applette = new AppletteStatistique(contenu); |
} |
portail.insert(portlet, index, colonne); |
if (reduite) { |
applette.collapse(); |
} |
|
portail.insert(applette, index, colonne); |
applette.setEpingler(epingle); |
layout(); |
} |
|