OSDN Git Service

original
[gb-231r1-is01/GB_2.3_IS01.git] / sdk / sdkmanager / libs / sdklib / src / com / android / sdklib / internal / repository / SdkSourceCategory.java
diff --git a/sdk/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SdkSourceCategory.java b/sdk/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SdkSourceCategory.java
new file mode 100644 (file)
index 0000000..3afa086
--- /dev/null
@@ -0,0 +1,85 @@
+/*\r
+ * Copyright (C) 2010 The Android Open Source Project\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+package com.android.sdklib.internal.repository;\r
+\r
+\r
+/**\r
+ * The category of a given {@link SdkSource} (which represents a download site).\r
+ */\r
+public enum SdkSourceCategory implements IDescription {\r
+\r
+    /**\r
+     * The default canonical and official Android repository.\r
+     */\r
+    ANDROID_REPO("Android Repository", true),\r
+\r
+    /**\r
+     * Repositories contributed by the SDK_UPDATER_URLS env var,\r
+     * only used for local debugging.\r
+     */\r
+    GETENV_REPOS("Custom Repositories", false),\r
+\r
+    /**\r
+     * All third-party add-ons fetched from the Android repository.\r
+     */\r
+    ADDONS_3RD_PARTY("Third party Add-ons", true),\r
+\r
+    /**\r
+     * All add-ons contributed locally by the user via the "Add Add-on Site" button.\r
+     */\r
+    USER_ADDONS("User Add-ons", false),\r
+\r
+    /**\r
+     * Add-ons contributed by the SDK_UPDATER_USER_URLS env var,\r
+     * only used for local debugging.\r
+     */\r
+    GETENV_ADDONS("Custom Add-ons", false);\r
+\r
+\r
+    private final String mUiName;\r
+    private final boolean mAlwaysDisplay;\r
+\r
+    private SdkSourceCategory(String uiName, boolean alwaysDisplay) {\r
+        mUiName = uiName;\r
+        mAlwaysDisplay = alwaysDisplay;\r
+    }\r
+\r
+    /**\r
+     * Returns the UI-visible name of the cateogry. Displayed in the available package tree.\r
+     * Cannot be null nor empty.\r
+     */\r
+    public String getUiName() {\r
+        return mUiName;\r
+    }\r
+\r
+    /**\r
+     * True if this category must always be displayed by the available package tree, even\r
+     * if empty.\r
+     * When false, the category must not be displayed when empty.\r
+     */\r
+    public boolean getAlwaysDisplay() {\r
+        return mAlwaysDisplay;\r
+    }\r
+\r
+    public String getLongDescription() {\r
+        return getUiName();\r
+    }\r
+\r
+    public String getShortDescription() {\r
+        return getUiName();\r
+    }\r
+}\r