Class JDialogEditUserDefinedFileTypes

All Implemented Interfaces:
DialogDefaultsInterface, ActionListener, FocusListener, ItemListener, WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class JDialogEditUserDefinedFileTypes extends JDialogBase
This class is the dialog that allows the user to edit the user defined file extensions filter
Author:
Nish Pandya
See Also:
  • Field Details

    • displayPanel

      private JPanel displayPanel
      The panels that make up this Dialog
    • applyClosePanel

      private JPanel applyClosePanel
      The panels that make up this Dialog
    • checkBoxArrList

      private ArrayList<JCheckBox> checkBoxArrList
      This is the ArrayList of JCheckBoxes
    • checkboxNames

      private ArrayList<String> checkboxNames
      This is a list of the checkbox names that is used for validation of user input to make sure there are no duplicates
    • checkedFileTypes

      private ArrayList<String> checkedFileTypes
      This a list is the list of checked check boxes that is populated when user hits apply
    • fileExtensionsTS

      private TreeSet<String> fileExtensionsTS
      This is the alphabetically sorted collection of supported file extension names
    • userInput

      private JTextField userInput
      This is the user input for additional file extensions
    • userInputFileTypes

      private String[] userInputFileTypes
      This array is the list of additional file extensions that user typed in that is populated when user hits apply
    • preferencesFileTypes

      private String[] preferencesFileTypes
      This array is the list of file extensions that is pulled from the Preferences. We need this in order to check the appropriate check boxes and the user input text field when the user opens up this dialog initailly
  • Constructor Details

    • JDialogEditUserDefinedFileTypes

      public JDialogEditUserDefinedFileTypes()
      Constructor.
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent event)
      The actionPerformed method
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class JDialogBase
      Parameters:
      event - the ActionEvent
    • renderCheckBox

      public void renderCheckBox(JCheckBox checkBox, GridBagLayout gbLayout, GridBagConstraints gbConstraints, int x, int y)
      This method renders the checkbox
      Parameters:
      checkBox - the JCheckbox
      gbLayout - the GridbagLayout
      gbConstraints - the GridbagConstraints
      x - the x position
      y - the y position
    • validateUserInputString

      public boolean validateUserInputString(String inputString)
      This method validates the user input file extensions. It alllows combinations of letters (upper and lowere) and numbers in the file extension also makes sure that user input names do not duplicate any checkbox names
      Parameters:
      inputString - the string to validate
    • checkPreference

      public boolean checkPreference(String fileType)
      This method does the check with the preferencesFileTypes array to determine if the checkbox should be checked initalially
      Parameters:
      fileType - the file extension to check