diff options
Diffstat (limited to 'platform/platform-impl/src/com/intellij/help')
-rw-r--r-- | platform/platform-impl/src/com/intellij/help/impl/HelpManagerImpl.java | 11 | ||||
-rw-r--r-- | platform/platform-impl/src/com/intellij/help/impl/MacHelpUtil.java | 12 |
2 files changed, 11 insertions, 12 deletions
diff --git a/platform/platform-impl/src/com/intellij/help/impl/HelpManagerImpl.java b/platform/platform-impl/src/com/intellij/help/impl/HelpManagerImpl.java index ac197b192284..340fbb9ae186 100644 --- a/platform/platform-impl/src/com/intellij/help/impl/HelpManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/help/impl/HelpManagerImpl.java @@ -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. @@ -49,18 +49,17 @@ public class HelpManagerImpl extends HelpManager { private Object myFXHelpBrowser = null; public void invokeHelp(@Nullable String id) { - if (myHelpSet == null) { myHelpSet = createHelpSet(); } - if (SystemInfo.isJavaVersionAtLeast("1.7.0.40") && Registry.is("ide.help.fxbrowser")) { - showHelpInFXBrowser(id); + if (MacHelpUtil.isApplicable() && MacHelpUtil.invokeHelp(id)) { return; } - if (MacHelpUtil.isApplicable()) { - if (MacHelpUtil.invokeHelp(id)) return; + if (SystemInfo.isJavaVersionAtLeast("1.7.0.40") && Registry.is("ide.help.fxbrowser")) { + showHelpInFXBrowser(id); + return; } if (myHelpSet == null) { diff --git a/platform/platform-impl/src/com/intellij/help/impl/MacHelpUtil.java b/platform/platform-impl/src/com/intellij/help/impl/MacHelpUtil.java index a73295c90f74..27fd6f52e4a6 100644 --- a/platform/platform-impl/src/com/intellij/help/impl/MacHelpUtil.java +++ b/platform/platform-impl/src/com/intellij/help/impl/MacHelpUtil.java @@ -28,20 +28,20 @@ import org.jetbrains.annotations.Nullable; */ public class MacHelpUtil { static boolean invokeHelp(@NonNls @Nullable String id) { - id = id == null || "top".equals(id) ? "startpage" : id; + if (id == null || "top".equals(id)) id = "startpage"; - final ID mainBundle = Foundation.invoke("NSBundle", "mainBundle"); - final ID helpBundle = Foundation.invoke(mainBundle, "objectForInfoDictionaryKey:", Foundation.nsString("CFBundleHelpBookName")); + ID mainBundle = Foundation.invoke("NSBundle", "mainBundle"); + ID helpBundle = Foundation.invoke(mainBundle, "objectForInfoDictionaryKey:", Foundation.nsString("CFBundleHelpBookName")); if (helpBundle.equals(ID.NIL)) { return false; } - final ID helpManager = Foundation.invoke("NSHelpManager", "sharedHelpManager"); + + ID helpManager = Foundation.invoke("NSHelpManager", "sharedHelpManager"); Foundation.invoke(helpManager, "openHelpAnchor:inBook:", Foundation.nsString(id), helpBundle); return true; } static boolean isApplicable() { - return SystemInfo.isMac && Registry.is("ide.mac.show.native.help") && !PlatformUtils.isCidr() && !PlatformUtils - .isIdeaCommunity(); + return SystemInfo.isMac && Registry.is("ide.mac.show.native.help") && !PlatformUtils.isCidr() && !PlatformUtils.isIdeaCommunity(); } } |