source: josm/trunk/src/org/openstreetmap/josm/gui/preferences/TabPreferenceSetting.java@ 5731

Last change on this file since 5731 was 5631, checked in by Don-vip, 11 years ago

Allow to access directly to validator preferences from validator dialog with a small preferences button left to pin button.
Generic approach in order to be reused by plugins using dialogs.
This leads to some changes in preferences settings system, but without any break in compatibility.
The only impact is the deprecation of some public JTabbedPane fields, that will be removed mid-2013.

File size: 3.0 KB
Line 
1// License: GPL. Copyright 2007 by Immanuel Scholz and others
2package org.openstreetmap.josm.gui.preferences;
3
4import java.awt.Component;
5
6/**
7 * Preference settings, that display a top level tab.
8 *
9 * This preference setting's addGui method is called after the user clicked the tab.
10 */
11public interface TabPreferenceSetting extends PreferenceSetting {
12
13 /**
14 * Called during preferences dialog initialization to display the preferences tab with the returned icon.
15 * @return The icon name in the preferences folder.
16 */
17 public String getIconName();
18
19 /**
20 * Called during preferences tab initialization to display its title.
21 * @return The title of this preferences tab.
22 */
23 String getTitle();
24
25 /**
26 * Called during preferences dialog initialization to display the preferences tab with the returned tooltip.
27 * @return The tooltip of this preferences tab.
28 */
29 public String getTooltip();
30
31 /**
32 * Called during preferences tab initialization to display a description in one sentence for this tab.
33 * Will be displayed in italic under the title.
34 * @return The description of this preferences tab.
35 */
36 public String getDescription();
37
38 /**
39 * Adds a new sub preference settings tab with the given title and component.
40 * @param sub The new sub preference settings.
41 * @param title The tab title.
42 * @param component The tab component.
43 * @since 5631
44 */
45 public void addSubTab(SubPreferenceSetting sub, String title, Component component);
46
47 /**
48 * Adds a new sub preference settings tab with the given title, component and tooltip.
49 * @param sub The new sub preference settings.
50 * @param title The tab title.
51 * @param component The tab component.
52 * @param tip The tab tooltip.
53 * @since 5631
54 */
55 public void addSubTab(SubPreferenceSetting sub, String title, Component component, String tip);
56
57 /**
58 * Registers a sub preference settings to an existing tab component.
59 * @param sub The new sub preference settings.
60 * @param component The component for which a tab already exists.
61 * @since 5631
62 */
63 public void registerSubTab(SubPreferenceSetting sub, Component component);
64
65 /**
66 * Returns the tab component related to the specified sub preference settings
67 * @param sub The requested sub preference settings.
68 * @return The component related to the specified sub preference settings, or null.
69 * @since 5631
70 */
71 public Component getSubTab(SubPreferenceSetting sub);
72
73 /**
74 * Selects the specified sub preference settings, if applicable. Not all Tab preference settings need to implement this.
75 * @param subPref The sub preference settings to be selected.
76 * @return true if the specified preference settings have been selected, false otherwise.
77 * @since 5631
78 */
79 public boolean selectSubTab(SubPreferenceSetting subPref);
80}
Note: See TracBrowser for help on using the repository browser.