89e1268ba6
ajout dans la rechercher des nodes frères, etc...)
44 lines
1.2 KiB
Java
44 lines
1.2 KiB
Java
package fenetres.create_act;
|
|
|
|
import java.awt.event.ActionEvent;
|
|
|
|
import javax.swing.AbstractAction;
|
|
import javax.swing.Action;
|
|
import javax.swing.ImageIcon;
|
|
import javax.swing.JOptionPane;
|
|
import javax.swing.tree.TreeNode;
|
|
|
|
import cXML.node;
|
|
import fenetres.create;
|
|
|
|
public class actsauttrue extends AbstractAction{
|
|
|
|
/**
|
|
*
|
|
*/
|
|
private static final long serialVersionUID = 1L;
|
|
{
|
|
putValue( Action.NAME, "true" );
|
|
putValue( Action.SHORT_DESCRIPTION, "true" );
|
|
putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/truemini.png")));
|
|
}
|
|
@Override
|
|
public void actionPerformed(ActionEvent e) {
|
|
node nod = (node) fenetres.create.getSelectNode().getUserObject();
|
|
TreeNode[] chemin = fenetres.create.getSelectNode().getPath();
|
|
boolean avertissement=false;
|
|
for(int i = 0 ; i < chemin.length; i++) {
|
|
if(chemin[i].toString().contains("setting")) avertissement = true;
|
|
System.out.println(chemin[i].toString());
|
|
}
|
|
|
|
if(!avertissement) {
|
|
nod.saut(true);
|
|
fenetres.create.getTextNodeSelect().refreshAffichage(nod);
|
|
}else {
|
|
JOptionPane.showMessageDialog(null, "Ce node ne peut pas être évaluer." );
|
|
}
|
|
}
|
|
|
|
}
|