2 * Copyright (C) 2009 The Android Open Source Project
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
17 package com.android.sdkuilib.internal.repository;
\r
19 import java.net.URL;
\r
20 import java.util.Properties;
\r
23 * Interface that a settings page must implement.
\r
25 public interface ISettingsPage {
\r
28 * Java system setting picked up by {@link URL} for http proxy port.
\r
31 public static final String KEY_HTTP_PROXY_PORT = "http.proxyPort"; //$NON-NLS-1$
\r
33 * Java system setting picked up by {@link URL} for http proxy host.
\r
36 public static final String KEY_HTTP_PROXY_HOST = "http.proxyHost"; //$NON-NLS-1$
\r
38 * Setting to force using http:// instead of https:// connections.
\r
42 public static final String KEY_FORCE_HTTP = "sdkman.force.http"; //$NON-NLS-1$
\r
44 * Setting to display only packages that are new or updates.
\r
48 public static final String KEY_SHOW_UPDATE_ONLY = "sdkman.show.update.only"; //$NON-NLS-1$
\r
50 * Setting to ask for permission before restarting ADB.
\r
54 public static final String KEY_ASK_ADB_RESTART = "sdkman.ask.adb.restart"; //$NON-NLS-1$
\r
56 /** Loads settings from the given {@link Properties} container and update the page UI. */
\r
57 public abstract void loadSettings(Properties in_settings);
\r
59 /** Called by the application to retrieve settings from the UI and store them in
\r
60 * the given {@link Properties} container. */
\r
61 public abstract void retrieveSettings(Properties out_settings);
\r
64 * Called by the application to give a callback that the page should invoke when
\r
65 * settings have changed.
\r
67 public abstract void setOnSettingsChanged(SettingsChangedCallback settingsChangedCallback);
\r
70 * Callback used to notify the application that settings have changed and need to be
\r
73 public interface SettingsChangedCallback {
\r
75 * Invoked by the settings page when settings have changed and need to be
\r
76 * applied. The application will call {@link ISettingsPage#retrieveSettings(Properties)}
\r
77 * and apply the new settings.
\r
79 public abstract void onSettingsChanged(ISettingsPage page);
\r