KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > suberic > pooka > gui > search > SearchForm


1 package net.suberic.pooka.gui.search;
2 import javax.swing.*;
3 import net.suberic.pooka.*;
4 import java.util.Vector JavaDoc;
5
6 public class SearchForm extends JPanel {
7     SearchEntryPanel entryPanel;
8     SearchFolderPanel folderPanel;
9     
10     public SearchForm() {
11     this.populatePanel();
12     }
13
14     public SearchForm(FolderInfo[] selectedFolders) {
15     folderPanel = new SearchFolderPanel(selectedFolders);
16     populatePanel();
17     }
18
19     public SearchForm(StoreInfo[] selectedStores) {
20     folderPanel = new SearchFolderPanel(selectedStores);
21     populatePanel();
22     }
23
24     public SearchForm(FolderInfo[] selectedFolders, Vector JavaDoc allowedValues) {
25     folderPanel = new SearchFolderPanel(selectedFolders, allowedValues);
26     populatePanel();
27     }
28
29     public SearchForm(StoreInfo[] selectedStores, Vector JavaDoc allowedValues) {
30     folderPanel = new SearchFolderPanel(selectedStores, allowedValues);
31     populatePanel();
32     }
33
34     /**
35      * Populates the SearchForm.
36      */

37     public void populatePanel() {
38     this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
39
40     this.add(folderPanel);
41     entryPanel = new SearchEntryPanel(Pooka.getSearchManager());
42     this.add(entryPanel);
43     }
44
45     public Vector JavaDoc getSelectedFolders() {
46     return folderPanel.getSelectedFolders();
47     }
48
49     public javax.mail.search.SearchTerm JavaDoc getSearchTerm() throws java.text.ParseException JavaDoc {
50     return entryPanel.getSearchTerm();
51     }
52 }
53
Popular Tags