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 * @param gui the preferences tab pane 013 */ 014 void addGui(PreferenceTabbedPane gui); 015 016 /** 017 * Called when OK is pressed to save the setting in the preferences file. 018 * Return true when restart is required. 019 * @return {@code true} if restart is required 020 */ 021 boolean ok(); 022 023 /** 024 * Called to know if the preferences tab has only to be displayed in expert mode. 025 * @return true if the tab has only to be displayed in expert mode, false otherwise. 026 */ 027 boolean isExpert(); 028}