Class PSearchBasePanel

All Implemented Interfaces:
PIASelectionListener, ActionListener, ItemListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class PSearchBasePanel extends JPanel implements ActionListener, ItemListener, PIASelectionListener
Main search panel that is responsible for handling three functions: it hosts different search type panels in a card layout fashion. It also lays out controls (radio buttons/combo box) to select different cards. Finally, it shows the status of search progress.
See Also:
  • Field Details

  • Constructor Details

    • PSearchBasePanel

      public PSearchBasePanel()
      Creates the search base panel without any search type panels
    • PSearchBasePanel

      public PSearchBasePanel(PSearchComponents[] comps)
      Creates the search base panel using the data found in PSearchComponents.
      Parameters:
      comps - an array of search panels to load into the window
    • PSearchBasePanel

      public PSearchBasePanel(String ep, String rp)
      Creates the search panels and controls
      Parameters:
      ep - String identifier for entry panels
      rp - String identifier for results panels for example, see the calling class
  • Method Details

    • addSearchComponent

      public void addSearchComponent(PSearchComponents comp)
      Adds the given search components to the panel. It takes care of connecting the entry panel to the results panel if it exists.
      Parameters:
      comps - an array of search panels to load into the window
    • createCompsPanel

      public void createCompsPanel()
      Create and configure a component panel that holds the control buttons
    • loadSearchTypePanels

      public void loadSearchTypePanels(String ep, String rp)
      Creates the search entry panel and search results panel for each type and adds them to the cardlayout in the search type panel.
      Parameters:
      ep - properties string of entry panels
      rp - properties string of results panels
    • createComboBoxControl

      public void createComboBoxControl()
      Creates search type selection control: a combo box.
    • itemStateChanged

      public void itemStateChanged(ItemEvent e)
      Event handler for combo box.
      Specified by:
      itemStateChanged in interface ItemListener
    • conductSingleDBSearch

      public void conductSingleDBSearch(long dbID)
      Enables the search in a single known DB with the specified id; by default, the search is performed as global. Call the setSingleDBSearchID() to reassign a new database ID.
      Parameters:
      dbID - database id
    • conductGlobalSearch

      public void conductGlobalSearch()
      Call this method to revert the search scope back to global after conducting a singel db search.
    • setSingleDBSearchID

      public void setSingleDBSearchID(long id)
      Specifies the database ID to conduct single db search
      Parameters:
      id - database id
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Event handler for All Brands check box.
      Specified by:
      actionPerformed in interface ActionListener
    • createBrandControl

      public void createBrandControl()
      Creates and adds the branding widget adjecent to the search type control.
    • addNotify

      public void addNotify()
      Overrides:
      addNotify in class JComponent
    • setBrandingScope

      public void setBrandingScope(PScopeEntryPoint ep)
      Allows to change the branding scope by assigning the new brand directly on the brand tree object.
      Parameters:
      ep - scope entry point
    • setSearchTypeControlDisabled

      public void setSearchTypeControlDisabled(boolean status)
      Disables search type combo box, which retains only the accounts seach panel for display
    • removeSearchTypeControl

      public void removeSearchTypeControl()
      Removes the search type combo box, and retains only the accounts seach panel for display
    • removeSearchTypeLabel

      public void removeSearchTypeLabel()
      Removes the search type selection label
    • isBrandSelectionControlsDisabled

      public boolean isBrandSelectionControlsDisabled()
      Returns the disabled state of the brand control widget
      Returns:
      true if the tree is disabled; false if enabled; false if the brand tree is not being used.
    • setBrandSelectionControlsDisabled

      public void setBrandSelectionControlsDisabled(boolean status)
      Disables brand selection controls
    • removeBrandSelectionControls

      public void removeBrandSelectionControls()
      removes brand selection controls
    • createStatusPanel

      public void createStatusPanel()
      Create a status panel with a status label and an animation icon.
    • setStatus

      public void setStatus(String text, boolean accountStatus)
      Sets the status panel status.
      Parameters:
      text - status text
      accountStatus - true means account status else bills status
    • selectionChanged

      public void selectionChanged(PIASelectionEvent event)
      Selection handler that navigates to the selected account.
      Specified by:
      selectionChanged in interface PIASelectionListener
      Parameters:
      event - the event to handle
    • setPreviousSelectionNull

      public void setPreviousSelectionNull()
      Before start new search set the previous selection to null
    • showCurrentAccount

      public void showCurrentAccount()
      Displays the current account in the application main window.
    • getSelectedAccount

      public PModelHandle[] getSelectedAccount()
      Retrieves p-model handle for the selected item in the results table
    • hideDialog

      public void hideDialog()
    • getAccountsEntryPanel

      public PSearchProducer getAccountsEntryPanel()
      Retrieves the accounts entry panel that has been assigned.
    • getAccountsResultsPanel

      public PSearchConsumer getAccountsResultsPanel()
      Retrieves the accounts results panel that has been assigned.
    • getBillsEntryPanel

      public PSearchProducer getBillsEntryPanel()
      Retrieves the bills entry panel that has been assigned.
    • getBillsResultsPanel

      public PSearchConsumer getBillsResultsPanel()
      Retrieves the bills results panel that has been assigned.
    • isPinned

      public boolean isPinned()
      Retrieves the push pin status
    • setPinned

      public void setPinned(boolean b)
      Assign a boolean pin status, true for pinning or else false
    • setPinVisible

      public void setPinVisible(boolean b)
      setPinVisible set if pin toggle button should be visible or not
      Parameters:
      b - boolean
    • setSearchButtonsVisible

      public void setSearchButtonsVisible(boolean resetState, boolean stopState, boolean searchState, boolean closeState)
    • setSearchButtonsEnable

      public void setSearchButtonsEnable(boolean resetState, boolean stopState, boolean searchState)
      Enables or disables the search buttons based on the boolean value passed.
      Parameters:
      resetState - boolean true means enables the reset button else disables it.
      stopState - boolean true means enables the stop button else disables it.
      searchState - boolean true means enables the search button else disables it.
    • getHelpButton

      public JButton getHelpButton()
      getHelpButton returns the help button reference
      Returns:
      JButton
    • getStatusPanel

      public JPanel getStatusPanel()