Package masterinventory.controller
Class AddProductController
- java.lang.Object
-
- masterinventory.controller.AddProductController
-
- All Implemented Interfaces:
javafx.fxml.Initializable
public class AddProductController extends java.lang.Object implements javafx.fxml.InitializableClass that provides the controller for the Add Product UI view.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) ErrorHandlingerror(package private) javafx.scene.Parentscene(package private) javafx.stage.Stagestage
-
Constructor Summary
Constructors Constructor Description AddProductController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinitialize(java.net.URL url, java.util.ResourceBundle rb)Initialization method for AddProductController(package private) voidonActionAddAssocProd(javafx.event.ActionEvent event)Adds Associated Part to the product(package private) voidonActionCancelProd(javafx.event.ActionEvent event)Returns user to main menu when the "cancel" button is clicked(package private) voidonActionProductSearch(javafx.event.ActionEvent event)Allows user to search products by entering search terms in the search box and hitting enter.(package private) voidonActionRemoveAssocProd(javafx.event.ActionEvent event)Allows user to remove an associated part from a product.(package private) voidonActionSaveProd(javafx.event.ActionEvent event)Saves product after it is run through validation.
-
-
-
Field Detail
-
stage
javafx.stage.Stage stage
-
scene
javafx.scene.Parent scene
-
error
ErrorHandling error
-
-
Method Detail
-
onActionAddAssocProd
void onActionAddAssocProd(javafx.event.ActionEvent event) throws java.lang.ExceptionAdds Associated Part to the product- Parameters:
event-- Throws:
java.lang.Exception
-
onActionCancelProd
void onActionCancelProd(javafx.event.ActionEvent event) throws java.lang.ExceptionReturns user to main menu when the "cancel" button is clicked- Parameters:
event-- Throws:
java.lang.Exception
-
onActionProductSearch
void onActionProductSearch(javafx.event.ActionEvent event)
Allows user to search products by entering search terms in the search box and hitting enter. Valid search optons include searching by product number and partial string match on name.- Parameters:
event-
-
onActionRemoveAssocProd
void onActionRemoveAssocProd(javafx.event.ActionEvent event)
Allows user to remove an associated part from a product. Displays a confirmation dialogue before final deletion.- Parameters:
event-
-
onActionSaveProd
void onActionSaveProd(javafx.event.ActionEvent event) throws java.lang.ExceptionSaves product after it is run through validation.- Parameters:
event-- Throws:
java.lang.Exception- dialogue displayed for NumberFormatException codes. If entered data is valid the product will be saved, and user returned to the main menu. If not, they will be allowed to fix their entry on the add product form.
-
initialize
public void initialize(java.net.URL url, java.util.ResourceBundle rb)Initialization method for AddProductController- Specified by:
initializein interfacejavafx.fxml.Initializable- Parameters:
url-rb-
-
-