b40b6edb05
Ajout dans le menu structure de l'évaluation dans toutes les page de l'absence ou la présence de paragraphe vide
57 lines
1.9 KiB
Java
57 lines
1.9 KiB
Java
package action;
|
|
|
|
import java.awt.event.ActionEvent;
|
|
|
|
import javax.swing.AbstractAction;
|
|
import javax.swing.Action;
|
|
import javax.swing.ImageIcon;
|
|
import javax.swing.JOptionPane;
|
|
|
|
import cXML.node;
|
|
import fenetres.create;
|
|
|
|
public class actsautmultipletrue 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();
|
|
boolean informations = false;
|
|
if(JOptionPane.showConfirmDialog(null,"Voulez-vous placer l'information du node juste après le saut?", "Information", JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE)==JOptionPane.YES_OPTION) {
|
|
informations=true;
|
|
}
|
|
for(int i = 0 ; i < nod.getNodes().size();i++) {
|
|
nod.getNodes().get(i).getAttributs().put("saut", "true");
|
|
if(informations) {
|
|
String content = nod.getNodes().get(i).retourneLesContenusEnfants("");
|
|
if(!content.isEmpty()) if(content.replaceAll(" ", "").length()==0) content=content.replaceAll(" ", "");
|
|
if(content.length()>300) content = content.substring(0, 299);
|
|
|
|
content = nod.getNodes().get(i).getNomElt() + " : " + content;
|
|
nod.getNodes().get(i).getAttributs().put("information", content);
|
|
}
|
|
}
|
|
|
|
//Pour le node page
|
|
if(informations) {
|
|
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.getNomElt() + " : " + content;
|
|
nod.getAttributs().put("information", content);
|
|
}
|
|
|
|
fenetres.create.getTextNodeSelect().refreshAffichage(nod);
|
|
}
|
|
|
|
}
|