Delete src/fr/iutfbleau/papillon/BtnModifier.java
This commit is contained in:
@@ -1,57 +0,0 @@
|
||||
// package fr.iutfbleau.papillon;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
|
||||
public class BtnModifier extends JButton implements ActionListener{
|
||||
|
||||
private GestionRappel ges;
|
||||
private Rappel rappel;
|
||||
private Main main;
|
||||
|
||||
public BtnModifier(Main main){
|
||||
super("Modifier");
|
||||
this.main = main;
|
||||
setPreferredSize(new Dimension(120,25));
|
||||
addActionListener(this);
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent e){
|
||||
|
||||
if (e.getSource() == this) {
|
||||
ges = new GestionRappel();
|
||||
int count = 0;
|
||||
List<PanelRappel> listRpl = new ArrayList<>();
|
||||
PanelRappel pr;
|
||||
|
||||
listRpl = main.getPanelRpl();
|
||||
for(int i = 0; i<listRpl.size();i++){
|
||||
pr = listRpl.get(i);
|
||||
if(pr.getSelection()==true){
|
||||
count++;
|
||||
rappel=pr.getRappel();
|
||||
}
|
||||
}
|
||||
|
||||
if(count==0){
|
||||
JOptionPane.showMessageDialog(main, "Sélectionnez 1 rappel à modifier");
|
||||
return;
|
||||
}
|
||||
if(count==1){
|
||||
|
||||
FenetreModif f = new FenetreModif(main,rappel,rappel.getTitre(),rappel.getContenu());
|
||||
f.setVisible(true);
|
||||
main.setVisible(false);
|
||||
}
|
||||
|
||||
if(count>1){
|
||||
JOptionPane.showMessageDialog(main, "Sélectionnez seulement 1 rappel à modifier");
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user