IDEA-206131: move “Share” checkbox in Scopes dialog to the right top

This commit is contained in:
Sergey Malenkov
2019-02-05 16:22:05 +03:00
parent cc2dce709e
commit c8c8585990
2 changed files with 20 additions and 7 deletions
@@ -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<NamedScope> {
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<NamedScope> {
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<NamedScope> {
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
@@ -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