From cb56ac2833472b70beba3f4538e4305eca782b97 Mon Sep 17 00:00:00 2001 From: Anton Makeev Date: Wed, 21 Aug 2013 17:25:48 +0200 Subject: [PATCH] Cidr: isAppCode replaced with isCidr in common places --- .../codeInspection/actions/ViewOfflineResultsAction.java | 2 +- .../ide/favoritesTreeView/FavoritesTreeViewPanel.java | 2 +- .../com/intellij/ide/projectView/impl/ProjectViewImpl.java | 2 +- .../intellij/ide/projectView/impl/nodes/PsiDirectoryNode.java | 2 +- .../com/intellij/ide/util/scopeChooser/ScopeChooserCombo.java | 4 ++-- .../platform-api/src/com/intellij/util/PlatformUtils.java | 4 ++++ .../platform-impl/src/com/intellij/help/impl/MacHelpUtil.java | 2 +- .../xdebugger/impl/settings/DebuggerConfigurableProvider.java | 2 +- 8 files changed, 12 insertions(+), 8 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInspection/actions/ViewOfflineResultsAction.java b/platform/lang-impl/src/com/intellij/codeInspection/actions/ViewOfflineResultsAction.java index 82eb30685183..7e7024aaca25 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/actions/ViewOfflineResultsAction.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/actions/ViewOfflineResultsAction.java @@ -77,7 +77,7 @@ public class ViewOfflineResultsAction extends AnAction implements DumbAware { final Presentation presentation = event.getPresentation(); final Project project = event.getData(PlatformDataKeys.PROJECT); presentation.setEnabled(project != null); - presentation.setVisible(ActionPlaces.MAIN_MENU.equals(event.getPlace()) && !PlatformUtils.isAppCode()); + presentation.setVisible(ActionPlaces.MAIN_MENU.equals(event.getPlace()) && !PlatformUtils.isCidr()); } @Override diff --git a/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesTreeViewPanel.java b/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesTreeViewPanel.java index 4d63f14b531a..9764b181a123 100644 --- a/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesTreeViewPanel.java +++ b/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesTreeViewPanel.java @@ -605,7 +605,7 @@ public class FavoritesTreeViewPanel extends JPanel implements DataProvider, Dock if (helper.supportsFlattenPackages()) { group.addAction(new FavoritesAbbreviatePackageNamesAction(myProject, myBuilder)); } - if (!PlatformUtils.isAppCode()) { + if (!PlatformUtils.isCidr()) { group.add(new FavoritesShowMembersAction(myProject, myBuilder)); } diff --git a/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewImpl.java b/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewImpl.java index 7cb16b0c15c2..5760e5be09a6 100644 --- a/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewImpl.java +++ b/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewImpl.java @@ -697,7 +697,7 @@ public class ProjectViewImpl extends ProjectView implements PersistentStateCompo }).setAsSecondary(true); } - if (!PlatformUtils.isAppCode()) { + if (!PlatformUtils.isCidr()) { myActionGroup.addAction(new PaneOptionAction(myShowMembers, IdeBundle.message("action.show.members"), IdeBundle.message("action.show.hide.members"), AllIcons.ObjectBrowser.ShowMembers, ourShowMembersDefaults)) diff --git a/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/PsiDirectoryNode.java b/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/PsiDirectoryNode.java index c8d3ba2b9267..877d064c7dcd 100644 --- a/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/PsiDirectoryNode.java +++ b/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/PsiDirectoryNode.java @@ -62,7 +62,7 @@ public class PsiDirectoryNode extends BasePsiNode implements Navig } protected boolean shouldShowModuleName() { - return !PlatformUtils.isAppCode(); + return !PlatformUtils.isCidr(); } @Override diff --git a/platform/lang-impl/src/com/intellij/ide/util/scopeChooser/ScopeChooserCombo.java b/platform/lang-impl/src/com/intellij/ide/util/scopeChooser/ScopeChooserCombo.java index 8abcde7275ae..f5948938c8eb 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/scopeChooser/ScopeChooserCombo.java +++ b/platform/lang-impl/src/com/intellij/ide/util/scopeChooser/ScopeChooserCombo.java @@ -237,7 +237,7 @@ public class ScopeChooserCombo extends ComboboxWithBrowseButton implements Dispo result.add(GlobalSearchScope.allScope(project)); } - if (!PlatformUtils.isAppCode()) { // TODO: fix these scopes in AppCode + if (!PlatformUtils.isCidr()) { // TODO: fix these scopes in AppCode result.add(GlobalSearchScopes.projectProductionScope(project)); result.add(GlobalSearchScopes.projectTestScope(project)); } @@ -250,7 +250,7 @@ public class ScopeChooserCombo extends ComboboxWithBrowseButton implements Dispo dataContextElement = LangDataKeys.PSI_ELEMENT.getData(dataContext); } if (dataContextElement != null) { - if (!PlatformUtils.isAppCode()) { // TODO: have an API to disable module scopes. + if (!PlatformUtils.isCidr()) { // TODO: have an API to disable module scopes. Module module = ModuleUtilCore.findModuleForPsiElement(dataContextElement); if (module == null) { module = LangDataKeys.MODULE.getData(dataContext); diff --git a/platform/platform-api/src/com/intellij/util/PlatformUtils.java b/platform/platform-api/src/com/intellij/util/PlatformUtils.java index b768cb423927..ddc25df03363 100644 --- a/platform/platform-api/src/com/intellij/util/PlatformUtils.java +++ b/platform/platform-api/src/com/intellij/util/PlatformUtils.java @@ -56,6 +56,10 @@ public class PlatformUtils extends PlatformUtilsCore { return RUBY_PREFIX.equals(getPlatformPrefix()); } + public static boolean isCidr() { + return isAppCode() || isCppIde(); + } + public static boolean isAppCode() { return APPCODE_PREFIX.equals(getPlatformPrefix()); } 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 cfbe60e0e162..2728c456af85 100644 --- a/platform/platform-impl/src/com/intellij/help/impl/MacHelpUtil.java +++ b/platform/platform-impl/src/com/intellij/help/impl/MacHelpUtil.java @@ -41,6 +41,6 @@ public class MacHelpUtil { } static boolean isApplicable() { - return SystemInfo.isMac && Registry.is("ide.mac.show.native.help", false) && !PlatformUtils.isAppCode() && !PlatformUtils.isCommunity(); + return SystemInfo.isMac && Registry.is("ide.mac.show.native.help", false) && !PlatformUtils.isCidr() && !PlatformUtils.isCommunity(); } } diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DebuggerConfigurableProvider.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DebuggerConfigurableProvider.java index 0dba442a6375..49e2e4ac6fcd 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DebuggerConfigurableProvider.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DebuggerConfigurableProvider.java @@ -64,7 +64,7 @@ public class DebuggerConfigurableProvider extends ConfigurableProvider { //Perhaps we always should have a root node 'Debugger' with separate nodes for language-specific settings under it. //However for AppCode there is only one language which is clearly associated with the product //This code should removed when we extract the common debugger settings to the root node. - if (PlatformUtils.isAppCode() && rootConfigurable == null && configurables.size() == 1) { + if (PlatformUtils.isCidr() && rootConfigurable == null && configurables.size() == 1) { rootConfigurable = configurables.get(0); configurables = Collections.emptyList(); }