Remove registry key: ide.new.project.settings

This commit is contained in:
Sergey Malenkov
2016-01-25 19:48:03 +03:00
parent ecd85c9bc3
commit 5887777e29
20 changed files with 85 additions and 213 deletions
@@ -18,14 +18,12 @@ package com.intellij.ide.actions;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.options.ShowSettingsUtil;
import com.intellij.openapi.options.ex.SingleConfigurableEditor;
import com.intellij.openapi.options.newEditor.SettingsDialog;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable;
import com.intellij.openapi.util.registry.Registry;
import org.jetbrains.annotations.NotNull;
public class ShowStructureSettingsAction extends AnAction implements DumbAware {
@@ -39,18 +37,12 @@ public class ShowStructureSettingsAction extends AnAction implements DumbAware {
}
static void showDialog(Project project) {
if (Registry.is("ide.new.project.settings")) {
new SingleConfigurableEditor(project, ProjectStructureConfigurable.getInstance(project), SettingsDialog.DIMENSION_KEY) {
@NotNull
@Override
protected DialogStyle getStyle() {
return DialogStyle.COMPACT;
}
}.show();
}
else {
ShowSettingsUtil
.getInstance().editConfigurable(project, SettingsDialog.DIMENSION_KEY, ProjectStructureConfigurable.getInstance(project));
}
new SingleConfigurableEditor(project, ProjectStructureConfigurable.getInstance(project), SettingsDialog.DIMENSION_KEY) {
@NotNull
@Override
protected DialogStyle getStyle() {
return DialogStyle.COMPACT;
}
}.show();
}
}
@@ -32,7 +32,6 @@ import com.intellij.openapi.util.ActionCallback;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.TabbedPaneWrapper;
import com.intellij.ui.navigation.History;
@@ -152,8 +151,8 @@ public class SdkEditor implements Configurable, Place.Navigator {
myHomeComponent.getTextField().setEditable(false);
myHomeFieldLabel = new JLabel(getHomeFieldLabelValue());
final int leftInset = Registry.is("ide.new.project.settings") ? 10 : 0;
final int rightInset = Registry.is("ide.new.project.settings") ? 10 : 0;
final int leftInset = 10;
final int rightInset = 10;
myMainPanel.add(myHomeFieldLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, leftInset, 2, 2), 0, 0));
myMainPanel.add(myHomeComponent, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, rightInset), 0, 0));
@@ -17,7 +17,6 @@ package com.intellij.openapi.roots.ui.configuration;
import com.intellij.ide.util.projectWizard.importSources.JavaModuleSourceRoot;
import com.intellij.ide.util.projectWizard.importSources.JavaSourceRootDetectionUtil;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.progress.util.ProgressWindow;
@@ -26,7 +25,6 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectBundle;
import com.intellij.openapi.roots.ContentEntry;
import com.intellij.openapi.roots.ModifiableRootModel;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
@@ -35,8 +33,6 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.jps.model.java.JavaResourceRootType;
import org.jetbrains.jps.model.java.JavaSourceRootType;
import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.util.Collection;
import java.util.HashMap;
@@ -139,12 +135,4 @@ public class JavaContentEntriesEditor extends CommonContentEntriesEditor {
}
}.start();
}
@Override
protected JPanel createBottomControl(Module module) {
if (Registry.is("ide.new.project.settings")) return null;
final JPanel innerPanel = new JPanel(new GridBagLayout());
innerPanel.setBorder(BorderFactory.createEmptyBorder(6, 0, 0, 6));
return innerPanel;
}
}
@@ -39,7 +39,6 @@ import com.intellij.openapi.roots.impl.libraries.LibraryEx;
import com.intellij.openapi.roots.impl.libraries.LibraryTableBase;
import com.intellij.openapi.roots.libraries.Library;
import com.intellij.openapi.roots.libraries.LibraryTable;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.ui.navigation.History;
import com.intellij.ui.navigation.Place;
import com.intellij.util.EventDispatcher;
@@ -261,11 +260,6 @@ public abstract class ModuleEditor implements Place.Navigator, Disposable {
createEditors(getModule());
if (!Registry.is("ide.new.project.settings")) {
JPanel northPanel = new JPanel(new GridBagLayout());
myGenericSettingsPanel.add(northPanel, BorderLayout.NORTH);
}
final JComponent component = createCenterPanel();
myGenericSettingsPanel.add(component, BorderLayout.CENTER);
myEditorsInitialized = true;
@@ -44,7 +44,6 @@ import com.intellij.openapi.ui.DetailsComponent;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.EmptyRunnable;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.pom.java.LanguageLevel;
@@ -118,7 +117,7 @@ public class ProjectConfigurable extends ProjectStructureElementConfigurable<Pro
@Override
public JComponent createOptionsPanel() {
myDetailsComponent = new DetailsComponent(!Registry.is("ide.new.project.settings"), !Registry.is("ide.new.project.settings"));
myDetailsComponent = new DetailsComponent(false, false);
myDetailsComponent.setContent(myPanel);
myDetailsComponent.setText(getBannerSlogan());
@@ -40,7 +40,6 @@ import com.intellij.openapi.ui.MasterDetailsComponent;
import com.intellij.openapi.util.ActionCallback;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy;
import com.intellij.packaging.artifacts.Artifact;
import com.intellij.ui.JBSplitter;
@@ -177,7 +176,7 @@ public class ProjectStructureConfigurable extends BaseConfigurable implements Se
public JComponent createComponent() {
myComponent = new MyPanel();
mySplitter = Registry.is("ide.new.project.settings") ? new OnePixelSplitter(false, .15f) : new JBSplitter(false, .15f);
mySplitter = new OnePixelSplitter(false, .15f);
mySplitter.setSplitterProportionKey("ProjectStructure.TopLevelElements");
mySplitter.setHonorComponentsMinimumSize(true);
@@ -197,10 +196,8 @@ public class ProjectStructureConfigurable extends BaseConfigurable implements Se
final ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, toolbarGroup, true);
toolbar.setTargetComponent(myComponent);
myToolbarComponent = toolbar.getComponent();
if (Registry.is("ide.new.project.settings")) {
left.setBackground(UIUtil.SIDE_PANEL_BACKGROUND);
myToolbarComponent.setBackground(UIUtil.SIDE_PANEL_BACKGROUND);
}
left.setBackground(UIUtil.SIDE_PANEL_BACKGROUND);
myToolbarComponent.setBackground(UIUtil.SIDE_PANEL_BACKGROUND);
left.add(myToolbarComponent, BorderLayout.NORTH);
left.add(mySidePanel, BorderLayout.CENTER);
@@ -208,10 +205,6 @@ public class ProjectStructureConfigurable extends BaseConfigurable implements Se
mySplitter.setSecondComponent(myDetails);
myComponent.add(mySplitter, BorderLayout.CENTER);
if (!Registry.is("ide.new.project.settings")) {
myErrorsComponent = new ConfigurationErrorsComponent(myProject);
myComponent.add(myErrorsComponent, BorderLayout.SOUTH);
}
myUiInitialized = true;
@@ -251,10 +244,8 @@ public class ProjectStructureConfigurable extends BaseConfigurable implements Se
}
}
if (Registry.is("ide.new.project.settings")) {
mySidePanel.addSeparator("--");
addErrorPane();
}
mySidePanel.addSeparator("--");
addErrorPane();
}
private void addArtifactsConfig() {
@@ -17,7 +17,6 @@ package com.intellij.openapi.roots.ui.configuration;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.ui.popup.ListItemDescriptor;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.ui.*;
import com.intellij.ui.components.JBList;
import com.intellij.ui.components.panels.NonOpaquePanel;
@@ -58,10 +57,8 @@ public class SidePanel extends JPanel {
myModel = new DefaultListModel();
myList = new JBList(myModel);
if (Registry.is("ide.new.project.settings")) {
myList.setBackground(UIUtil.SIDE_PANEL_BACKGROUND);
myList.setBorder(new EmptyBorder(5, 0, 0, 0));
}
myList.setBackground(UIUtil.SIDE_PANEL_BACKGROUND);
myList.setBorder(new EmptyBorder(5, 0, 0, 0));
final ListItemDescriptor descriptor = new ListItemDescriptor() {
@Override
public String getTextFor(final Object value) {
@@ -75,7 +72,7 @@ public class SidePanel extends JPanel {
@Override
public Icon getIconFor(final Object value) {
return Registry.is("ide.new.project.settings") ? EmptyIcon.create(16, 20) : null;
return EmptyIcon.create(16, 20);
//return myPlace2Presentation.get(value).getIcon();
}
@@ -101,7 +98,7 @@ public class SidePanel extends JPanel {
@Override
protected Color getForeground() {
return Registry.is("ide.new.project.settings") ? new JBColor(Gray._60, Gray._140) : super.getForeground();
return new JBColor(Gray._60, Gray._140);
}
@Override
@@ -111,14 +108,10 @@ public class SidePanel extends JPanel {
@Override
protected void layout() {
if (Registry.is("ide.new.project.settings")) {
myRendererComponent.add(mySeparatorComponent, BorderLayout.NORTH);
myExtraPanel.add(myComponent, BorderLayout.CENTER);
myExtraPanel.add(myCountLabel, BorderLayout.EAST);
myRendererComponent.add(myExtraPanel, BorderLayout.CENTER);
} else {
super.layout();
}
myRendererComponent.add(mySeparatorComponent, BorderLayout.NORTH);
myExtraPanel.add(myComponent, BorderLayout.CENTER);
myExtraPanel.add(myCountLabel, BorderLayout.EAST);
myRendererComponent.add(myExtraPanel, BorderLayout.CENTER);
}
@Override
@@ -151,21 +144,19 @@ public class SidePanel extends JPanel {
myCountLabel = new SidePanelCountLabel();
final JComponent component = super.createItemComponent();
if (Registry.is("ide.new.project.settings")) {
myTextLabel.setForeground(Gray._240);
myTextLabel.setOpaque(true);
}
myTextLabel.setForeground(Gray._240);
myTextLabel.setOpaque(true);
return component;
}
@Override
protected Color getBackground() {
return Registry.is("ide.new.project.settings") ? UIUtil.SIDE_PANEL_BACKGROUND : super.getBackground();
return UIUtil.SIDE_PANEL_BACKGROUND;
}
});
add(ScrollPaneFactory.createScrollPane(myList, Registry.is("ide.new.project.settings")), BorderLayout.CENTER);
add(ScrollPaneFactory.createScrollPane(myList, true), BorderLayout.CENTER);
myList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
myList.addListSelectionListener(new ListSelectionListener() {
@@ -39,7 +39,6 @@ import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.io.FileUtilRt;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.packaging.artifacts.Artifact;
@@ -108,9 +107,7 @@ public class ArtifactEditorImpl implements ArtifactEditorEx {
myPropertiesEditors = new ArtifactPropertiesEditors(myContext, myOriginalArtifact, myOriginalArtifact);
Disposer.register(this, mySourceItemsTree);
Disposer.register(this, myLayoutTreeComponent);
if (Registry.is("ide.new.project.settings")) {
myTopPanel.setBorder(new EmptyBorder(0, 10, 0, 10));
}
myTopPanel.setBorder(new EmptyBorder(0, 10, 0, 10));
myBuildOnMakeCheckBox.setSelected(artifact.isBuildOnMake());
final String outputPath = artifact.getOutputPath();
myOutputDirectoryField.addBrowseFolderListener(CompilerBundle.message("dialog.title.output.directory.for.artifact"),
@@ -207,7 +204,7 @@ public class ArtifactEditorImpl implements ArtifactEditorEx {
myErrorPanelPlace.add(myValidationManager.getMainErrorPanel(), BorderLayout.CENTER);
final JBSplitter splitter = Registry.is("ide.new.project.settings") ? new OnePixelSplitter(false) : new JBSplitter(false);
final JBSplitter splitter = new OnePixelSplitter(false);
final JPanel leftPanel = new JPanel(new BorderLayout());
JPanel treePanel = myLayoutTreeComponent.getTreePanel();
if (UIUtil.isUnderDarcula()) {
@@ -246,7 +243,7 @@ public class ArtifactEditorImpl implements ArtifactEditorEx {
labelPanel.add(link);
rightTopPanel.add(labelPanel, BorderLayout.CENTER);
rightPanel.add(rightTopPanel, BorderLayout.NORTH);
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(mySourceItemsTree, UIUtil.isUnderDarcula() || Registry.is("ide.new.project.settings"));
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(mySourceItemsTree, true);
JPanel scrollPaneWrap = new JPanel(new BorderLayout());
scrollPaneWrap.add(scrollPane, BorderLayout.CENTER);
if (UIUtil.isUnderDarcula()) {
@@ -262,13 +259,11 @@ public class ArtifactEditorImpl implements ArtifactEditorEx {
rightPanel.setBorder(BorderFactory.createEmptyBorder(3, 0, 3, 3));
}
splitter.setSecondComponent(rightPanel);
if (Registry.is("ide.new.project.settings")) {
splitter.getDivider().setBackground(UIUtil.getPanelBackground());
treePanel.setBorder(JBUI.Borders.empty());
rightPanel.setBorder(JBUI.Borders.empty());
scrollPaneWrap.setBorder(JBUI.Borders.empty());
leftPanel.setBorder(JBUI.Borders.empty());
}
splitter.getDivider().setBackground(UIUtil.getPanelBackground());
treePanel.setBorder(JBUI.Borders.empty());
rightPanel.setBorder(JBUI.Borders.empty());
scrollPaneWrap.setBorder(JBUI.Borders.empty());
leftPanel.setBorder(JBUI.Borders.empty());
myShowContentCheckBox.addActionListener(new ActionListener() {
@@ -41,7 +41,6 @@ import com.intellij.openapi.ui.ex.MultiLineLabel;
import com.intellij.openapi.ui.popup.JBPopupFactory;
import com.intellij.openapi.util.Computable;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.vfs.JarFileSystem;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
@@ -159,9 +158,7 @@ public class LibraryRootsComponent implements Disposable, LibraryEditorComponent
ToolbarDecorator toolbarDecorator = ToolbarDecorator.createDecorator(myTree).disableUpDownActions()
.setRemoveActionName(ProjectBundle.message("library.remove.action"))
.disableRemoveAction();
if (Registry.is("ide.new.project.settings")) {
toolbarDecorator.setPanelBorder(new CustomLineBorder(1, 0, 0, 0));
}
toolbarDecorator.setPanelBorder(new CustomLineBorder(1, 0, 0, 0));
final List<AttachRootButtonDescriptor> popupItems = new ArrayList<AttachRootButtonDescriptor>();
for (AttachRootButtonDescriptor descriptor : myDescriptor.createAttachButtons()) {
Icon icon = descriptor.getToolbarIcon();
@@ -34,7 +34,6 @@ import com.intellij.openapi.ui.NamedConfigurable;
import com.intellij.openapi.util.ActionCallback;
import com.intellij.openapi.util.Condition;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.ui.TreeSpeedSearch;
import com.intellij.ui.awt.RelativePoint;
import com.intellij.ui.navigation.Place;
@@ -295,7 +294,7 @@ public abstract class BaseStructureConfigurable extends MasterDetailsComponent i
result.addAll(copyActions);
result.add(Separator.getInstance());
if (fromPopup || !Registry.is("ide.new.project.settings")) {
if (fromPopup) {
result.add(new MyFindUsagesAction(myTree));
}
@@ -35,7 +35,6 @@ import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.FacetProje
import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ProjectStructureElement;
import com.intellij.openapi.ui.DetailsComponent;
import com.intellij.openapi.ui.NamedConfigurable;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.treeStructure.filtered.FilteringTreeBuilder;
import com.intellij.util.ui.tree.TreeUtil;
@@ -276,7 +275,7 @@ public class FacetStructureConfigurable extends BaseStructureConfigurable {
actions.add(new MyNavigateAction());
}
actions.add(new MyRemoveAction());
if (fromPopup || !(Registry.is("ide.new.project.settings"))) {
if (fromPopup) {
actions.add(Separator.getInstance());
addCollapseExpandActions(actions);
}
@@ -52,7 +52,6 @@ import com.intellij.openapi.util.ActionCallback;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.NullableComputable;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
@@ -153,7 +152,7 @@ public class ModuleStructureConfigurable extends BaseStructureConfigurable imple
@NotNull
protected ArrayList<AnAction> createActions(final boolean fromPopup) {
final ArrayList<AnAction> result = super.createActions(fromPopup);
if (fromPopup || !Registry.is("ide.new.project.settings")) {
if (fromPopup) {
result.add(Separator.getInstance());
result.add(new MyGroupAction());
addCollapseExpandActions(result);
@@ -34,7 +34,6 @@ import com.intellij.openapi.roots.ui.configuration.projectRoot.LibraryConfigurab
import com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigurableContext;
import com.intellij.openapi.ui.NamedConfigurable;
import com.intellij.openapi.util.ActionCallback;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.PathUtil;
import com.intellij.xml.util.XmlStringUtil;
@@ -98,11 +97,7 @@ public class LibraryProjectStructureElement extends ProjectStructureElement {
StringBuilder buffer = new StringBuilder();
final String name = StringUtil.escapeXml(libraryName);
buffer.append("Library ");
if (Registry.is("ide.new.project.settings")) {
buffer.append("<a href='http://library/").append(name).append("'>").append(name).append("</a>");
} else {
buffer.append("'").append(name).append("'");
}
buffer.append("<a href='http://library/").append(name).append("'>").append(name).append("</a>");
buffer.append(" has broken " + rootName + " " + StringUtil.pluralize("path", invalidClasses.size()) + ":");
for (String url : invalidClasses) {
buffer.append("<br>&nbsp;&nbsp;");
@@ -159,8 +154,7 @@ public class LibraryProjectStructureElement extends ProjectStructureElement {
public ProjectStructureProblemDescription createUnusedElementWarning() {
final List<ConfigurationErrorQuickFix> fixes = Arrays.asList(new AddLibraryToDependenciesFix(), new RemoveLibraryFix(), new RemoveAllUnusedLibrariesFix());
final String name = StringUtil.escapeXml(myLibrary.getName());
String libraryName = Registry.is("ide.new.project.settings") ? "<a href='http://library/" + name + "'>" + name + "</a>"
: "'" + name + "'";
String libraryName = "<a href='http://library/" + name + "'>" + name + "</a>";
return new ProjectStructureProblemDescription("Library " + libraryName + " is not used", null, createPlace(),
ProjectStructureProblemType.unused("unused-library"), ProjectStructureProblemDescription.ProblemLevel.PROJECT,
fixes, false);
@@ -28,7 +28,6 @@ import com.intellij.openapi.ui.popup.ListPopup;
import com.intellij.openapi.ui.popup.PopupStep;
import com.intellij.openapi.ui.popup.util.BaseListPopupStep;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
@@ -105,9 +104,7 @@ public class DetectionExcludesConfigurable implements Configurable {
doAddAction(button);
}
});
if (Registry.is("ide.new.project.settings")) {
decorator.setPanelBorder(new CustomLineBorder(1, 0, 0, 0));
}
decorator.setPanelBorder(new CustomLineBorder(1, 0, 0, 0));
myMainPanel = new JPanel(new BorderLayout(0, 5));
myMainPanel.add(myEnabledDetectionCheckBox, BorderLayout.NORTH);
final LabeledComponent<JPanel> excludesComponent = LabeledComponent.create(decorator.createPanel(), " Exclude from detection:");
@@ -33,7 +33,6 @@ import com.intellij.openapi.roots.ModuleRootModel;
import com.intellij.openapi.roots.ui.componentsList.components.ScrollablePanel;
import com.intellij.openapi.roots.ui.componentsList.layout.VerticalStackLayout;
import com.intellij.openapi.roots.ui.configuration.actions.IconWithTextAction;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
@@ -151,9 +150,6 @@ public class CommonContentEntriesEditor extends ModuleElementsEditor {
myContentEntryEditorListener = new MyContentEntryEditorListener();
final JPanel mainPanel = new JPanel(new BorderLayout());
if (!Registry.is("ide.new.project.settings")) {
mainPanel.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
}
addAdditionalSettingsToPanel(mainPanel);
@@ -166,29 +162,22 @@ public class CommonContentEntriesEditor extends ModuleElementsEditor {
myEditorsPanel = new ScrollablePanel(new VerticalStackLayout());
myEditorsPanel.setBackground(BACKGROUND_COLOR);
JScrollPane myScrollPane = ScrollPaneFactory.createScrollPane(myEditorsPanel, Registry.is("ide.new.project.settings"));
JScrollPane myScrollPane = ScrollPaneFactory.createScrollPane(myEditorsPanel, true);
final ToolbarPanel toolbarPanel = new ToolbarPanel(myScrollPane, group);
if (Registry.is("ide.new.project.settings")) {
toolbarPanel.setBorder(new CustomLineBorder(1,0,0,0));
}
toolbarPanel.setBorder(new CustomLineBorder(1, 0, 0, 0));
entriesPanel.add(toolbarPanel, BorderLayout.CENTER);
final JBSplitter splitter = Registry.is("ide.new.project.settings") ? new OnePixelSplitter(false) : new JBSplitter(false);
final JBSplitter splitter = new OnePixelSplitter(false);
splitter.setProportion(0.6f);
splitter.setHonorComponentsMinimumSize(true);
myRootTreeEditor = createContentEntryTreeEditor(project);
final JComponent component = myRootTreeEditor.createComponent();
if (Registry.is("ide.new.project.settings")) {
component.setBorder(new CustomLineBorder(1,0,0,0));
}
component.setBorder(new CustomLineBorder(1, 0, 0, 0));
splitter.setFirstComponent(component);
splitter.setSecondComponent(entriesPanel);
JPanel contentPanel = new JPanel(new GridBagLayout());
if (!Registry.is("ide.new.project.settings")) {
contentPanel.setBorder(BorderFactory.createEtchedBorder());
}
final ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, myRootTreeEditor.getEditingActionsGroup(), true);
contentPanel.add(new JLabel("Mark as:"),
new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, 0, new Insets(0, 10, 0, 10), 0, 0));
@@ -254,11 +243,7 @@ public class CommonContentEntriesEditor extends ModuleElementsEditor {
if (componentBorder != null) {
border = BorderFactory.createCompoundBorder(border, componentBorder);
}
if (Registry.is("ide.new.project.settings")) {
component.setBorder(new EmptyBorder(0,0,0,0));
} else {
component.setBorder(border);
}
component.setBorder(new EmptyBorder(0, 0, 0, 0));
myEditorsPanel.add(component);
}
@@ -29,7 +29,6 @@ import com.intellij.openapi.util.ActionCallback;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.Condition;
import com.intellij.openapi.util.Conditions;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.*;
import com.intellij.ui.navigation.History;
@@ -111,7 +110,7 @@ public abstract class MasterDetailsComponent implements Configurable, DetailsCom
protected MyNode myRoot = new MyRootNode();
protected Tree myTree = new Tree();
private final DetailsComponent myDetails = new DetailsComponent(!Registry.is("ide.new.project.settings"), !Registry.is("ide.new.project.settings"));
private final DetailsComponent myDetails = new DetailsComponent(false, false);
protected JPanel myWholePanel;
public JPanel myNorthPanel = new JPanel(new BorderLayout());
@@ -131,7 +130,7 @@ public abstract class MasterDetailsComponent implements Configurable, DetailsCom
protected MasterDetailsComponent(MasterDetailsState state) {
myState = state;
mySplitter = isNewProjectSettings() ? new OnePixelSplitter(false, .2f) : new JBSplitter(false, .2f);
mySplitter = new OnePixelSplitter(false, .2f);
mySplitter.setSplitterProportionKey("ProjectStructure.SecondLevelElements");
mySplitter.setHonorComponentsMinimumSize(true);
@@ -139,20 +138,6 @@ public abstract class MasterDetailsComponent implements Configurable, DetailsCom
reInitWholePanelIfNeeded();
}
private boolean isNewProjectSettings() {
if (!Registry.is("ide.new.project.settings")) {
return false;
}
try {
// assume that only project structure dialog uses the following base class for details:
String name = "com.intellij.openapi.roots.ui.configuration.projectRoot.BaseStructureConfigurable";
return Class.forName(name).isAssignableFrom(getClass());
}
catch (ClassNotFoundException ignored) {
return false;
}
}
protected void reInitWholePanelIfNeeded() {
if (!myToReInitWholePanel) return;
@@ -184,27 +169,19 @@ public abstract class MasterDetailsComponent implements Configurable, DetailsCom
}
};
if (isNewProjectSettings()) {
ToolbarDecorator decorator = ToolbarDecorator.createDecorator(myTree);
DefaultActionGroup group = createToolbarActionGroup();
if (group != null) {
decorator.setActionGroup(group);
}
//left.add(myNorthPanel, BorderLayout.NORTH);
myMaster = decorator.setAsUsualTopToolbar().setPanelBorder(JBUI.Borders.empty()).createPanel();
myNorthPanel.setVisible(false);
} else {
left.add(myNorthPanel, BorderLayout.NORTH);
myMaster = ScrollPaneFactory.createScrollPane(myTree);
ToolbarDecorator decorator = ToolbarDecorator.createDecorator(myTree);
DefaultActionGroup group = createToolbarActionGroup();
if (group != null) {
decorator.setActionGroup(group);
}
//left.add(myNorthPanel, BorderLayout.NORTH);
myMaster = decorator.setAsUsualTopToolbar().setPanelBorder(JBUI.Borders.empty()).createPanel();
myNorthPanel.setVisible(false);
left.add(myMaster, BorderLayout.CENTER);
mySplitter.setFirstComponent(left);
final JPanel right = new JPanel(new BorderLayout());
right.add(myDetails.getComponent(), BorderLayout.CENTER);
if (!isNewProjectSettings()) {
myWholePanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
}
mySplitter.setSecondComponent(right);
@@ -297,15 +274,6 @@ public abstract class MasterDetailsComponent implements Configurable, DetailsCom
return null;
}
private void initToolbar() {
if (isNewProjectSettings()) return;
DefaultActionGroup group = createToolbarActionGroup();
if (group != null) {
final JComponent component = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, group, true).getComponent();
myNorthPanel.add(component, BorderLayout.NORTH);
}
}
public void addItemsChangeListener(ItemsChangeListener l) {
myListeners.add(l);
}
@@ -521,7 +489,6 @@ public abstract class MasterDetailsComponent implements Configurable, DetailsCom
}
}
});
initToolbar();
ArrayList<AnAction> actions = createActions(true);
if (actions != null) {
final DefaultActionGroup group = new DefaultActionGroup();
@@ -18,7 +18,6 @@ package com.intellij.openapi.ui;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.ui.DocumentAdapter;
import org.jetbrains.annotations.Nullable;
@@ -57,11 +56,7 @@ public abstract class NamedConfigurable<T> implements Configurable {
}
});
}
if (Registry.is("ide.new.project.settings")) {
myNamePanel.setBorder(new EmptyBorder(10, 10, 6, 10));
} else {
myNamePanel.setBorder(new EmptyBorder(0,0,0,0));
}
myNamePanel.setBorder(new EmptyBorder(10, 10, 6, 10));
}
public boolean isNameEditable() {
@@ -16,7 +16,6 @@
package com.intellij.openapi.roots.ui.configuration;
import com.intellij.openapi.ui.GraphicsConfig;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.ui.*;
import com.intellij.util.ui.GraphicsUtil;
@@ -29,38 +28,33 @@ import static javax.swing.SwingConstants.LEFT;
public class SidePanelSeparator extends SeparatorWithText {
@Override
protected void paintComponent(Graphics g) {
if (Registry.is("ide.new.project.settings")) {
final JBColor separatorColor = new JBColor(GroupedElementsRenderer.POPUP_SEPARATOR_FOREGROUND, Gray._80);
g.setColor(separatorColor);
if ("--".equals(getCaption())) {
final GraphicsConfig config = GraphicsUtil.setupAAPainting(g);
final int h = getHeight() / 2;
g.drawLine(30, h, getWidth() - 30, h);
((Graphics2D)g).setPaint(new GradientPaint(5, h, ColorUtil.toAlpha(separatorColor, 0), 30, h, separatorColor));
g.drawLine(5, h, 30, h);
((Graphics2D)g).setPaint(
new GradientPaint(getWidth() - 5, h, ColorUtil.toAlpha(separatorColor, 0), getWidth() - 30, h, separatorColor));
g.drawLine(getWidth() - 5, h, getWidth() - 30, h);
config.restore();
return;
}
Rectangle viewR = new Rectangle(0, getVgap(), getWidth() - 1, getHeight() - getVgap() - 1);
Rectangle iconR = new Rectangle();
Rectangle textR = new Rectangle();
String s = SwingUtilities
.layoutCompoundLabel(g.getFontMetrics(), getCaption(), null, CENTER,
LEFT,
CENTER,
LEFT,
viewR, iconR, textR, 0);
GraphicsUtil.setupAAPainting(g);
g.setColor(new JBColor(Gray._255.withAlpha(80), Gray._0.withAlpha(80)));
g.drawString(s, textR.x + 10, textR.y + 1 + g.getFontMetrics().getAscent());
g.setColor(new JBColor(new Color(0x5F6D7B), Gray._120));
g.drawString(s, textR.x + 10, textR.y + g.getFontMetrics().getAscent());
}
else {
super.paintComponent(g);
final JBColor separatorColor = new JBColor(GroupedElementsRenderer.POPUP_SEPARATOR_FOREGROUND, Gray._80);
g.setColor(separatorColor);
if ("--".equals(getCaption())) {
final GraphicsConfig config = GraphicsUtil.setupAAPainting(g);
final int h = getHeight() / 2;
g.drawLine(30, h, getWidth() - 30, h);
((Graphics2D)g).setPaint(new GradientPaint(5, h, ColorUtil.toAlpha(separatorColor, 0), 30, h, separatorColor));
g.drawLine(5, h, 30, h);
((Graphics2D)g).setPaint(
new GradientPaint(getWidth() - 5, h, ColorUtil.toAlpha(separatorColor, 0), getWidth() - 30, h, separatorColor));
g.drawLine(getWidth() - 5, h, getWidth() - 30, h);
config.restore();
return;
}
Rectangle viewR = new Rectangle(0, getVgap(), getWidth() - 1, getHeight() - getVgap() - 1);
Rectangle iconR = new Rectangle();
Rectangle textR = new Rectangle();
String s = SwingUtilities
.layoutCompoundLabel(g.getFontMetrics(), getCaption(), null, CENTER,
LEFT,
CENTER,
LEFT,
viewR, iconR, textR, 0);
GraphicsUtil.setupAAPainting(g);
g.setColor(new JBColor(Gray._255.withAlpha(80), Gray._0.withAlpha(80)));
g.drawString(s, textR.x + 10, textR.y + 1 + g.getFontMetrics().getAscent());
g.setColor(new JBColor(new Color(0x5F6D7B), Gray._120));
g.drawString(s, textR.x + 10, textR.y + g.getFontMetrics().getAscent());
}
}
@@ -16,7 +16,6 @@
package com.intellij.ui.popup.list;
import com.intellij.openapi.ui.popup.ListItemDescriptor;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.ErrorLabel;
import com.intellij.ui.GroupedElementsRenderer;
@@ -67,7 +66,7 @@ public class GroupedItemsListRenderer extends GroupedElementsRenderer.List imple
}
protected final JComponent layoutComponent(JComponent middleItemComponent) {
JPanel result = new OpaquePanel(Registry.is("ide.new.project.settings") ? new BorderLayout(0, 0) : new BorderLayout(4, 4), Color.white);
JPanel result = new OpaquePanel(new BorderLayout(0, 0), Color.white);
myNextStepLabel = new JLabel();
myNextStepLabel.setOpaque(true);
@@ -529,8 +529,6 @@ ide.settings.keymap.input.method.enabled=false
ide.settings.configurable.loading.threshold=0
ide.settings.replace.group.with.single.configurable=true
ide.settings.old.style=true
ide.new.project.settings=true
ide.new.project.settings.description=Temporary key for new project settings dialog UI
commonjs.complete.required.filename.with.extension=false
commonjs.complete.required.filename.with.extension.description=If checked, required filenames are completed with extension