mirror of
https://github.com/klmp200/PQT_Gestionnaire_vente_stock.git
synced 2024-11-22 08:13:20 +00:00
[CLIENT] #16 : ajout d'une méthode delete() aux clss du ProductManagerScreen, pour permettre la garbage-collection des obj durant l'exec du soft
This commit is contained in:
parent
9b847e61d0
commit
73e91c12c6
@ -200,13 +200,13 @@ class StockScreenView implements IFXComponent {
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
Platform.runLater(()->{
|
Platform.runLater(()->{
|
||||||
mainPane.getChildren().removeAll(toRemove);
|
mainPane.getChildren().removeAll(toRemove);
|
||||||
|
currentDetailScreen.delete();
|
||||||
currentDetailScreen = null;
|
currentDetailScreen = null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isDetailScreenCreationPossible() {
|
boolean isDetailScreenCreationPossible() {
|
||||||
System.out.println("test creation possible : ");
|
|
||||||
return currentDetailScreen!=null && currentDetailScreen.isCreationPossible();
|
return currentDetailScreen!=null && currentDetailScreen.isCreationPossible();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,4 +53,13 @@ public class ProductManagerScreen implements IFXCreatorComponent<Product>, IFXVa
|
|||||||
public Product getInitialValueSnapshot(){
|
public Product getInitialValueSnapshot(){
|
||||||
return new Product(model.getInitialData());
|
return new Product(model.getInitialData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void delete(){
|
||||||
|
model.delete();
|
||||||
|
view.delete();
|
||||||
|
ctrl.delete();
|
||||||
|
view = null;
|
||||||
|
ctrl = null;
|
||||||
|
model = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,4 +90,10 @@ class ProductManagerScreenController {
|
|||||||
void onSellableStateChanged(boolean oldVal, boolean newVal) {
|
void onSellableStateChanged(boolean oldVal, boolean newVal) {
|
||||||
model.setSellable(newVal);
|
model.setSellable(newVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void delete() {
|
||||||
|
view = null;
|
||||||
|
model = null;
|
||||||
|
listenerList = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -121,4 +121,8 @@ class ProductManagerScreenModel {
|
|||||||
Product getInitialData(){
|
Product getInitialData(){
|
||||||
return initialData;
|
return initialData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void delete() {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -209,4 +209,7 @@ class ProductManagerScreenView implements IFXComponent {
|
|||||||
productComponentsListView.getItems().addAll(productCollection);
|
productComponentsListView.getItems().addAll(productCollection);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
public void delete() {
|
||||||
|
ctrl = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user