platform: PlatformUtils returned to the platform

This commit is contained in:
Roman Shevchenko
2014-01-09 13:09:55 +01:00
parent 93e1f40538
commit 2e89dfbe95
16 changed files with 182 additions and 124 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* 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.
@@ -55,7 +55,7 @@ public class ProjectCheckoutListener implements CheckoutListener {
final ApplicationNamesInfo namesInfo = ApplicationNamesInfo.getInstance();
// example: "to create an IntelliJ IDEA project" (full product name is ok);
// "to create a JetBrains Astella project" (better use not full product name: "to create an Astella project")
final String productName = PlatformUtils.isIdea() ? namesInfo.getFullProductName() : namesInfo.getProductName();
final String productName = PlatformUtils.isIdeaUltimate() ? namesInfo.getFullProductName() : namesInfo.getProductName();
final String article = StringUtil.isVowel(Character.toLowerCase(productName.charAt(0))) ? "an " : "a ";
return article + productName;
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2011 JetBrains s.r.o.
* 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.
@@ -29,7 +29,7 @@ public class JavaCodeStyleSettingsProvider extends CodeStyleSettingsProvider {
@NotNull
@Override
public Configurable createSettingsPage(CodeStyleSettings settings, CodeStyleSettings originalSettings) {
return new CodeStyleAbstractConfigurable(settings, originalSettings, "Java") {
return new CodeStyleAbstractConfigurable(settings, originalSettings, "Java") {
protected CodeStyleAbstractPanel createPanel(final CodeStyleSettings settings) {
return new JavaCodeStyleMainPanel(getCurrentSettings(), settings);
}
@@ -41,7 +41,7 @@ public class JavaCodeStyleSettingsProvider extends CodeStyleSettingsProvider {
@Override
public DisplayPriority getPriority() {
return PlatformUtils.isIdea() ? DisplayPriority.KEY_LANGUAGE_SETTINGS : DisplayPriority.LANGUAGE_SETTINGS;
return PlatformUtils.isIdeaUltimate() ? DisplayPriority.KEY_LANGUAGE_SETTINGS : DisplayPriority.LANGUAGE_SETTINGS;
}
@Override
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* 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.
@@ -74,7 +74,7 @@ public class JavaLanguageCodeStyleSettingsProvider extends LanguageCodeStyleSett
@Override
public DisplayPriority getDisplayPriority() {
if (PlatformUtils.isIdea()) return DisplayPriority.KEY_LANGUAGE_SETTINGS;
if (PlatformUtils.isIdeaUltimate()) return DisplayPriority.KEY_LANGUAGE_SETTINGS;
return DisplayPriority.LANGUAGE_SETTINGS;
}
@@ -185,7 +185,7 @@ public class JavaLanguageCodeStyleSettingsProvider extends LanguageCodeStyleSett
"\n" +
" public void foo(int x, int y) {" +
" Runnable r = () -> {};\n" +
" Runnable r1 = this :: bar;\n" +
" Runnable r1 = this :: bar;\n" +
" for (int i = 0; i < x; i++) {\n" +
" y += (y ^ 0x123) << 2;\n" +
" }\n" +
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* 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.
@@ -15,8 +15,10 @@
*/
package com.intellij.util;
/** @deprecated use PlatformUtils (to remove in IDEA 14) */
public class PlatformUtilsCore {
public static final String PLATFORM_PREFIX_KEY = "idea.platform.prefix";
public static final String IDEA_PREFIX = "idea";
public static final String COMMUNITY_PREFIX = "Idea";
public static final String APPCODE_PREFIX = "AppCode";
@@ -36,6 +38,10 @@ public class PlatformUtilsCore {
return System.getProperty(PLATFORM_PREFIX_KEY, defaultPrefix);
}
public static boolean isIntelliJ() {
return isIdea() || isCommunity();
}
public static boolean isIdea() {
return IDEA_PREFIX.equals(getPlatformPrefix());
}
@@ -57,8 +63,15 @@ public class PlatformUtilsCore {
}
public static boolean isPyCharm() {
String prefix = getPlatformPrefix();
return PYCHARM_PREFIX.equals(prefix) || (prefix != null && prefix.startsWith(PYCHARM_PREFIX2));
return isPyCharmPro() || isPyCharmCommunity();
}
static boolean isPyCharmPro() {
return PYCHARM_PREFIX.equals(getPlatformPrefix());
}
static boolean isPyCharmCommunity() {
return PYCHARM_PREFIX2.equals(getPlatformPrefix());
}
public static boolean isPhpStorm() {
@@ -68,8 +81,4 @@ public class PlatformUtilsCore {
public static boolean isWebStorm() {
return WEB_PREFIX.equals(getPlatformPrefix());
}
public static boolean isIntelliJ() {
return isIdea() || isCommunity();
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.ide.ui;
import com.intellij.ide.IdeBundle;
@@ -51,14 +50,24 @@ import static com.intellij.util.ui.UIUtil.isValidFont;
)}
)
public class UISettings implements PersistentStateComponent<UISettings>, ExportableApplicationComponent {
private final EventListenerList myListenerList;
/** Not tabbed pane. */
public static final int TABS_NONE = 0;
@Property(filter = FontFilter.class)
@NonNls
public String FONT_FACE;
@Property(filter = FontFilter.class)
public int FONT_SIZE;
public static UISettings getInstance() {
return ApplicationManager.getApplication().getComponent(UISettings.class);
}
/**
* Use this method if you are not sure whether the application is initialized.
* @return persisted UISettings instance or default values.
*/
public static UISettings getShadowInstance() {
Application application = ApplicationManager.getApplication();
return application != null ? getInstance() : new UISettings();
}
@Property(filter = FontFilter.class) public String FONT_FACE;
@Property(filter = FontFilter.class) public int FONT_SIZE;
public int RECENT_FILES_LIMIT = 50;
public int CONSOLE_COMMAND_HISTORY_LIMIT = 300;
public int EDITOR_TAB_LIMIT = 10;
@@ -77,14 +86,14 @@ public class UISettings implements PersistentStateComponent<UISettings>, Exporta
public boolean SHOW_NAVIGATION_BAR = true;
public boolean ALWAYS_SHOW_WINDOW_BUTTONS = false;
public boolean CYCLE_SCROLLING = true;
public boolean SCROLL_TAB_LAYOUT_IN_EDITOR = PlatformUtilsCore.isAppCode();
public boolean SCROLL_TAB_LAYOUT_IN_EDITOR = false;
public boolean SHOW_CLOSE_BUTTON = true;
public int EDITOR_TAB_PLACEMENT = 1;
public boolean HIDE_KNOWN_EXTENSION_IN_TABS = false;
public boolean SHOW_ICONS_IN_QUICK_NAVIGATION = true;
public boolean CLOSE_NON_MODIFIED_FILES_FIRST = false;
public boolean ACTIVATE_MRU_EDITOR_ON_CLOSE = false;
public boolean ACTIVATE_RIGHT_EDITOR_ON_CLOSE = PlatformUtilsCore.isAppCode();
public boolean ACTIVATE_RIGHT_EDITOR_ON_CLOSE = false;
public boolean ANTIALIASING_IN_EDITOR = true;
public boolean MOVE_MOUSE_ON_DEFAULT_BUTTON = false;
public boolean ENABLE_ALPHA_MODE = false;
@@ -104,18 +113,10 @@ public class UISettings implements PersistentStateComponent<UISettings>, Exporta
public boolean DEFAULT_AUTOSCROLL_TO_SOURCE = false;
public boolean PRESENTATION_MODE = false;
public int PRESENTATION_MODE_FONT_SIZE = 24;
/**
* Defines whether asterisk is shown on modified editor tab or not
*/
public boolean MARK_MODIFIED_TABS_WITH_ASTERISK = false;
public boolean SHOW_DIRECTORY_FOR_NON_UNIQUE_FILENAMES = false;
/**
* Not tabbed pane
*/
public static final int TABS_NONE = 0;
private final EventListenerList myListenerList;
public UISettings() {
myListenerList = new EventListenerList();
@@ -124,11 +125,11 @@ public class UISettings implements PersistentStateComponent<UISettings>, Exporta
}
private void tweakPlatformDefaults() {
// TODO: Make it pluggable
// TODO[anton] consider making all IDEs use the same settings
if (PlatformUtilsCore.isAppCode()) {
SHOW_MAIN_TOOLBAR = false;
SCROLL_TAB_LAYOUT_IN_EDITOR = true;
ACTIVATE_RIGHT_EDITOR_ON_CLOSE = true;
SHOW_ICONS_IN_MENUS = false;
SHOW_MEMORY_INDICATOR = false;
}
}
@@ -140,7 +141,7 @@ public class UISettings implements PersistentStateComponent<UISettings>, Exporta
}
public void addUISettingsListener(@NotNull final UISettingsListener listener, @NotNull Disposable parentDisposable) {
myListenerList.add(UISettingsListener.class,listener);
myListenerList.add(UISettingsListener.class, listener);
Disposer.register(parentDisposable, new Disposable() {
@Override
public void dispose() {
@@ -153,27 +154,14 @@ public class UISettings implements PersistentStateComponent<UISettings>, Exporta
* Notifies all registered listeners that UI settings has been changed.
*/
public void fireUISettingsChanged() {
UISettingsListener[] listeners= myListenerList.getListeners(UISettingsListener.class);
UISettingsListener[] listeners = myListenerList.getListeners(UISettingsListener.class);
for (UISettingsListener listener : listeners) {
listener.uiSettingsChanged(this);
}
}
public static UISettings getInstance() {
return ApplicationManager.getApplication().getComponent(UISettings.class);
}
/**
* Use this method if you are not sure is application initialized or not
* @return UISettings instance or default values
*/
public static UISettings getShadowInstance() {
Application application = ApplicationManager.getApplication();
return application != null ? getInstance() : new UISettings();
}
public void removeUISettingsListener(UISettingsListener listener) {
myListenerList.remove(UISettingsListener.class,listener);
myListenerList.remove(UISettingsListener.class, listener);
}
private void setSystemFontFaceAndSize() {
@@ -322,24 +310,27 @@ public class UISettings implements PersistentStateComponent<UISettings>, Exporta
}
@NotNull
@Override
public File[] getExportFiles() {
return new File[]{PathManager.getOptionsFile("ui.lnf")};
}
@NotNull
@Override
public String getPresentableName() {
return IdeBundle.message("ui.settings");
}
@NonNls
@NotNull
@Override
public String getComponentName() {
return "UISettings";
}
public void initComponent() {
}
@Override
public void initComponent() { }
public void disposeComponent() {
}
@Override
public void disposeComponent() { }
}
@@ -1,3 +1,18 @@
/*
* 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.ide.projectView.impl;
import com.intellij.icons.AllIcons;
@@ -11,12 +26,9 @@ import com.intellij.openapi.util.Comparing;
import com.intellij.util.PlatformUtils;
/**
* Created by IntelliJ IDEA.
* User: anna
* Date: 8/5/11
* Time: 9:33 PM
* To change this template use File | Settings | File Templates.
*/
* @author anna
* @since 8/5/11
*/
public abstract class ShowModulesAction extends ToggleAction {
private final Project myProject;
@@ -48,8 +60,6 @@ public abstract class ShowModulesAction extends ToggleAction {
}
private static boolean hasModules() {
return PlatformUtils.isIdea() ||
PlatformUtils.isCommunity() ||
PlatformUtils.isFlexIde();
return PlatformUtils.isIntelliJ();
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* 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.
@@ -57,7 +57,7 @@ public class ModuleDeleteProvider implements DeleteProvider, TitledHandler {
private static boolean isPrimaryModule(Module[] modules) {
if (!ProjectAttachProcessor.canAttachToProject()) {
return !PlatformUtils.isIdea();
return !PlatformUtils.isIdeaUltimate();
}
for (Module module : modules) {
final File moduleFile = new File(module.getModuleFilePath());
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* 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.
@@ -22,61 +22,76 @@ import org.jetbrains.annotations.Nullable;
/**
* @author Konstantin Bulenkov
*/
public class PlatformUtils extends PlatformUtilsCore {
private PlatformUtils() {
}
@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 CPP_PREFIX = PlatformUtilsCore.CPP_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;
private PlatformUtils() { }
public static String getPlatformPrefix() {
return getPlatformPrefix(IDEA_PREFIX);
return PlatformUtilsCore.getPlatformPrefix();
}
public static String getPlatformPrefix(String defaultPrefix) {
return System.getProperty(PLATFORM_PREFIX_KEY, defaultPrefix);
return PlatformUtilsCore.getPlatformPrefix(defaultPrefix);
}
public static boolean isIdea() {
return IDEA_PREFIX.equals(getPlatformPrefix());
public static boolean isIntelliJ() {
return PlatformUtilsCore.isIntelliJ();
}
public static boolean isCommunity() {
return COMMUNITY_PREFIX.equals(getPlatformPrefix());
public static boolean isIdeaUltimate() {
return PlatformUtilsCore.isIdea();
}
public static boolean isIdeaCommunity() {
return PlatformUtilsCore.isCommunity();
}
public static boolean isRubyMine() {
return RUBY_PREFIX.equals(getPlatformPrefix());
return PlatformUtilsCore.isRubyMine();
}
public static boolean isAppCode() {
return PlatformUtilsCore.isAppCode();
}
public static boolean isCppIde() {
return PlatformUtilsCore.isCppIde();
}
public static boolean isCidr() {
return isAppCode() || isCppIde();
}
public static boolean isAppCode() {
return APPCODE_PREFIX.equals(getPlatformPrefix());
}
public static boolean isCppIde() {
return CPP_PREFIX.equals(getPlatformPrefix());
}
public static boolean isPyCharm() {
String prefix = getPlatformPrefix();
return PYCHARM_PREFIX.equals(prefix) || (prefix != null && prefix.startsWith(PYCHARM_PREFIX2));
return PlatformUtilsCore.isPyCharm();
}
public static boolean isPyCharmPro() {
return PlatformUtilsCore.isPyCharmPro();
}
public static boolean isPyCharmCommunity() {
return PlatformUtilsCore.isPyCharmCommunity();
}
public static boolean isPhpStorm() {
return PHP_PREFIX.equals(getPlatformPrefix());
return PlatformUtilsCore.isPhpStorm();
}
public static boolean isWebStorm() {
return WEB_PREFIX.equals(getPlatformPrefix());
}
public static boolean isFlexIde() {
return FLEX_PREFIX.equals(getPlatformPrefix());
}
public static boolean isIntelliJ() {
return isIdea() || isCommunity();
return PlatformUtilsCore.isWebStorm();
}
public static boolean isIdeaProject(@Nullable Project project) {
@@ -85,4 +100,28 @@ public class PlatformUtils extends PlatformUtilsCore {
if (baseDir == null) return false;
return baseDir.findChild("idea.iml") != null || baseDir.findChild("community-main.iml") != null;
}
/** @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; }
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* 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.
@@ -41,6 +41,7 @@ public class MacHelpUtil {
}
static boolean isApplicable() {
return SystemInfo.isMac && Registry.is("ide.mac.show.native.help", false) && !PlatformUtils.isCidr() && !PlatformUtils.isCommunity();
return SystemInfo.isMac && Registry.is("ide.mac.show.native.help", false) && !PlatformUtils.isCidr() && !PlatformUtils
.isIdeaCommunity();
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* 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.
@@ -134,7 +134,7 @@ public class CreateDesktopEntryAction extends DumbAwareAction {
assert new File(binPath).isDirectory() : "Invalid bin/ path: '" + binPath + "'";
String name = ApplicationNamesInfo.getInstance().getFullProductName();
if (PlatformUtils.isCommunity()) name += " Community Edition";
if (PlatformUtils.isIdeaCommunity()) name += " Community Edition";
final String iconPath = AppUIUtil.findIcon(binPath);
if (iconPath == null) {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* 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.
@@ -191,10 +191,10 @@ public class ApplicationInfoImpl extends ApplicationInfoEx implements JDOMExtern
private static String getProductPrefix() {
String prefix = null;
if (PlatformUtils.isCommunity()) {
if (PlatformUtils.isIdeaCommunity()) {
prefix = "IC";
}
else if (PlatformUtils.isIdea()) {
else if (PlatformUtils.isIdeaUltimate()) {
prefix = "IU";
}
return prefix;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* 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.
@@ -1072,7 +1072,7 @@ public class FileTypeManagerImpl extends FileTypeManagerEx implements NamedJDOME
}
public static String getFileTypeComponentName() {
return PlatformUtils.isCommunity() ? "CommunityFileTypes" : "FileTypeManager";
return PlatformUtils.isIdeaCommunity() ? "CommunityFileTypes" : "FileTypeManager";
}
public FileTypeAssocTable getExtensionMap() {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* 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.
@@ -90,7 +90,7 @@ public class PluginsAdvertiser implements StartupActivity {
final JsonObject jsonObject = jsonElement.getAsJsonObject();
final JsonElement pluginId = jsonObject.get("pluginId");
final JsonElement bundled = jsonObject.get("bundled");
result.add(new Plugin(PluginId.getId(StringUtil.unquoteString(pluginId.toString())),
result.add(new Plugin(PluginId.getId(StringUtil.unquoteString(pluginId.toString())),
Boolean.parseBoolean(StringUtil.unquoteString(bundled.toString()))));
}
return result;
@@ -132,7 +132,7 @@ public class PluginsAdvertiser implements StartupActivity {
final IdeaPluginDescriptor loadedPlugin = PluginManager.getPlugin(PluginId.getId(pluginId));
if (loadedPlugin != null && loadedPlugin.isEnabled()) continue;
if (loadedPlugin != null && fromServerPluginDescription != null &&
if (loadedPlugin != null && fromServerPluginDescription != null &&
StringUtil.compareVersionNumbers(loadedPlugin.getVersion(), fromServerPluginDescription.getVersion()) >= 0) continue;
final JsonElement ext = jsonObject.get("implementationName");
@@ -188,7 +188,7 @@ public class PluginsAdvertiser implements StartupActivity {
}
public static void openDownloadPage() {
BrowserUtil.open(ApplicationInfo.getInstance().getCompanyURL());
BrowserUtil.open(ApplicationInfo.getInstance().getCompanyURL());
}
static void enablePlugins(Project project, final Collection<IdeaPluginDescriptor> disabledPlugins) {
@@ -216,7 +216,7 @@ public class PluginsAdvertiser implements StartupActivity {
}
static boolean hasBundledPluginToInstall(Collection<Plugin> plugins) {
if (PlatformUtils.isIdea()) return false;
if (PlatformUtils.isIdeaUltimate()) return false;
for (Plugin plugin : plugins) {
if (plugin.myBundled && PluginManager.getPlugin(PluginId.getId(plugin.myPluginId)) == null) {
return true;
@@ -275,7 +275,7 @@ public class PluginsAdvertiser implements StartupActivity {
if (pluginDescriptor != null) {
myDisabledPlugins.put(plugin, pluginDescriptor);
}
}
}
}
myBundledPlugins = hasBundledPluginToInstall(ids.values());
@@ -363,7 +363,7 @@ public class PluginsAdvertiser implements StartupActivity {
}
}
}
@Tag("plugin")
public static class Plugin implements Comparable<Plugin> {
public String myPluginId;
@@ -415,7 +415,7 @@ public class PluginsAdvertiser implements StartupActivity {
public ConfigurePluginsListener(Set<UnknownFeature> unknownFeatures,
Project project,
List<IdeaPluginDescriptor> allPlugins,
Set<PluginDownloader> plugins,
Set<PluginDownloader> plugins,
Map<Plugin, IdeaPluginDescriptor> disabledPlugins) {
myUnknownFeatures = unknownFeatures;
myProject = project;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* 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.
@@ -122,7 +122,7 @@ public class AppUIUtil {
if ("true".equals(System.getProperty("idea.debug.mode"))) {
wmClass += "-debug";
}
return PlatformUtils.isCommunity() ? wmClass + "-ce" : wmClass;
return PlatformUtils.isIdeaCommunity() ? wmClass + "-ce" : wmClass;
}
public static void registerBundledFonts() {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* 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.
@@ -17,7 +17,6 @@ package com.intellij.idea;
import com.intellij.ide.plugins.PluginManager;
import com.intellij.util.PlatformUtils;
import com.intellij.util.PlatformUtilsCore;
import javax.swing.*;
@@ -29,7 +28,7 @@ public class MainImpl {
* Called from PluginManager via reflection.
*/
protected static void start(final String[] args) {
System.setProperty(PlatformUtilsCore.PLATFORM_PREFIX_KEY, PlatformUtils.getPlatformPrefix(PlatformUtilsCore.COMMUNITY_PREFIX));
System.setProperty(PlatformUtils.PLATFORM_PREFIX_KEY, PlatformUtils.getPlatformPrefix(PlatformUtils.IDEA_CE_PREFIX));
StartupUtil.prepareAndStart(args, new StartupUtil.AppStarter() {
@Override
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* 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.
@@ -145,11 +145,14 @@ public class PluginRunConfiguration extends RunConfigurationBase implements Modu
String prefix = null;
if (buildNumber.startsWith("IC")) {
prefix = PlatformUtils.COMMUNITY_PREFIX;
prefix = PlatformUtils.IDEA_CE_PREFIX;
}
else if (buildNumber.startsWith("PY")) {
prefix = PlatformUtils.PYCHARM_PREFIX;
}
else if (buildNumber.startsWith("PC")) {
prefix = PlatformUtils.PYCHARM_CE_PREFIX;
}
else if (buildNumber.startsWith("RM")) {
prefix = PlatformUtils.RUBY_PREFIX;
}
@@ -162,7 +165,13 @@ public class PluginRunConfiguration extends RunConfigurationBase implements Modu
else if (buildNumber.startsWith("OC")) {
prefix = buildNumber.contains("121") ? "CIDR" : PlatformUtils.APPCODE_PREFIX;
}
if (prefix != null) vm.defineProperty(PlatformUtils.PLATFORM_PREFIX_KEY, prefix);
else if (buildNumber.startsWith("CP")) {
prefix = PlatformUtils.CPP_PREFIX;
}
if (prefix != null) {
vm.defineProperty(PlatformUtils.PLATFORM_PREFIX_KEY, prefix);
}
}
}