summaryrefslogtreecommitdiff
path: root/platform/platform-api/src/com/intellij/util/PlatformUtils.java
blob: dfcb5ccf624f2462dc56002442d49ed5ee9917f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*
 * Copyright 2000-2014 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.intellij.util;

import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.Nullable;

/**
 * @author Konstantin Bulenkov
 */
@SuppressWarnings({"deprecation", "UnusedDeclaration"})
public class PlatformUtils {
  public static final String PLATFORM_PREFIX_KEY = PlatformUtilsCore.PLATFORM_PREFIX_KEY;

  public static final String IDEA_PREFIX = PlatformUtilsCore.IDEA_PREFIX;
  public static final String IDEA_CE_PREFIX = PlatformUtilsCore.COMMUNITY_PREFIX;
  public static final String APPCODE_PREFIX = PlatformUtilsCore.APPCODE_PREFIX;
  public static final String CLION_PREFIX = PlatformUtilsCore.CLION_PREFIX;
  public static final String PYCHARM_PREFIX = PlatformUtilsCore.PYCHARM_PREFIX;
  public static final String PYCHARM_CE_PREFIX = PlatformUtilsCore.PYCHARM_PREFIX2;
  public static final String RUBY_PREFIX = PlatformUtilsCore.RUBY_PREFIX;
  public static final String PHP_PREFIX = PlatformUtilsCore.PHP_PREFIX;
  public static final String WEB_PREFIX = PlatformUtilsCore.WEB_PREFIX;
  public static final String DBE_PREFIX = PlatformUtilsCore.DBE_PREFIX;

  private PlatformUtils() { }

  public static String getPlatformPrefix() {
    return PlatformUtilsCore.getPlatformPrefix();
  }

  public static String getPlatformPrefix(String defaultPrefix) {
    return PlatformUtilsCore.getPlatformPrefix(defaultPrefix);
  }

  public static boolean isIntelliJ() {
    return PlatformUtilsCore.isIntelliJ();
  }

  public static boolean isIdeaUltimate() {
    return PlatformUtilsCore.isIdea();
  }

  public static boolean isIdeaCommunity() {
    return PlatformUtilsCore.isCommunity();
  }

  public static boolean isRubyMine() {
    return PlatformUtilsCore.isRubyMine();
  }

  public static boolean isAppCode() {
    return PlatformUtilsCore.isAppCode();
  }

  public static boolean isCLion() {
    return PlatformUtilsCore.isCLion();
  }

  public static boolean isCidr() {
    return isAppCode() || isCLion();
  }

  public static boolean isPyCharm() {
    return PlatformUtilsCore.isPyCharm();
  }

  public static boolean isPyCharmPro() {
    return PlatformUtilsCore.isPyCharmPro();
  }

  public static boolean isPyCharmCommunity() {
    return PlatformUtilsCore.isPyCharmCommunity();
  }

  public static boolean isPhpStorm() {
    return PlatformUtilsCore.isPhpStorm();
  }

  public static boolean isWebStorm() {
    return PlatformUtilsCore.isWebStorm();
  }

  public static boolean isDatabaseIDE() {
    return PlatformUtilsCore.isDatabaseIDE();
  }

  public static boolean isCommunityEdition() {
    return isIdeaCommunity() || isPyCharmCommunity();
  }

  /** @deprecated not a common API; use DevKit's PsiUtil.isIdeaProject() when needed (to remove in IDEA 14) */
  @SuppressWarnings("UnusedDeclaration")
  public static boolean isIdeaProject(@Nullable Project project) { return false; }

  /** @deprecated use {@link #IDEA_CE_PREFIX} (to remove in IDEA 15) */
  @SuppressWarnings("UnusedDeclaration")
  public static final String COMMUNITY_PREFIX = IDEA_CE_PREFIX;

  /** @deprecated use {@link #isIdeaUltimate()} (to remove in IDEA 15) */
  @SuppressWarnings("UnusedDeclaration")
  public static boolean isIdea() { return isIdeaUltimate(); }

  /** @deprecated use {@link #isIdeaCommunity()} (to remove in IDEA 15) */
  @SuppressWarnings("UnusedDeclaration")
  public static boolean isCommunity() { return isIdeaCommunity(); }

  /** @deprecated use {@link #PYCHARM_CE_PREFIX} (to remove in IDEA 14) */
  @SuppressWarnings("UnusedDeclaration")
  public static final String PYCHARM_PREFIX2 = PYCHARM_CE_PREFIX;

  /** @deprecated to remove in IDEA 14 */
  @SuppressWarnings("UnusedDeclaration")
  public static final String FLEX_PREFIX = PlatformUtilsCore.FLEX_PREFIX;

  /** @deprecated to remove in IDEA 14 */
  @SuppressWarnings("UnusedDeclaration")
  public static boolean isFlexIde() { return false; }
}