From c8c8585990059b4dd96ab7a0eb7b3305c3145e39 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Tue, 5 Feb 2019 16:21:46 +0300 Subject: [PATCH] =?UTF-8?q?IDEA-206131:=20move=20=E2=80=9CShare=E2=80=9D?= =?UTF-8?q?=20checkbox=20in=20Scopes=20dialog=20to=20the=20right=20top?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../util/scopeChooser/ScopeConfigurable.java | 24 ++++++++++++++----- .../src/messages/IdeBundle.properties | 3 ++- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/util/scopeChooser/ScopeConfigurable.java b/platform/lang-impl/src/com/intellij/ide/util/scopeChooser/ScopeConfigurable.java index bcb65c099267..92d170ef70c2 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/scopeChooser/ScopeConfigurable.java +++ b/platform/lang-impl/src/com/intellij/ide/util/scopeChooser/ScopeConfigurable.java @@ -2,6 +2,7 @@ package com.intellij.ide.util.scopeChooser; +import com.intellij.icons.AllIcons; import com.intellij.ide.IdeBundle; import com.intellij.openapi.Disposable; import com.intellij.openapi.options.ConfigurationException; @@ -28,7 +29,8 @@ public class ScopeConfigurable extends NamedConfigurable { private ScopeEditorPanel myPanel; private String myPackageSet; private final JCheckBox mySharedCheckbox; - private boolean myShareScope = false; + private final JLabel mySharedContextHelp; + private boolean myShareScope; private final Project myProject; private Icon myIcon; @@ -38,6 +40,9 @@ public class ScopeConfigurable extends NamedConfigurable { myShareScope = shareScope; myProject = project; mySharedCheckbox = new JCheckBox(IdeBundle.message("share.scope.checkbox.title"), shareScope); + mySharedContextHelp = new JLabel(AllIcons.General.ContextHelp); + mySharedContextHelp.setToolTipText(IdeBundle.message("share.scope.context.help")); + mySharedContextHelp.setBorder(JBUI.Borders.empty(0, 5)); myPanel = new ScopeEditorPanel(project, getHolder()); myIcon = getHolder(myShareScope).getIcon(); mySharedCheckbox.addActionListener(e -> { @@ -89,13 +94,20 @@ public class ScopeConfigurable extends NamedConfigurable { return "project.scopes"; } + @Nullable + @Override + protected JComponent createTopRightComponent() { + JPanel panel = new JPanel(new BorderLayout()); + panel.add(BorderLayout.WEST, mySharedCheckbox); + panel.add(BorderLayout.EAST, mySharedContextHelp); + return panel; + } + @Override public JComponent createOptionsPanel() { - final JPanel wholePanel = new JPanel(new BorderLayout()); - wholePanel.add(myPanel.getPanel(), BorderLayout.CENTER); - wholePanel.add(mySharedCheckbox, BorderLayout.SOUTH); - wholePanel.setBorder(JBUI.Borders.empty(0, 10, 10, 10)); - return wholePanel; + JPanel panel = myPanel.getPanel(); + panel.setBorder(JBUI.Borders.empty(0, 10, 10, 10)); + return panel; } @Override diff --git a/platform/platform-resources-en/src/messages/IdeBundle.properties b/platform/platform-resources-en/src/messages/IdeBundle.properties index b552ad5193f3..d8e35f5167c5 100644 --- a/platform/platform-resources-en/src/messages/IdeBundle.properties +++ b/platform/platform-resources-en/src/messages/IdeBundle.properties @@ -1147,7 +1147,8 @@ project.import.open.existing.openExisting=Open Existing Project project.import.open.existing.reimport=Delete Existing Project and Import code.folding.settings=Code Folding Settings -share.scope.checkbox.title=Share scope +share.scope.checkbox.title=Share through VCS +share.scope.context.help=Shared configurations are stored in .idea directory and\nare available to other team members through VCS. bean.property=Bean Property plugin.manager.uninstalled.tooltip=Plugin was uninstalled; changes will be applied on restart plugin.manager.installed.tooltip=Plugin will be activated after restart