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 org.jamesii.core.data.DBConnectionData;
19  import org.jamesii.core.util.misc.Pair;
20  
21  import p3j.gui.panels.PropertiesShowPanelFactory;
22  
23  /**
24   * Provides the means to configure a database connection via the user interface.
25   * 
26   * @see p3j.gui.dialogs.PreferencesDialog
27   * 
28   *      Created on 28.10.2012
29   * 
30   * @author Christina Bohk
31   * @author Roland Ewald
32   */
33  public interface IPreferencesUIProvider {
34  
35    /**
36     * Gets the required height of the UI elements.
37     * 
38     * @return the height of the UI elements
39     */
40    int getHeight();
41  
42    /**
43     * Adds the UI elements via a properties panel factory.
44     * 
45     * @param pspf
46     *          the properties panel factory
47     * @param connData
48     *          the current connection data
49     */
50    void addUIElements(PropertiesShowPanelFactory pspf,
51        Pair<DBConnectionData, String> connData);
52  
53    /**
54     * Gets the database connection preferences.
55     * 
56     * @return the connection preferences
57     */
58    Pair<DBConnectionData, String> getDBPreferences();
59  
60    /**
61     * Sets the database connection preferences.
62     * 
63     * @param prefs
64     *          the preferences
65     */
66    void setDBPreferences(Pair<DBConnectionData, String> prefs);
67  
68  }