View Javadoc

1   /*
2    * Copyright 2006 - 2012 Christina Bohk and Roland Ewald
3    *  
4    * Licensed under the Apache License, Version 2.0 (the "License"); 
5    * you may not use this file except in compliance with the License. 
6    * You may obtain a copy of the License at 
7    *  
8    *  http://www.apache.org/licenses/LICENSE-2.0
9    *  
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
13   * See the License for the specific language governing permissions and 
14   * limitations under the License. 
15   */
16  package p3j.database;
17  
18  import james.core.data.DBConnectionData;
19  import james.core.util.misc.Pair;
20  import p3j.gui.panels.PropertiesShowPanelFactory;
21  
22  /**
23   * Provides the means to configure a database connection via the user interface.
24   * 
25   * @see p3j.gui.dialogs.PreferencesDialog
26   * 
27   *      Created on 28.10.2012
28   * 
29   * @author Christina Bohk
30   * @author Roland Ewald
31   */
32  public interface IPreferencesUIProvider {
33  
34    /**
35     * Gets the required height of the UI elements.
36     * 
37     * @return the height of the UI elements
38     */
39    int getHeight();
40  
41    /**
42     * Adds the UI elements via a properties panel factory.
43     * 
44     * @param pspf
45     *          the properties panel factory
46     * @param connData
47     *          the current connection data
48     */
49    void addUIElements(PropertiesShowPanelFactory pspf,
50        Pair<DBConnectionData, String> connData);
51  
52    /**
53     * Gets the database connection preferences.
54     * 
55     * @return the connection preferences
56     */
57    Pair<DBConnectionData, String> getDBPreferences();
58  
59    /**
60     * Sets the database connection preferences.
61     * 
62     * @param prefs
63     *          the preferences
64     */
65    void setDBPreferences(Pair<DBConnectionData, String> prefs);
66  
67  }