@@ -0,0 +1,2313 @@
+package com.darkbyte.programs.darkinventory.events;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0A%0Aimport javax.swing.JOptionPane;%0Aimport javax.swing.JScrollPane;%0Aimport javax.swing.JTextArea;%0A%0Aimport com.darkbyte.programs.darkinventory.display.Window;%0Aimport com.google.common.base.Charsets;%0Aimport com.google.common.io.Files;%0A%0Apublic class SearchItemEvent implements Event %7B%0A%0A%09@Override%0A%09public void run() %7B%0A%09%09boolean nameIsSelected = false;%0A%09%09String name = null;%0A%09%09File itemFile = null;%0A%09%09%0A%09%09while(!nameIsSelected) %7B%0A%09%09%09name = JOptionPane.showInputDialog(null, %22Please enter the name of the file you would like to search for%22, %22Enter%22, JOptionPane.QUESTION_MESSAGE);%0A%09%09%09itemFile = new File(%22items/%22 + name + %22.darkinventfile%22);%0A%09%09%09if(!itemFile.exists()) %7B%0A%09%09%09%09if(!(name.equals(JOptionPane.CLOSED_OPTION) %7C%7C name.equals(JOptionPane.CLOSED_OPTION))) %7B%0A%09%09%09%09%09JOptionPane.showMessageDialog(null, %22That's not a valid item name!%22, %22Error%22, JOptionPane.ERROR_MESSAGE);%0A%09%09%09%09%7D else %7B%0A%09%09%09%09%09return;%0A%09%09%09%09%7D%0A%09%09%09%7D else if(name.equals(JOptionPane.CANCEL_OPTION) %7C%7C name.equals(JOptionPane.CLOSED_OPTION))%7B%0A%09%09%09%09return;%0A%09%09%09%7D else %7B%0A%09%09%09%09nameIsSelected = true;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09%0A%09%09int option = JOptionPane.showOptionDialog(null, %22Would you like to see data on the selected item?%22, %22View Data%22, JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);%0A%09%09%0A%09%09if(option == JOptionPane.YES_OPTION) %7B%0A%09%09%09Window dataWindow = new Window(500, 500, %22DarkInventory - %22 + name, true, Window.DISPOSE_ON_CLOSE, false);%0A%09%09%09JTextArea dataArea = new JTextArea();%0A%09%09%09dataArea.setEditable(false);%0A%09%09%09dataWindow.add(new JScrollPane(dataArea));%0A%09%09%09try %7B%0A%09%09%09%09dataArea.setText(Files.toString(itemFile, Charsets.UTF_8).replaceAll(%22-%22, %22 %22));%0A%09%09%09%7D catch (IOException e) %7B%0A%09%09%09%09JOptionPane.showMessageDialog(null, %22An error occurred whilst trying to read the item's data!%22, %22Error%22, JOptionPane.ERROR_MESSAGE);%0A%09%09%09%7D%0A%09%09%7D else %7B%0A%09%09%09int optionSet2 = JOptionPane.showOptionDialog(null, %22Would you like to delete the selected item?%22, %22Delete%22, JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);%0A%09%09%09%0A%09%09%09if(optionSet2 == JOptionPane.YES_OPTION) %7B%0A%09%09%09%09itemFile.delete();%0A%09%09%09%09JOptionPane.showMessageDialog(null, %22The item '%22 + name + %22' was deleted!%22, %22Deleted%22, JOptionPane.INFORMATION_MESSAGE);%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%7D%0A

Create SearchItemEvent.java