mirror of
				https://github.com/klmp200/PQT_Gestionnaire_vente_stock.git
				synced 2025-10-30 08:33:57 +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:
		| @@ -200,13 +200,13 @@ class StockScreenView implements IFXComponent { | ||||
|                                                 .collect(Collectors.toList()); | ||||
|             Platform.runLater(()->{ | ||||
|                 mainPane.getChildren().removeAll(toRemove); | ||||
|                 currentDetailScreen.delete(); | ||||
|                 currentDetailScreen = null; | ||||
|             }); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     boolean isDetailScreenCreationPossible() { | ||||
|         System.out.println("test creation possible : "); | ||||
|         return currentDetailScreen!=null && currentDetailScreen.isCreationPossible(); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -53,4 +53,13 @@ public class ProductManagerScreen implements IFXCreatorComponent<Product>, IFXVa | ||||
|     public Product getInitialValueSnapshot(){ | ||||
|         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) { | ||||
|         model.setSellable(newVal); | ||||
|     } | ||||
|  | ||||
|     public void delete() { | ||||
|         view = null; | ||||
|         model = null; | ||||
|         listenerList = null; | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -121,4 +121,8 @@ class ProductManagerScreenModel { | ||||
|     Product getInitialData(){ | ||||
|         return initialData; | ||||
|     } | ||||
|  | ||||
|     public void delete() { | ||||
|  | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -209,4 +209,7 @@ class ProductManagerScreenView implements IFXComponent { | ||||
|             productComponentsListView.getItems().addAll(productCollection); | ||||
|         }); | ||||
|     } | ||||
|     public void delete() { | ||||
|         ctrl = null; | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user