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.Initializable
Class that provides the controller for the Add Product UI view.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) ErrorHandling
error
(package private) javafx.scene.Parent
scene
(package private) javafx.stage.Stage
stage
-
Constructor Summary
Constructors Constructor Description AddProductController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
initialize(java.net.URL url, java.util.ResourceBundle rb)
Initialization method for AddProductController(package private) void
onActionAddAssocProd(javafx.event.ActionEvent event)
Adds Associated Part to the product(package private) void
onActionCancelProd(javafx.event.ActionEvent event)
Returns user to main menu when the "cancel" button is clicked(package private) void
onActionProductSearch(javafx.event.ActionEvent event)
Allows user to search products by entering search terms in the search box and hitting enter.(package private) void
onActionRemoveAssocProd(javafx.event.ActionEvent event)
Allows user to remove an associated part from a product.(package private) void
onActionSaveProd(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.Exception
Adds Associated Part to the product- Parameters:
event
-- Throws:
java.lang.Exception
-
onActionCancelProd
void onActionCancelProd(javafx.event.ActionEvent event) throws java.lang.Exception
Returns 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.Exception
Saves 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:
initialize
in interfacejavafx.fxml.Initializable
- Parameters:
url
-rb
-
-
-