001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.gui.preferences;
003
004/**
005 * Base interface of Preferences settings, should not be directly implemented,
006 * see {@link TabPreferenceSetting} and {@link SubPreferenceSetting}.
007 */
008public interface PreferenceSetting {
009    /**
010     * Add the GUI elements to the dialog. The elements should be initialized after
011     * the current preferences.
012     */
013    void addGui(PreferenceTabbedPane gui);
014
015    /**
016     * Called when OK is pressed to save the setting in the preferences file.
017     * Return true when restart is required.
018     * @return {@code true} if restart is required
019     */
020    boolean ok();
021
022    /**
023     * Called to know if the preferences tab has only to be displayed in expert mode.
024     * @return true if the tab has only to be displayed in expert mode, false otherwise.
025     */
026    boolean isExpert();
027}