Package masterinventory.controller
Class AddPartController
- java.lang.Object
-
- masterinventory.controller.AddPartController
-
- All Implemented Interfaces:
javafx.fxml.Initializable
public class AddPartController extends java.lang.Object implements javafx.fxml.Initializable
Class that provides the controller for the Add Part 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 AddPartController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
initialize(java.net.URL url, java.util.ResourceBundle rb)
(package private) void
onActionCancel(javafx.event.ActionEvent event)
Returns to the Main menu when the "cancel" button is pressed.(package private) void
onActionClear(javafx.event.ActionEvent event)
Clears the form field when the "clear" button is pressed.(package private) void
onActionInHouse(javafx.event.ActionEvent event)
Adjusts the display label to Machine ID when the InHouse radio button is selected(package private) void
onActionOutsourced(javafx.event.ActionEvent event)
Adjusts the display label to Company Name when the "outsourced" radio button is selected.(package private) void
onActionSavePart(javafx.event.ActionEvent event)
RUNTIME ERROR - Found that if an input error occurred (for instance, a string valid was entered rather than a double, a NumberFormatException would occur.
-
-
-
Field Detail
-
stage
javafx.stage.Stage stage
-
scene
javafx.scene.Parent scene
-
error
ErrorHandling error
-
-
Method Detail
-
onActionCancel
void onActionCancel(javafx.event.ActionEvent event) throws java.lang.Exception
Returns to the Main menu when the "cancel" button is pressed. Prompts the user to see if they indeed would like to cancel.- Parameters:
event
-- Throws:
java.lang.Exception
-
onActionClear
void onActionClear(javafx.event.ActionEvent event)
Clears the form field when the "clear" button is pressed. Confirmation is requested.- Parameters:
event
-
-
onActionInHouse
void onActionInHouse(javafx.event.ActionEvent event)
Adjusts the display label to Machine ID when the InHouse radio button is selected- Parameters:
event
-
-
onActionOutsourced
void onActionOutsourced(javafx.event.ActionEvent event)
Adjusts the display label to Company Name when the "outsourced" radio button is selected.- Parameters:
event
-
-
onActionSavePart
void onActionSavePart(javafx.event.ActionEvent event) throws java.io.IOException
RUNTIME ERROR - Found that if an input error occurred (for instance, a string valid was entered rather than a double, a NumberFormatException would occur. To deal with this error, I used a try/catch statement to catch the exception, and return a dialogue to the user that requires them to use the appropriate data type.- Parameters:
event
-- Throws:
java.io.IOException
-
initialize
public void initialize(java.net.URL url, java.util.ResourceBundle rb)
- Specified by:
initialize
in interfacejavafx.fxml.Initializable
-
-