2023-02-05 17:46:02 +01:00
|
|
|
package action;
|
2023-02-05 16:09:48 +01:00
|
|
|
|
|
|
|
import java.awt.event.ActionEvent;
|
|
|
|
|
|
|
|
import javax.swing.AbstractAction;
|
|
|
|
import javax.swing.Action;
|
|
|
|
import javax.swing.ImageIcon;
|
|
|
|
|
|
|
|
import MEPTL.commandes;
|
|
|
|
import cXML.node;
|
|
|
|
import fenetres.create;
|
|
|
|
import list.listeDesNodesAnalyseStyle;
|
|
|
|
import list.listeNodeFormatageDirectDeWriter;
|
|
|
|
|
|
|
|
public class actEvaluerStyleTouslesNodesFalse extends AbstractAction{
|
|
|
|
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
{
|
|
|
|
putValue( Action.NAME, "N'évaluer pas le style." );
|
|
|
|
putValue( Action.SHORT_DESCRIPTION, "N'évaluer pas le style:name de ce node dans le fichier de l'étudiant" );
|
|
|
|
putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/falsemini.png")));
|
|
|
|
}
|
|
|
|
@Override
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
node nod = (node) fenetres.create.getSelectNode().getUserObject();
|
|
|
|
if(nod.getNomElt().equals("structurepage")) {
|
|
|
|
for(int i = 0 ; i < nod.getNodes().size();i++) {
|
|
|
|
if(nod.getNodes().get(i).getNomElt().equals("page")) {
|
|
|
|
supprimeAttribut(nod.getNodes().get(i));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fenetres.create.getTextNodeSelect().refreshAffichage(nod);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private void supprimeAttribut(node nodePage) {
|
|
|
|
for(int i = 0 ; i < nodePage.getNodes().size();i++) {
|
|
|
|
if(listeDesNodesAnalyseStyle.isAnalyseStyle(nodePage.getNodes().get(i))) {
|
|
|
|
nodePage.getNodes().get(i).supprimeAttribut("analyseStyle");
|
|
|
|
|
|
|
|
//***************************************************************************************************************
|
|
|
|
//** Place l'attribut EvaluerATraversAnalyseStyle=false au style qui doit être évaluer à travers d'analyseStyle **
|
|
|
|
//** S'il y a des attributs évaluer avec ‼ alors change par ‽ **
|
|
|
|
//***************************************************************************************************************
|
|
|
|
node nodStyle = commandes.sujet.retourneFirstNodeByNameAndAttributValueExactStrict("style:style", "style:name", nodePage.getNodes().get(i).getAttributs().get("text:style-name"));
|
|
|
|
if(nodStyle!=null) {
|
|
|
|
nodStyle.getAttributs().put("EvaluerATraversAnalyseStyle", "false");
|
|
|
|
nodStyle.evaluerAllChildFalse();
|
|
|
|
if(!listeNodeFormatageDirectDeWriter.isFormatageDirect(nodStyle)) {
|
|
|
|
nodStyle.changeLesCodesEvaluateursVersCodeEvaluateurDirect();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|