update copyrights
[fedora-idea.git] / platform / lang-api / src / com / intellij / openapi / projectRoots / impl / UnknownSdkType.java
blobd0bf5787cfc078d7dd8b04f20d880fd29d4f300b
1 /*
2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com.intellij.openapi.projectRoots.impl;
18 import com.intellij.openapi.project.ProjectBundle;
19 import com.intellij.openapi.projectRoots.*;
20 import com.intellij.openapi.util.IconLoader;
21 import org.jdom.Element;
23 import javax.swing.*;
24 import java.util.HashMap;
25 import java.util.Map;
27 /**
28 * Used as a plug for all SDKs which type cannot be determined (for example, plugin that registered a custom type has been deinstalled)
29 * @author Eugene Zhuravlev
30 * Date: Dec 11, 2004
32 public class UnknownSdkType extends SdkType{
33 public static final Icon ICON = IconLoader.getIcon("/nodes/unknownJdkClosed.png");
34 private static final Icon JDK_ICON_EXPANDED = IconLoader.getIcon("/nodes/unknownJdkOpen.png");
35 private static final Map<String, UnknownSdkType> ourTypeNameToInstanceMap = new HashMap<String, UnknownSdkType>();
37 /**
38 * @param typeName the name of the SDK type that this SDK serves as a plug for
40 private UnknownSdkType(String typeName) {
41 super(typeName);
44 public static UnknownSdkType getInstance(String typeName) {
45 UnknownSdkType instance = ourTypeNameToInstanceMap.get(typeName);
46 if (instance == null) {
47 instance = new UnknownSdkType(typeName);
48 ourTypeNameToInstanceMap.put(typeName, instance);
50 return instance;
53 public String suggestHomePath() {
54 return null;
57 public boolean isValidSdkHome(String path) {
58 return false;
61 public String getVersionString(String sdkHome) {
62 return "";
65 public String suggestSdkName(String currentSdkName, String sdkHome) {
66 return currentSdkName;
69 public void setupSdkPaths(Sdk sdk) {
72 public AdditionalDataConfigurable createAdditionalDataConfigurable(SdkModel sdkModel, SdkModificator sdkModificator) {
73 return null;
76 public String getBinPath(Sdk sdk) {
77 return null;
80 public String getToolsPath(Sdk sdk) {
81 return null;
84 public String getVMExecutablePath(Sdk sdk) {
85 return null;
88 public void saveAdditionalData(SdkAdditionalData additionalData, Element additional) {
91 public SdkAdditionalData loadAdditionalData(Element additional) {
92 return null;
95 public String getPresentableName() {
96 return ProjectBundle.message("sdk.unknown.name");
99 public Icon getIcon() {
100 return ICON;
103 public Icon getIconForExpandedTreeNode() {
104 return JDK_ICON_EXPANDED;