Class SearchDialog

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class SearchDialog extends JDialog
Modal dialog used to search and browse existing projects stored in the application's database.

The dialog provides a text search field that matches project name and description, displays results in a read-only table and allows opening the associated project folder or loading project details into the main form.

Since:
1.0.0
See Also:
  • Field Details

    • searchField

      private JTextField searchField
      Search input field.
    • searchButton

      private JButton searchButton
      Button to trigger a search.
    • closeButton

      private JButton closeButton
      Button to close the dialog.
    • loadProjectButton

      private JButton loadProjectButton
      Button to load the selected project into the main form.
    • openFolderButton

      private JButton openFolderButton
      Button to open the selected project's folder in the system file explorer.
    • resultsTable

      private JTable resultsTable
      Table displaying search results.
    • tableModel

      private DefaultTableModel tableModel
      Table model backing the results table.
  • Constructor Details

    • SearchDialog

      public SearchDialog(JFrame parent)
      Constructs the search dialog and initializes all UI components. Loads all projects initially.
      Parameters:
      parent - Parent JFrame for modal dialog
  • Method Details

    • initializeComponents

      private void initializeComponents()
      Initializes all UI components and configures the results table.
    • layoutComponents

      private void layoutComponents()
      Lays out all UI components in the dialog using BorderLayout.
    • addEventHandlers

      private void addEventHandlers()
      Adds event handlers for search, enter key, close button, and double-click on table.
    • openSelectedProjectFolder

      private void openSelectedProjectFolder()
      Opens the selected project's folder in the system file explorer. Shows error dialog if opening fails or no row is selected.
    • loadAllProjects

      private void loadAllProjects()
      Loads all projects from the database and displays them in the results table. Shows error dialog if loading fails, with retry mechanism for transient errors.
    • performSearch

      private void performSearch()
      Performs a search for projects by name or description using the search field value. Updates the results table with matching projects. Shows info dialog if no results found.
    • loadSelectedProject

      private void loadSelectedProject()
      Loads the details of the selected project into the main form. The selected row's project values (name, type, description and file path) are read from the table model and passed to the main frame.