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.InitializableClass that provides the controller for the Add Part 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 AddPartController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinitialize(java.net.URL url, java.util.ResourceBundle rb)(package private) voidonActionCancel(javafx.event.ActionEvent event)Returns to the Main menu when the "cancel" button is pressed.(package private) voidonActionClear(javafx.event.ActionEvent event)Clears the form field when the "clear" button is pressed.(package private) voidonActionInHouse(javafx.event.ActionEvent event)Adjusts the display label to Machine ID when the InHouse radio button is selected(package private) voidonActionOutsourced(javafx.event.ActionEvent event)Adjusts the display label to Company Name when the "outsourced" radio button is selected.(package private) voidonActionSavePart(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.ExceptionReturns 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.IOExceptionRUNTIME 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:
initializein interfacejavafx.fxml.Initializable
-
-