src/Controller/MainScreenController.java
/**
     * * Products Search Button Handlers searches for Product by ID and Part
     * name. If search field is empty and the button is clicked then an error is
     * thrown. If a product ID or name is not found in inventory then an
     * INFORMATION alert is thrown. If a product ID or name is found then then
     * the part is returned and added to a temporary list that populates the
     * AddTable list view.
     *
     * @param event
     */
Products Search Button Handlers searches for Product by ID and Part
name. If search field is empty and the button is clicked then an error is
thrown. If a product ID or name is not found in inventory then an
INFORMATION alert is thrown. If a product ID or name is found then then
the part is returned and added to a temporary list that populates the
AddTable list view.

@param event
Products Search Button Handlers searches for Product by ID and Part name . If search field is empty and the button is clicked then an error is thrown . If a product ID or name is not found in inventory then an INFORMATION alert is thrown . If a product ID or name is found then then the part is returned and added to a temporary list that populates the AddTable list view . @param event
@FXML
    private void productsSearchBtnHandler(ActionEvent event
    ) {
        String productSearchString = productsSearchField.getText();
        int searchedProductIndex;
        if (productSearchString.equals("")) {
            System.err.println("Empty search field present. Product search could not be conducted.");
            Alert emptySearchField = new Alert(Alert.AlertType.INFORMATION);
            emptySearchField.setTitle("ERROR: EMPTY FIELD");
            emptySearchField.setHeaderText("Unable to process search");
            emptySearchField.setContentText("Search field cannot be blank.");
            emptySearchField.showAndWait();
        } else if (Inventory.lookupProduct(productSearchString) == -1) {
            System.err.println("Product not found. Search returned no results.");
            Alert productNotFound = new Alert(Alert.AlertType.INFORMATION);
            productNotFound.setTitle("ERROR: PRODUCT NOT FOUND");
            productNotFound.setHeaderText("Unable to locate product");
            productNotFound.setContentText("The Product ID or name entered was not found in inventory.");
            productNotFound.showAndWait();
        } else {
            System.out.println("Product search succeeded. Products table view updated.");
            searchedProductIndex = Inventory.lookupProduct(productSearchString);
            Product searchedProduct = Inventory.getAllProducts().get(searchedProductIndex);
            ObservableList<Product> searchedProductList = FXCollections.observableArrayList();
            searchedProductList.add(searchedProduct);
            productsTable.setItems(searchedProductList);
            productsSearchField.setText("");
        }
    }
@ FXML private void productsSearchBtnHandler ( ActionEvent event ) { String productSearchString = productsSearchField . getText ( ) ; int searchedProductIndex ; if ( productSearchString . equals ( "" ) ) { System . err . println ( "Empty search field present. Product search could not be conducted." ) ; Alert emptySearchField = new Alert ( Alert . AlertType . INFORMATION ) ; emptySearchField . setTitle ( "ERROR: EMPTY FIELD" ) ; emptySearchField . setHeaderText ( "Unable to process search" ) ; emptySearchField . setContentText ( "Search field cannot be blank." ) ; emptySearchField . showAndWait ( ) ; } else if ( Inventory . lookupProduct ( productSearchString ) == - 1 ) { System . err . println ( "Product not found. Search returned no results." ) ; Alert productNotFound = new Alert ( Alert . AlertType . INFORMATION ) ; productNotFound . setTitle ( "ERROR: PRODUCT NOT FOUND" ) ; productNotFound . setHeaderText ( "Unable to locate product" ) ; productNotFound . setContentText ( "The Product ID or name entered was not found in inventory." ) ; productNotFound . showAndWait ( ) ; } else { System . out . println ( "Product search succeeded. Products table view updated." ) ; searchedProductIndex = Inventory . lookupProduct ( productSearchString ) ; Product searchedProduct = Inventory . getAllProducts ( ) . get ( searchedProductIndex ) ; ObservableList < Product > searchedProductList = FXCollections . observableArrayList ( ) ; searchedProductList . add ( searchedProduct ) ; productsTable . setItems ( searchedProductList ) ; productsSearchField . setText ( "" ) ; } }
* Products Search Button Handlers searches for Product by ID and Part
 name.
* Products Search Button Handlers searches for Product by ID and Part name .