Ceci est une ancienne révision du document !
Scrumtool : Gestion de projet de type SCRUM
Gestion des projets
1- Fonctionnalités
2- Vues
3- Contrôleurs
3.1 Cproducts - Add Product
view.getBtnProducts().addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent arg0) {
if (view.getBtnProducts().getText() == "Add this project") {
if (view.getTxtNameProject().getText().equals("") || view.getTxtDescriptionProduct().getText().equals("")) {
Utils.MsgBox(view.getShell(), "Please complete all fields", "information");
} else {
boolean nomUtilise = false;
for (Product product : DAO.getProducts()) {
if (product.getName().equals(view.getTxtNameProject().getText())) {
nomUtilise = true;
}
}
if (nomUtilise == true) {
Utils.MsgBox(view.getShell(), "A project already has this name", "information");
} else {
Product product = new Product(view.getTxtNameProject().getText(), view.getTxtDescriptionProduct().getText(), null, null, null);
DAO.SQLProduct(product, "insert");
view.getTableViewerProducts().add(product);
Utils.MsgBox(view.getShell(), "Project is create", "information");
}
}
} else {
// Code update product
}
}
});
3.2 Cproducts - Edit Product
view.getBtnProducts().addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent arg0) {
if (view.getBtnProducts().getText() == "Add this project") {
// Code add product
} else {
if (view.getTxtDescriptionProduct().getText().equals("")) {
Utils.MsgBox(view.getShell(), "Please complete all fields", "information");
} else {
productActif.setName(view.getTxtNameProject().getText());
productActif.setDescription(view.getTxtDescriptionProduct().getText());
DAO.SQLProduct(productActif, "update");
view.getTableViewerProducts().refresh();
Utils.MsgBox(view.getShell(), "Project is update", "information");
}
}
}
});
3.2 Cproducts - Delete Product
view.getTltmDelProduct().addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent arg0) {
MessageBox messageBoxproduct = new MessageBox(view.getShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
messageBoxproduct.setText("SCRUMTOOL");
messageBoxproduct.setMessage("Do you really want to delete this project ?");
int responseProduct = messageBoxproduct.open();
if (responseProduct == SWT.YES) {
DAO.SQLProduct(productActif, "delete");
view.getTableViewerProducts().remove(productActif);
view.getGrpProject().setVisible(false);
}
}
});
3.2 Cproducts - Edit collaborator
view.getTltmEditCollaboratorsProduct().addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent arg0) {
EditCollaboratorsProduct vAddCollaborators = new EditCollaboratorsProduct();
CeditCollaboratorsProduct cEditCollaborators = new CeditCollaboratorsProduct(vAddCollaborators);
vAddCollaborators.init();
cEditCollaborators.init(productActif);
cEditCollaborators.listener(productActif);
vAddCollaborators.open();
}
});
3.2 Cproducts - Open product
view.getTltmEditCollaboratorsProduct().addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent arg0) {
EditCollaboratorsProduct vAddCollaborators = new EditCollaboratorsProduct();
CeditCollaboratorsProduct cEditCollaborators = new CeditCollaboratorsProduct(vAddCollaborators);
vAddCollaborators.init();
cEditCollaborators.init(productActif);
cEditCollaborators.listener(productActif);
vAddCollaborators.open();
}
});



