001 // License: GPL. Copyright 2007 by Immanuel Scholz and others
002 package 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 */
008 public 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 */
019 boolean ok();
020
021 /**
022 * Called to know if the preferences tab has only to be displayed in expert mode.
023 * @return true if the tab has only to be displayed in expert mode, false otherwise.
024 */
025 public boolean isExpert();
026 }