1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.preferences;
|
---|
3 |
|
---|
4 | import static java.awt.GridBagConstraints.BOTH;
|
---|
5 |
|
---|
6 | import org.openstreetmap.josm.gui.widgets.HideableTabbedPane;
|
---|
7 | import org.openstreetmap.josm.tools.GBC;
|
---|
8 |
|
---|
9 | /**
|
---|
10 | * Abstract base class for {@link TabPreferenceSetting} implementations extensible solely by inner tabs.
|
---|
11 | *
|
---|
12 | * Support for common functionality, like icon, title and adding a tab ({@link SubPreferenceSetting}).
|
---|
13 | * @since 17314
|
---|
14 | */
|
---|
15 | public abstract class ExtensibleTabPreferenceSetting extends DefaultTabPreferenceSetting {
|
---|
16 |
|
---|
17 | /**
|
---|
18 | * Constructs a new {@code ExtensibleTabPreferenceSetting}.
|
---|
19 | */
|
---|
20 | protected ExtensibleTabPreferenceSetting() {
|
---|
21 | this(null, null, null);
|
---|
22 | }
|
---|
23 |
|
---|
24 | protected ExtensibleTabPreferenceSetting(String iconName, String title, String description) {
|
---|
25 | this(iconName, title, description, false);
|
---|
26 | }
|
---|
27 |
|
---|
28 | protected ExtensibleTabPreferenceSetting(String iconName, String title, String description, boolean isExpert) {
|
---|
29 | super(iconName, title, description, isExpert, new HideableTabbedPane());
|
---|
30 | }
|
---|
31 |
|
---|
32 | @Override
|
---|
33 | public void addGui(PreferenceTabbedPane gui) {
|
---|
34 | gui.createPreferenceTab(this).add(getTabPane(), GBC.eol().fill(BOTH));
|
---|
35 | }
|
---|
36 | }
|
---|