2022-12-12 19:25:53 +01:00
|
|
|
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;
|
|
|
|
import list.listeDesNodesAnalyseStyle;
|
|
|
|
|
|
|
|
public class actEvaluerNomDuStyleHeriteTousLesNodesFalse extends AbstractAction{
|
|
|
|
{
|
|
|
|
putValue( Action.NAME, "Supprime l'évaluation de tous les noms des styles hérités dans tous les nodes." );
|
|
|
|
putValue( Action.SHORT_DESCRIPTION, "Supprime l'évaluation des noms des styles hérités." );
|
|
|
|
putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/falsemini.png")) );
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
node nod = (node) fenetres.create.getSelectNode().getUserObject();
|
2023-01-24 21:11:01 +01:00
|
|
|
if(nod.getNomElt().equals("page")) {
|
|
|
|
supprimeAttribut(nod);
|
|
|
|
}
|
|
|
|
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));
|
|
|
|
}
|
2022-12-12 19:25:53 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
fenetres.create.getTextNodeSelect().refreshAffichage(nod);
|
|
|
|
}
|
2023-01-24 21:11:01 +01:00
|
|
|
|
|
|
|
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("evalNameLegacyStyle");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-12-12 19:25:53 +01:00
|
|
|
|
|
|
|
}
|