package fenetres.create_act; import java.awt.event.ActionEvent; import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.ImageIcon; import cXML.node; import fenetres.create; public class actInsereInformationTrue extends AbstractAction{ { putValue( Action.NAME, "true" ); putValue( Action.SHORT_DESCRIPTION, "true" ); putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/truemini.png"))); } /** * */ private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { node nod = (node) fenetres.create.getSelectNode().getUserObject(); String content = nod.retourneLesContenusEnfants(""); if(!content.isEmpty()) if(content.replaceAll(" ", "").length()==0) content=content.replaceAll(" ", ""); if(content.length()>300) content = content.substring(0, 299); content = nod.toString() + " : " + content; nod.getAttributs().put("information", content); fenetres.create.getTextNodeSelect().refreshAffichage(nod); } }