49 lines
1.5 KiB
Java
49 lines
1.5 KiB
Java
package action;
|
|
|
|
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 actEvalFormatageDirectTousLesNodesFalse extends AbstractAction{
|
|
{
|
|
putValue( Action.NAME, "Supprime évaluer l'absence ou la présence du formatage direct" );
|
|
putValue( Action.SHORT_DESCRIPTION, "Supprime évaluer l'absence ou la présence du formatage direct." );
|
|
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();
|
|
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));
|
|
}
|
|
}
|
|
}
|
|
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("evalFormatageDirect");
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|