diff --git a/images/src/org/intellij/images/editor/impl/ImageEditorUI.java b/images/src/org/intellij/images/editor/impl/ImageEditorUI.java index 75feeba250d1..aef68cc14e8c 100644 --- a/images/src/org/intellij/images/editor/impl/ImageEditorUI.java +++ b/images/src/org/intellij/images/editor/impl/ImageEditorUI.java @@ -29,17 +29,17 @@ import com.intellij.openapi.wm.IdeFocusManager; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiManager; -import com.intellij.ui.IdeBorderFactory; import com.intellij.ui.PopupHandler; import com.intellij.ui.ScrollPaneFactory; import com.intellij.ui.components.JBLayeredPane; import com.intellij.ui.components.Magnificator; +import com.intellij.util.ui.JBUI; import com.intellij.util.ui.UIUtil; import org.intellij.images.ImagesBundle; import org.intellij.images.editor.ImageDocument; +import org.intellij.images.editor.ImageDocument.ScaledImageProvider; import org.intellij.images.editor.ImageEditor; import org.intellij.images.editor.ImageZoomModel; -import org.intellij.images.editor.ImageDocument.ScaledImageProvider; import org.intellij.images.editor.actionSystem.ImageEditorActions; import org.intellij.images.options.*; import org.intellij.images.thumbnail.actionSystem.ThumbnailViewActions; @@ -176,7 +176,7 @@ final class ImageEditorUI extends JPanel implements DataProvider, CopyProvider, JPanel topPanel = new JPanel(new BorderLayout()); topPanel.add(toolbarPanel, BorderLayout.WEST); infoLabel = new JLabel((String)null, SwingConstants.RIGHT); - infoLabel.setBorder(IdeBorderFactory.createEmptyBorder(0, 0, 0, 2)); + infoLabel.setBorder(JBUI.Borders.emptyRight(2)); topPanel.add(infoLabel, BorderLayout.EAST); add(topPanel, BorderLayout.NORTH); diff --git a/java/compiler/impl/src/com/intellij/compiler/actions/GenerateAntBuildDialog.java b/java/compiler/impl/src/com/intellij/compiler/actions/GenerateAntBuildDialog.java index 2616e52e1bf7..8e5ccb53a2c4 100644 --- a/java/compiler/impl/src/com/intellij/compiler/actions/GenerateAntBuildDialog.java +++ b/java/compiler/impl/src/com/intellij/compiler/actions/GenerateAntBuildDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -33,6 +33,7 @@ import com.intellij.ui.ScrollPaneFactory; import com.intellij.util.ArrayUtil; import com.intellij.util.Chunk; import com.intellij.util.ListWithSelection; +import com.intellij.util.ui.JBUI; import com.intellij.util.ui.Table; import com.intellij.util.ui.table.ComboBoxTableCellEditor; import org.jetbrains.annotations.NonNls; @@ -175,7 +176,7 @@ public class GenerateAntBuildDialog extends DialogWrapper { true)); JLabel textLabel = new JLabel(CompilerBundle.message("generate.ant.build.dialog.cyclic.modules.table.description")); textLabel.setUI(new MultiLineLabelUI()); - textLabel.setBorder(IdeBorderFactory.createEmptyBorder(4, 4, 6, 4)); + textLabel.setBorder(JBUI.Borders.empty(4, 4, 6, 4)); myChunksPanel.add(textLabel, BorderLayout.NORTH); myTableModel = new MyTableModel(chunks); diff --git a/java/compiler/impl/src/com/intellij/compiler/options/AnnotationProcessorsPanel.java b/java/compiler/impl/src/com/intellij/compiler/options/AnnotationProcessorsPanel.java index a5b97e1fbead..de8484eb32bb 100644 --- a/java/compiler/impl/src/com/intellij/compiler/options/AnnotationProcessorsPanel.java +++ b/java/compiler/impl/src/com/intellij/compiler/options/AnnotationProcessorsPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -31,13 +31,13 @@ import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.text.StringUtil; import com.intellij.ui.AnActionButton; import com.intellij.ui.ColoredTreeCellRenderer; -import com.intellij.ui.IdeBorderFactory; import com.intellij.ui.ToolbarDecorator; import com.intellij.ui.awt.RelativePoint; import com.intellij.ui.components.JBList; import com.intellij.ui.treeStructure.Tree; import com.intellij.util.SmartList; import com.intellij.util.ui.EditableTreeModel; +import com.intellij.util.ui.JBUI; import com.intellij.util.ui.tree.TreeUtil; import org.jetbrains.jps.model.java.compiler.ProcessorConfigProfile; import org.jetbrains.jps.model.java.impl.compiler.ProcessorConfigProfileImpl; @@ -165,7 +165,7 @@ public class AnnotationProcessorsPanel extends JPanel { } }); myProfilePanel = new ProcessorProfilePanel(project); - myProfilePanel.setBorder(IdeBorderFactory.createEmptyBorder(0, 6, 0, 0)); + myProfilePanel.setBorder(JBUI.Borders.emptyLeft(6)); splitter.setSecondComponent(myProfilePanel); } diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/RunHotswapDialog.java b/java/debugger/impl/src/com/intellij/debugger/ui/RunHotswapDialog.java index 8d2a9d3f0d56..6d8f655707c0 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/RunHotswapDialog.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/RunHotswapDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -22,15 +22,19 @@ import com.intellij.debugger.settings.DebuggerSettings; import com.intellij.ide.util.ElementsChooser; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.MultiLineLabelUI; -import com.intellij.ui.IdeBorderFactory; +import com.intellij.util.ui.JBUI; import com.intellij.util.ui.OptionsDialog; import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.NotNull; import javax.swing.*; import java.awt.*; -import java.util.*; -import java.util.List;public class RunHotswapDialog extends OptionsDialog { +import java.util.ArrayList; +import java.util.Collection; +import java.util.Comparator; +import java.util.List; + +public class RunHotswapDialog extends OptionsDialog { private final JPanel myPanel; private final ElementsChooser myElementsChooser; private final boolean myDisplayHangWarning; @@ -45,7 +49,7 @@ import java.util.List;public class RunHotswapDialog extends OptionsDialog { } items.sort(Comparator.comparing(debuggerSession -> debuggerSession.getSession().getSessionName())); myElementsChooser = new ElementsChooser<>(items, true); - myPanel.setBorder(IdeBorderFactory.createEmptyBorder(10, 0, 5, 0)); + myPanel.setBorder(JBUI.Borders.empty(10, 0, 5, 0)); //myElementsChooser.setBorder(IdeBorderFactory.createEmptyBorder(5, 0, 0, 0)); if (sessions.size() > 0) { myElementsChooser.selectElements(items.subList(0, 1)); diff --git a/java/execution/impl/src/com/intellij/execution/ui/ConfigurationArgumentsHelpArea.java b/java/execution/impl/src/com/intellij/execution/ui/ConfigurationArgumentsHelpArea.java index 2da95c372219..1065deb2b1c7 100644 --- a/java/execution/impl/src/com/intellij/execution/ui/ConfigurationArgumentsHelpArea.java +++ b/java/execution/impl/src/com/intellij/execution/ui/ConfigurationArgumentsHelpArea.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -19,9 +19,9 @@ import com.intellij.execution.ExecutionBundle; import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.ide.CopyPasteManager; import com.intellij.openapi.ui.FixedSizeButton; -import com.intellij.ui.IdeBorderFactory; import com.intellij.ui.PopupHandler; import com.intellij.util.PlatformIcons; +import com.intellij.util.ui.JBUI; import javax.swing.*; import java.awt.*; @@ -38,7 +38,7 @@ public class ConfigurationArgumentsHelpArea extends JPanel { public ConfigurationArgumentsHelpArea() { super(new BorderLayout()); add(myPanel); - setBorder(IdeBorderFactory.createEmptyBorder(10, 0, 0, 0)); + setBorder(JBUI.Borders.emptyTop(10)); final DefaultActionGroup group = new DefaultActionGroup(); group.add(new MyCopyAction()); diff --git a/java/idea-ui/src/com/intellij/ide/projectWizard/ProjectSettingsStep.java b/java/idea-ui/src/com/intellij/ide/projectWizard/ProjectSettingsStep.java index a5f20635d616..fc21df9a86f8 100644 --- a/java/idea-ui/src/com/intellij/ide/projectWizard/ProjectSettingsStep.java +++ b/java/idea-ui/src/com/intellij/ide/projectWizard/ProjectSettingsStep.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -72,7 +72,7 @@ public class ProjectSettingsStep extends ModuleWizardStep implements SettingsSte myModuleNameLocationComponent.bindModuleSettings(myNamePathComponent); myExpertDecorator = new HideableDecorator(myExpertPlaceholder, "Mor&e Settings", false); - myExpertPanel.setBorder(IdeBorderFactory.createEmptyBorder(0, IdeBorderFactory.TITLED_BORDER_INDENT, 5, 0)); + myExpertPanel.setBorder(JBUI.Borders.empty(0, IdeBorderFactory.TITLED_BORDER_INDENT, 5, 0)); myExpertDecorator.setContentComponent(myExpertPanel); if (myWizardContext.isCreatingNewProject()) { diff --git a/java/idea-ui/src/com/intellij/ide/projectWizard/ProjectTemplateList.java b/java/idea-ui/src/com/intellij/ide/projectWizard/ProjectTemplateList.java index 24ab98e3cc6a..b1dfcceca159 100644 --- a/java/idea-ui/src/com/intellij/ide/projectWizard/ProjectTemplateList.java +++ b/java/idea-ui/src/com/intellij/ide/projectWizard/ProjectTemplateList.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -25,10 +25,10 @@ import com.intellij.openapi.util.text.StringUtil; import com.intellij.platform.ProjectTemplate; import com.intellij.platform.templates.ArchivedProjectTemplate; import com.intellij.ui.CollectionListModel; -import com.intellij.ui.IdeBorderFactory; import com.intellij.ui.components.JBList; import com.intellij.ui.popup.list.GroupedItemsListRenderer; import com.intellij.util.containers.ContainerUtil; +import com.intellij.util.ui.JBUI; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.TestOnly; @@ -77,7 +77,7 @@ public class ProjectTemplateList extends JPanel { myTextLabel.setDisabledIcon(IconLoader.getDisabledIcon(icon)); } myTextLabel.setEnabled(myList.isEnabled()); - myTextLabel.setBorder(IdeBorderFactory.createEmptyBorder(3, 3, 3, 3)); + myTextLabel.setBorder(JBUI.Borders.empty(3, 3, 3, 3)); } }; myList.setCellRenderer(renderer); diff --git a/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/AbstractProjectWizard.java b/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/AbstractProjectWizard.java index 806c61ac0573..5d0ead3921eb 100644 --- a/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/AbstractProjectWizard.java +++ b/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/AbstractProjectWizard.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -34,7 +34,7 @@ import com.intellij.openapi.roots.ProjectRootManager; import com.intellij.openapi.ui.Messages; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.text.StringUtil; -import com.intellij.ui.IdeBorderFactory; +import com.intellij.util.ui.JBUI; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -68,7 +68,7 @@ public abstract class AbstractProjectWizard extends AbstractWizard createVisibilityPanel() { diff --git a/java/java-impl/src/com/intellij/refactoring/introduceParameter/InplaceIntroduceParameterUI.java b/java/java-impl/src/com/intellij/refactoring/introduceParameter/InplaceIntroduceParameterUI.java index b154899c2ecd..193d38181cca 100644 --- a/java/java-impl/src/com/intellij/refactoring/introduceParameter/InplaceIntroduceParameterUI.java +++ b/java/java-impl/src/com/intellij/refactoring/introduceParameter/InplaceIntroduceParameterUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -28,7 +28,6 @@ import com.intellij.refactoring.JavaRefactoringSettings; import com.intellij.refactoring.RefactoringBundle; import com.intellij.refactoring.introduce.inplace.KeyboardComboSwitcher; import com.intellij.refactoring.ui.TypeSelectorManager; -import com.intellij.ui.IdeBorderFactory; import com.intellij.ui.ListCellRendererWrapper; import com.intellij.util.ui.JBUI; import com.intellij.util.ui.UIUtil; @@ -95,7 +94,7 @@ public abstract class InplaceIntroduceParameterUI extends IntroduceParameterSett component.setText(RefactoringBundle.message("replace.fields.used.in.expressions.with.their.getters")); component.getLabel().setDisplayedMnemonic('u'); component.setLabelLocation(BorderLayout.NORTH); - component.setBorder(IdeBorderFactory.createEmptyBorder(3, 3, 2, 2)); + component.setBorder(JBUI.Borders.empty(3, 3, 2, 2)); return component; } diff --git a/platform/diff-impl/src/com/intellij/diff/util/DiffUtil.java b/platform/diff-impl/src/com/intellij/diff/util/DiffUtil.java index 50ff7f9796fe..d51d480c8c8e 100644 --- a/platform/diff-impl/src/com/intellij/diff/util/DiffUtil.java +++ b/platform/diff-impl/src/com/intellij/diff/util/DiffUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -81,7 +81,10 @@ import com.intellij.openapi.vfs.newvfs.RefreshQueue; import com.intellij.openapi.wm.IdeFocusManager; import com.intellij.openapi.wm.impl.IdeFrameImpl; import com.intellij.testFramework.LightVirtualFile; -import com.intellij.ui.*; +import com.intellij.ui.ColorUtil; +import com.intellij.ui.HyperlinkAdapter; +import com.intellij.ui.JBColor; +import com.intellij.ui.ScreenUtil; import com.intellij.ui.awt.RelativePoint; import com.intellij.ui.components.JBLabel; import com.intellij.util.ArrayUtil; @@ -513,13 +516,13 @@ public class DiffUtil { if (readOnly) title += " " + DiffBundle.message("diff.content.read.only.content.title.suffix"); JPanel panel = new JPanel(new BorderLayout()); - panel.setBorder(IdeBorderFactory.createEmptyBorder(0, 4, 0, 4)); + panel.setBorder(JBUI.Borders.empty(0, 4)); panel.add(new JBLabel(title).setCopyable(true), BorderLayout.CENTER); if (charset != null && separator != null) { JPanel panel2 = new JPanel(); panel2.setLayout(new BoxLayout(panel2, BoxLayout.X_AXIS)); panel2.add(createCharsetPanel(charset, bom)); - panel2.add(Box.createRigidArea(new Dimension(4, 0))); + panel2.add(Box.createRigidArea(JBUI.size(4, 0))); panel2.add(createSeparatorPanel(separator)); panel.add(panel2, BorderLayout.EAST); } diff --git a/platform/dvcs-impl/src/com/intellij/dvcs/push/ui/VcsCommitInfoBalloon.java b/platform/dvcs-impl/src/com/intellij/dvcs/push/ui/VcsCommitInfoBalloon.java index 015f5baadd04..b72d44957cf8 100644 --- a/platform/dvcs-impl/src/com/intellij/dvcs/push/ui/VcsCommitInfoBalloon.java +++ b/platform/dvcs-impl/src/com/intellij/dvcs/push/ui/VcsCommitInfoBalloon.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -22,9 +22,9 @@ import com.intellij.openapi.ui.popup.JBPopup; import com.intellij.openapi.ui.popup.JBPopupFactory; import com.intellij.openapi.vcs.history.VcsHistoryUtil; import com.intellij.ui.HyperlinkAdapter; -import com.intellij.ui.IdeBorderFactory; import com.intellij.ui.awt.RelativePoint; import com.intellij.ui.components.panels.Wrapper; +import com.intellij.util.ui.JBUI; import com.intellij.util.ui.UIUtil; import com.intellij.xml.util.XmlStringUtil; import org.jetbrains.annotations.NotNull; @@ -54,7 +54,7 @@ public class VcsCommitInfoBalloon { myEditorPane.setBackground(HintUtil.getInformationColor()); myEditorPane.setFont(VcsHistoryUtil.getCommitDetailsFont()); myEditorPane.setBorder(HintUtil.createHintBorder()); - Border margin = IdeBorderFactory.createEmptyBorder(3, 3, 3, 3); + Border margin = JBUI.Borders.empty(3, 3, 3, 3); myEditorPane.setBorder(new CompoundBorder(myEditorPane.getBorder(), margin)); myEditorPane.addHyperlinkListener(new HyperlinkAdapter() { @Override diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/AbstractModuleDataService.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/AbstractModuleDataService.java index 076e23c05ee1..21e0f3988a68 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/AbstractModuleDataService.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/AbstractModuleDataService.java @@ -51,6 +51,7 @@ import com.intellij.util.Consumer; import com.intellij.util.SmartList; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.ContainerUtilRt; +import com.intellij.util.ui.JBUI; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -258,7 +259,7 @@ public abstract class AbstractModuleDataService extends Ab } orphanModulesList.setBorder(IdeBorderFactory.createEmptyBorder(8)); content.add(orphanModulesList, ExternalSystemUiUtil.getFillLineConstraints(0)); - content.setBorder(IdeBorderFactory.createEmptyBorder(0, 0, 8, 0)); + content.setBorder(JBUI.Borders.empty(0, 0, 8, 0)); DialogWrapper dialog = new DialogWrapper(project) { { diff --git a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/component/ArrangementAtomMatchConditionComponent.java b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/component/ArrangementAtomMatchConditionComponent.java index 855c354ce07a..77def4571c02 100644 --- a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/component/ArrangementAtomMatchConditionComponent.java +++ b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/component/ArrangementAtomMatchConditionComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -175,7 +175,7 @@ public class ArrangementAtomMatchConditionComponent implements ArrangementUiComp GridBagConstraints constraints = new GridBag().anchor(GridBagConstraints.WEST).weightx(1) .insets(0, 0, 0, myCloseButton == null ? ArrangementConstants.BORDER_ARC_SIZE : 0); insetsPanel.add(myTextControl, constraints); - insetsPanel.setBorder(IdeBorderFactory.createEmptyBorder(0, ArrangementConstants.HORIZONTAL_PADDING, 0, 0)); + insetsPanel.setBorder(JBUI.Borders.emptyLeft(ArrangementConstants.HORIZONTAL_PADDING)); insetsPanel.setOpaque(false); JPanel roundBorderPanel = new JPanel(new GridBagLayout()) { diff --git a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/match/ArrangementMatchingRulesPanel.java b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/match/ArrangementMatchingRulesPanel.java index fedc66f83685..0ac1fd41ddf0 100644 --- a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/match/ArrangementMatchingRulesPanel.java +++ b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/match/ArrangementMatchingRulesPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -25,10 +25,10 @@ import com.intellij.openapi.application.ApplicationBundle; import com.intellij.psi.codeStyle.arrangement.match.ArrangementSectionRule; import com.intellij.psi.codeStyle.arrangement.std.ArrangementStandardSettingsManager; import com.intellij.psi.codeStyle.arrangement.std.StdArrangementRuleAliasToken; -import com.intellij.ui.IdeBorderFactory; import com.intellij.ui.SideBorder; import com.intellij.ui.components.JBScrollPane; import com.intellij.util.ui.GridBag; +import com.intellij.util.ui.JBUI; import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; @@ -77,7 +77,7 @@ public class ArrangementMatchingRulesPanel extends JPanel implements DataProvide }; myControl = createRulesControl(language, settingsManager, colorsProvider, callback); scrollPane.setViewportView(myControl); - scrollPane.setViewportBorder(IdeBorderFactory.createEmptyBorder(0, 0, 0, scrollPane.getVerticalScrollBar().getPreferredSize().width)); + scrollPane.setViewportBorder(JBUI.Borders.emptyRight(scrollPane.getVerticalScrollBar().getPreferredSize().width)); CustomizationUtil.installPopupHandler( myControl, ArrangementConstants.ACTION_GROUP_MATCHING_RULES_CONTEXT_MENU, ArrangementConstants.MATCHING_RULES_CONTROL_PLACE ); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hint/ImplementationViewComponent.java b/platform/lang-impl/src/com/intellij/codeInsight/hint/ImplementationViewComponent.java index ce687bad6483..cfee91cb4d3f 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/hint/ImplementationViewComponent.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/hint/ImplementationViewComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -165,8 +165,7 @@ public class ImplementationViewComponent extends JPanel { myCountLabel = new JLabel(); final JPanel header = new JPanel(new BorderLayout(2, 0)); - header.setBorder(BorderFactory.createCompoundBorder(IdeBorderFactory.createBorder(SideBorder.BOTTOM), - IdeBorderFactory.createEmptyBorder(0, 0, 0, 5))); + header.setBorder(BorderFactory.createCompoundBorder(IdeBorderFactory.createBorder(SideBorder.BOTTOM), JBUI.Borders.emptyRight(5))); final JPanel toolbarPanel = new JPanel(new GridBagLayout()); final GridBagConstraints gc = new GridBagConstraints(GridBagConstraints.RELATIVE, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,2,0,0), 0,0); toolbarPanel.add(myToolbar.getComponent(), gc); @@ -220,7 +219,7 @@ public class ImplementationViewComponent extends JPanel { myLabel.setIcon(getIconForFile(psiFile)); myLabel.setForeground(FileStatusManager.getInstance(project).getStatus(file).getColor()); myLabel.setText(file.getPresentableName()); - myLabel.setBorder(new CompoundBorder(IdeBorderFactory.createRoundedBorder(), IdeBorderFactory.createEmptyBorder(0, 0, 0, 5))); + myLabel.setBorder(new CompoundBorder(IdeBorderFactory.createRoundedBorder(), JBUI.Borders.emptyRight(5))); } toolbarPanel.add(myLabel, gc); } @@ -303,7 +302,7 @@ public class ImplementationViewComponent extends JPanel { myLabel.setIcon(getIconForFile(psiFile)); myLabel.setForeground(FileStatusManager.getInstance(project).getStatus(file).getColor()); myLabel.setText(file.getPresentableName()); - myLabel.setBorder(new CompoundBorder(IdeBorderFactory.createRoundedBorder(), IdeBorderFactory.createEmptyBorder(0, 0, 0, 5))); + myLabel.setBorder(new CompoundBorder(IdeBorderFactory.createRoundedBorder(), JBUI.Borders.emptyRight(5))); myLabel.setVisible(true); } } diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/QuickFixAction.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/QuickFixAction.java index a658223cc08e..b854d5727b22 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/QuickFixAction.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/QuickFixAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -48,8 +48,8 @@ import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; import com.intellij.ui.ClickListener; -import com.intellij.ui.IdeBorderFactory; import com.intellij.util.SequentialModalProgressTask; +import com.intellij.util.ui.JBUI; import com.intellij.util.ui.UIUtil; import gnu.trove.THashSet; import org.jetbrains.annotations.NotNull; @@ -328,7 +328,7 @@ public class QuickFixAction extends AnAction implements CustomComponentAction { }.installOn(button); JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.LINE_AXIS)); - panel.setBorder(IdeBorderFactory.createEmptyBorder(7, 0, 8, 0)); + panel.setBorder(JBUI.Borders.empty(7, 0, 8, 0)); panel.add(button); return panel; } diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionNodeInfo.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionNodeInfo.java index 2c90e5dfbaaf..e4a29f30b86a 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionNodeInfo.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionNodeInfo.java @@ -25,7 +25,10 @@ import com.intellij.openapi.util.text.StringUtil; import com.intellij.profile.codeInspection.InspectionProjectProfileManager; import com.intellij.profile.codeInspection.ui.SingleInspectionProfilePanel; import com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionsConfigTreeTable; -import com.intellij.ui.*; +import com.intellij.ui.BrowserHyperlinkListener; +import com.intellij.ui.ClickListener; +import com.intellij.ui.JBColor; +import com.intellij.ui.ScrollPaneFactory; import com.intellij.ui.components.JBLabel; import com.intellij.ui.components.JBLabelDecorator; import com.intellij.ui.components.panels.StatelessCardLayout; @@ -47,7 +50,7 @@ public class InspectionNodeInfo extends JPanel { public InspectionNodeInfo(@NotNull final InspectionTree tree, @NotNull final Project project) { setLayout(new GridBagLayout()); - setBorder(IdeBorderFactory.createEmptyBorder(11, 0, 0, 0)); + setBorder(JBUI.Borders.emptyTop(11)); final InspectionToolWrapper toolWrapper = tree.getSelectedToolWrapper(false); LOG.assertTrue(toolWrapper != null); InspectionProfileImpl currentProfile = InspectionProjectProfileManager.getInstance(project).getCurrentProfile(); diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsViewUtil.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsViewUtil.java index 4f191a325b75..65a4c88dd841 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsViewUtil.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsViewUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -28,8 +28,8 @@ import com.intellij.pom.Navigatable; import com.intellij.psi.NavigatablePsiElement; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; -import com.intellij.ui.IdeBorderFactory; import com.intellij.ui.components.JBLabel; +import com.intellij.util.ui.JBUI; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -94,7 +94,7 @@ public class InspectionResultsViewUtil { static JLabel createLabelForText(String text) { final JLabel multipleSelectionLabel = new JBLabel(text); multipleSelectionLabel.setVerticalAlignment(SwingConstants.TOP); - multipleSelectionLabel.setBorder(IdeBorderFactory.createEmptyBorder(16, 12, 0, 0)); + multipleSelectionLabel.setBorder(JBUI.Borders.empty(16, 12, 0, 0)); return multipleSelectionLabel; } } diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionViewNavigationPanel.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionViewNavigationPanel.java index 3f3bbdf189ad..35ad08107051 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionViewNavigationPanel.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionViewNavigationPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -15,7 +15,6 @@ */ package com.intellij.codeInspection.ui; -import com.intellij.ui.IdeBorderFactory; import com.intellij.ui.components.JBLabel; import com.intellij.ui.components.labels.LinkLabel; import com.intellij.util.ui.JBUI; @@ -40,7 +39,7 @@ public class InspectionViewNavigationPanel extends JPanel implements InspectionT myNode = node; myTree = tree; setLayout(new BorderLayout()); - setBorder(IdeBorderFactory.createEmptyBorder(18, 12, 0, 0)); + setBorder(JBUI.Borders.empty(18, 12, 0, 0)); final String titleLabelText = getTitleText(true); add(new JBLabel(titleLabelText), BorderLayout.NORTH); myLinks = new JPanel(); @@ -78,7 +77,7 @@ public class InspectionViewNavigationPanel extends JPanel implements InspectionT TreeUtil.selectInTree((DefaultMutableTreeNode)child, true, myTree); } }; - link.setBorder(IdeBorderFactory.createEmptyBorder(1, 17, 3, 1)); + link.setBorder(JBUI.Borders.empty(1, 17, 3, 1)); myLinks.add(link); } myShownChildrenCount = currentChildrenCount; diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/QuickFixPreviewPanelFactory.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/QuickFixPreviewPanelFactory.java index f4fbe9c9dbf8..939e55ce938b 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/QuickFixPreviewPanelFactory.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/QuickFixPreviewPanelFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -27,9 +27,9 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.text.StringUtil; -import com.intellij.ui.IdeBorderFactory; import com.intellij.ui.SimpleColoredComponent; import com.intellij.util.ui.AsyncProcessIcon; +import com.intellij.util.ui.JBUI; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -105,7 +105,10 @@ public class QuickFixPreviewPanelFactory { } if (hasComponents) { - setBorder(IdeBorderFactory.createEmptyBorder(hasFixes ? 2 : 9, (hasFixes || problemCount > 1) ? 8 : 5, hasFixes ? 0 : 8, 0)); + int top = hasFixes ? 2 : 9; + int left = (hasFixes || problemCount > 1) ? 8 : 5; + int bottom = hasFixes ? 0 : 8; + setBorder(JBUI.Borders.empty(top, left, bottom, 0)); } return !hasComponents; } @@ -175,7 +178,7 @@ public class QuickFixPreviewPanelFactory { private LoadingInProgressPreview(InspectionResultsView view) { myView = view; setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); - setBorder(IdeBorderFactory.createEmptyBorder(16, 9, 13, 0)); + setBorder(JBUI.Borders.empty(16, 9, 13, 0)); AsyncProcessIcon waitingIcon = new AsyncProcessIcon("Inspection preview panel updating..."); Disposer.register(this, waitingIcon); myWaitingLabel = getLabel(myView.getTree().getSelectedProblemCount(false)); @@ -210,7 +213,7 @@ public class QuickFixPreviewPanelFactory { private static SimpleColoredComponent getLabel(int problemsCount) { SimpleColoredComponent label = new SimpleColoredComponent(); appendTextToLabel(label, problemsCount); - label.setBorder(IdeBorderFactory.createEmptyBorder(0, 0, 0, 2)); + label.setBorder(JBUI.Borders.empty(0, 0, 0, 2)); return label; } diff --git a/platform/lang-impl/src/com/intellij/execution/actions/RunConfigurationsComboBoxAction.java b/platform/lang-impl/src/com/intellij/execution/actions/RunConfigurationsComboBoxAction.java index d839307c936c..71b5ac88ec1a 100644 --- a/platform/lang-impl/src/com/intellij/execution/actions/RunConfigurationsComboBoxAction.java +++ b/platform/lang-impl/src/com/intellij/execution/actions/RunConfigurationsComboBoxAction.java @@ -30,7 +30,6 @@ import com.intellij.openapi.project.DumbAwareAction; import com.intellij.openapi.project.IndexNotReadyException; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.registry.Registry; -import com.intellij.ui.IdeBorderFactory; import com.intellij.ui.SizedIcon; import com.intellij.ui.components.panels.NonOpaquePanel; import com.intellij.util.IconUtil; @@ -127,7 +126,7 @@ public class RunConfigurationsComboBoxAction extends ComboBoxAction implements D ComboBoxButton button = createComboBoxButton(presentation); button.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 2)); NonOpaquePanel panel = new NonOpaquePanel(new BorderLayout()); - panel.setBorder(IdeBorderFactory.createEmptyBorder(0, 0, 0, 2)); + panel.setBorder(JBUI.Borders.empty(0, 0, 0, 2)); panel.add(button); return panel; } diff --git a/platform/lang-impl/src/com/intellij/execution/impl/ConfigurationSettingsEditor.java b/platform/lang-impl/src/com/intellij/execution/impl/ConfigurationSettingsEditor.java index fdde144fcf1a..bac73dde9a24 100644 --- a/platform/lang-impl/src/com/intellij/execution/impl/ConfigurationSettingsEditor.java +++ b/platform/lang-impl/src/com/intellij/execution/impl/ConfigurationSettingsEditor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -26,11 +26,11 @@ import com.intellij.openapi.options.*; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.Pair; import com.intellij.ui.ColoredListCellRenderer; -import com.intellij.ui.IdeBorderFactory; import com.intellij.ui.ScrollingUtil; import com.intellij.ui.SimpleTextAttributes; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.Convertor; +import com.intellij.util.ui.JBUI; import com.intellij.util.ui.update.Activatable; import com.intellij.util.ui.update.UiNotifyConnector; import org.jetbrains.annotations.NonNls; @@ -149,7 +149,7 @@ public class ConfigurationSettingsEditor extends CompositeSettingsEditor items = NavigationUtil.collectRelatedItems(element, dataContext); if (items.isEmpty()) { final JComponent label = HintUtil.createErrorLabel("No related symbols"); - label.setBorder(IdeBorderFactory.createEmptyBorder(2, 7, 2, 7)); + label.setBorder(JBUI.Borders.empty(2, 7)); JBPopupFactory.getInstance().createBalloonBuilder(label) .setFadeoutTime(3000) .setFillColor(HintUtil.getErrorColor()) diff --git a/platform/lang-impl/src/com/intellij/ide/actions/SearchEverywhereAction.java b/platform/lang-impl/src/com/intellij/ide/actions/SearchEverywhereAction.java index a0b03e08fa59..4b87da0b9d76 100644 --- a/platform/lang-impl/src/com/intellij/ide/actions/SearchEverywhereAction.java +++ b/platform/lang-impl/src/com/intellij/ide/actions/SearchEverywhereAction.java @@ -701,7 +701,7 @@ public class SearchEverywhereAction extends AnAction implements CustomComponentA topPanel.add(controls, BorderLayout.EAST); panel.add(myPopupField, BorderLayout.CENTER); panel.add(topPanel, BorderLayout.NORTH); - panel.setBorder(IdeBorderFactory.createEmptyBorder(3, 5, 4, 5)); + panel.setBorder(JBUI.Borders.empty(3, 5, 4, 5)); DataManager.registerDataProvider(panel, this); final ComponentPopupBuilder builder = JBPopupFactory.getInstance().createComponentPopupBuilder(panel, editor); myBalloon = builder diff --git a/platform/lang-impl/src/com/intellij/ide/navigationToolbar/NavBarPopup.java b/platform/lang-impl/src/com/intellij/ide/navigationToolbar/NavBarPopup.java index 3514a7840d1a..0d6d6aedbdf0 100644 --- a/platform/lang-impl/src/com/intellij/ide/navigationToolbar/NavBarPopup.java +++ b/platform/lang-impl/src/com/intellij/ide/navigationToolbar/NavBarPopup.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -23,11 +23,15 @@ import com.intellij.openapi.ui.Queryable; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.wm.IdeFocusManager; -import com.intellij.ui.*; +import com.intellij.ui.HintHint; +import com.intellij.ui.LightweightHint; +import com.intellij.ui.ListenerUtil; +import com.intellij.ui.ScrollingUtil; import com.intellij.ui.awt.RelativePoint; import com.intellij.ui.components.JBList; import com.intellij.ui.popup.HintUpdateSupply; import com.intellij.ui.speedSearch.ListWithFilter; +import com.intellij.util.ui.JBUI; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; @@ -161,7 +165,7 @@ public class NavBarPopup extends LightweightHint implements Disposable{ disposables.add(navBarItem); return navBarItem; }); - list.setBorder(IdeBorderFactory.createEmptyBorder(5, 5, 5, 5)); + list.setBorder(JBUI.Borders.empty(5, 5, 5, 5)); installMoveAction(list, panel, -1, KeyEvent.VK_LEFT); installMoveAction(list, panel, 1, KeyEvent.VK_RIGHT); installEnterAction(list, panel, KeyEvent.VK_ENTER); diff --git a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java index 515bed0fc383..77d349da02e6 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java +++ b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java @@ -450,7 +450,7 @@ public abstract class ChooseByNameBase { myToolArea = new JLabel(JBUI.scale(EmptyIcon.create(1, 24))); } else { - myToolArea.setBorder(IdeBorderFactory.createEmptyBorder(0, 6, 0, 0)); // space between checkbox and filter/show all in view buttons + myToolArea.setBorder(JBUI.Borders.emptyLeft(6)); // space between checkbox and filter/show all in view buttons } hBox.add(myToolArea); hBox.add(toolbarComponent); diff --git a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoActionModel.java b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoActionModel.java index 1f88a3d5f277..5112a80f1386 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoActionModel.java +++ b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoActionModel.java @@ -50,6 +50,7 @@ import com.intellij.util.concurrency.Semaphore; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.ContainerUtilRt; import com.intellij.util.ui.EmptyIcon; +import com.intellij.util.ui.JBUI; import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; @@ -573,7 +574,7 @@ public class GotoActionModel implements ChooseByNameModel, Comparator, D Object value = ((MatchedValue) matchedValue).value; String pattern = ((MatchedValue)matchedValue).pattern; - Border eastBorder = IdeBorderFactory.createEmptyBorder(0, 0, 0, 2); + Border eastBorder = JBUI.Borders.emptyRight(2); if (value instanceof ActionWrapper) { ActionWrapper actionWithParentGroup = (ActionWrapper)value; AnAction anAction = actionWithParentGroup.getAction(); @@ -662,7 +663,7 @@ public class GotoActionModel implements ChooseByNameModel, Comparator, D OnOffButton button = new OnOffButton(); button.setSelected(selected); panel.add(button, BorderLayout.EAST); - panel.setBorder(IdeBorderFactory.createEmptyBorder(0, 2, 0, 2)); + panel.setBorder(JBUI.Borders.empty(0, 2)); } @NotNull diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java index 64b875baf38a..6b607206cc0f 100644 --- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java +++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java @@ -85,6 +85,8 @@ import java.util.List; import static com.intellij.util.containers.ContainerUtil.exists; +import com.intellij.util.containers.Queue; + public class SingleInspectionProfilePanel extends JPanel { private static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.ex.InspectionToolsPanel"); @NonNls private static final String INSPECTION_FILTER_HISTORY = "INSPECTION_FILTER_HISTORY"; @@ -1048,7 +1050,7 @@ public class SingleInspectionProfilePanel extends JPanel { myBrowser = new JEditorPane(UIUtil.HTML_MIME, EMPTY_HTML); myBrowser.setEditable(false); - myBrowser.setBorder(IdeBorderFactory.createEmptyBorder(5, 5, 5, 5)); + myBrowser.setBorder(JBUI.Borders.empty(5, 5, 5, 5)); myBrowser.addHyperlinkListener(new HyperlinkAdapter() { @Override protected void hyperlinkActivated(HyperlinkEvent e) { @@ -1089,7 +1091,7 @@ public class SingleInspectionProfilePanel extends JPanel { final JScrollPane tree = initTreeScrollPane(); final JPanel northPanel = new JPanel(new GridBagLayout()); - northPanel.setBorder(IdeBorderFactory.createEmptyBorder(2, 0, 2, 0)); + northPanel.setBorder(JBUI.Borders.empty(2, 0, 2, 0)); myProfileFilter.setPreferredSize(new Dimension(20, myProfileFilter.getPreferredSize().height)); northPanel.add(myProfileFilter, new GridBagConstraints(0, 0, 1, 1, 0.5, 1, GridBagConstraints.BASELINE_TRAILING, GridBagConstraints.HORIZONTAL, JBUI.emptyInsets(), 0, 0)); diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/ThreeStateCheckBoxRenderer.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/ThreeStateCheckBoxRenderer.java index 9f7affed9758..36c3f21d4b9c 100644 --- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/ThreeStateCheckBoxRenderer.java +++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/ThreeStateCheckBoxRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -16,8 +16,8 @@ package com.intellij.profile.codeInspection.ui.table; import com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionsConfigTreeTable; -import com.intellij.ui.IdeBorderFactory; import com.intellij.util.SmartList; +import com.intellij.util.ui.JBUI; import com.intellij.util.ui.ThreeStateCheckBox; import org.jetbrains.annotations.Nullable; @@ -44,7 +44,7 @@ public class ThreeStateCheckBoxRenderer extends ThreeStateCheckBox implements Ta setThirdStateEnabled(false); setHorizontalAlignment(CENTER); setVerticalAlignment(CENTER); - setBorder(IdeBorderFactory.createEmptyBorder(0, 0, 0, InspectionsConfigTreeTable.getAdditionalPadding())); + setBorder(JBUI.Borders.empty(0, 0, 0, InspectionsConfigTreeTable.getAdditionalPadding())); addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { diff --git a/platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureDialogBase.java b/platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureDialogBase.java index 033a1e8d115f..e181bbcc5134 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureDialogBase.java +++ b/platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureDialogBase.java @@ -47,6 +47,7 @@ import com.intellij.ui.treeStructure.Tree; import com.intellij.util.Alarm; import com.intellij.util.Consumer; import com.intellij.util.IJSwingUtilities; +import com.intellij.util.ui.JBUI; import com.intellij.util.ui.UIUtil; import com.intellij.util.ui.table.JBListTable; import com.intellij.util.ui.table.JBTableRowEditor; @@ -337,7 +338,7 @@ public abstract class ChangeSignatureDialogBase extends GroupedItemsListRenderer { createLabel(); panel.add(myTextLabel, BorderLayout.CENTER); myShortcutLabel = new JLabel(); - myShortcutLabel.setBorder(IdeBorderFactory.createEmptyBorder(0, 0, 0, 3)); + myShortcutLabel.setBorder(JBUI.Borders.empty(0, 0, 0, 3)); Color color = UIManager.getColor("MenuItem.acceleratorForeground"); myShortcutLabel.setForeground(color); panel.add(myShortcutLabel, BorderLayout.EAST); diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/ui/SearchFieldAction.java b/platform/vcs-api/src/com/intellij/openapi/vcs/ui/SearchFieldAction.java index f77cc1a18b27..4bb6d1915bf2 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/ui/SearchFieldAction.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/ui/SearchFieldAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -19,7 +19,6 @@ import com.intellij.icons.AllIcons; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.Presentation; import com.intellij.openapi.actionSystem.ex.CustomComponentAction; -import com.intellij.ui.IdeBorderFactory; import com.intellij.ui.SearchTextField; import com.intellij.util.ui.JBUI; import com.intellij.util.ui.UIUtil; @@ -61,7 +60,7 @@ public abstract class SearchFieldAction extends AnAction implements CustomCompon } }; Border border = myField.getBorder(); - Border emptyBorder = IdeBorderFactory.createEmptyBorder(3, 0, 2, 0); + Border emptyBorder = JBUI.Borders.empty(3, 0, 2, 0); if (border instanceof CompoundBorder) { if (!UIUtil.isUnderDarcula()) { myField.setBorder(new CompoundBorder(emptyBorder, ((CompoundBorder)border).getInsideBorder())); diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/ui/TextFieldAction.java b/platform/vcs-api/src/com/intellij/openapi/vcs/ui/TextFieldAction.java index b189f699167d..5f5409cca464 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/ui/TextFieldAction.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/ui/TextFieldAction.java @@ -1,9 +1,12 @@ /* - * Copyright 2000-2010 JetBrains s.r.o. + * Copyright 2000-2017 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. * You may obtain a copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -18,7 +21,7 @@ import com.intellij.openapi.actionSystem.Presentation; import com.intellij.openapi.actionSystem.ex.CustomComponentAction; import com.intellij.openapi.util.SystemInfo; import com.intellij.ui.ClickListener; -import com.intellij.ui.IdeBorderFactory; +import com.intellij.util.ui.JBUI; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -75,10 +78,10 @@ public abstract class TextFieldAction extends AnAction implements CustomComponen originalBorder = myField.getBorder(); } - panel.setBorder(new CompoundBorder(IdeBorderFactory.createEmptyBorder(4, 0, 4, 0), originalBorder)); + panel.setBorder(new CompoundBorder(JBUI.Borders.empty(4, 0, 4, 0), originalBorder)); myField.setOpaque(true); - myField.setBorder(IdeBorderFactory.createEmptyBorder(0, 5, 0, 5)); + myField.setBorder(JBUI.Borders.empty(0, 5, 0, 5)); new ClickListener() { @Override diff --git a/plugins/editorconfig/src/org/editorconfig/settings/EditorConfigConfigurable.java b/plugins/editorconfig/src/org/editorconfig/settings/EditorConfigConfigurable.java index 54b511b78150..56213b54d636 100644 --- a/plugins/editorconfig/src/org/editorconfig/settings/EditorConfigConfigurable.java +++ b/plugins/editorconfig/src/org/editorconfig/settings/EditorConfigConfigurable.java @@ -12,6 +12,7 @@ import com.intellij.psi.codeStyle.CustomCodeStyleSettings; import com.intellij.ui.IdeBorderFactory; import com.intellij.ui.components.JBCheckBox; import com.intellij.util.messages.MessageBus; +import com.intellij.util.ui.JBUI; import com.intellij.util.ui.UIUtil; import org.editorconfig.Utils; import org.jetbrains.annotations.NotNull; @@ -37,7 +38,7 @@ public class EditorConfigConfigurable extends CodeStyleSettingsProvider implemen panel.add(myEnabled); final JLabel warning = new JLabel("EditorConfig may override the IDE code style settings"); warning.setFont(UIUtil.getLabelFont(UIUtil.FontSize.SMALL)); - warning.setBorder(IdeBorderFactory.createEmptyBorder(0, 20, 0, 0)); + warning.setBorder(JBUI.Borders.emptyLeft(20)); panel.add(warning); panel.setAlignmentY(Component.TOP_ALIGNMENT); result.add(panel); diff --git a/plugins/git4idea/src/git4idea/branch/GitSmartOperationDialog.java b/plugins/git4idea/src/git4idea/branch/GitSmartOperationDialog.java index 3c61fc997b7a..712787cbe52f 100644 --- a/plugins/git4idea/src/git4idea/branch/GitSmartOperationDialog.java +++ b/plugins/git4idea/src/git4idea/branch/GitSmartOperationDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -19,8 +19,8 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ApplicationNamesInfo; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.DialogWrapper; -import com.intellij.ui.IdeBorderFactory; import com.intellij.ui.components.JBLabel; +import com.intellij.util.ui.JBUI; import git4idea.DialogManager; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -90,7 +90,7 @@ public class GitSmartOperationDialog extends DialogWrapper { JBLabel description = new JBLabel("Your local changes to the following files would be overwritten by " + myOperationTitle + ".
" + ApplicationNamesInfo.getInstance().getFullProductName() + " can stash the changes, " + myOperationTitle + " and unstash them after that."); - description.setBorder(IdeBorderFactory.createEmptyBorder(0, 0, 10, 0)); + description.setBorder(JBUI.Borders.emptyBottom(10)); return description; } diff --git a/plugins/ui-designer-core/src/com/intellij/designer/designSurface/DesignerEditorPanel.java b/plugins/ui-designer-core/src/com/intellij/designer/designSurface/DesignerEditorPanel.java index 7fa81fdd22a4..b9b7a20be9d5 100644 --- a/plugins/ui-designer-core/src/com/intellij/designer/designSurface/DesignerEditorPanel.java +++ b/plugins/ui-designer-core/src/com/intellij/designer/designSurface/DesignerEditorPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -61,6 +61,7 @@ import com.intellij.util.ThrowableRunnable; import com.intellij.util.containers.FixedHashMap; import com.intellij.util.containers.IntArrayList; import com.intellij.util.ui.AsyncProcessIcon; +import com.intellij.util.ui.JBUI; import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; @@ -433,7 +434,7 @@ public abstract class DesignerEditorPanel extends JPanel } if (message.myAdditionalFixes != null && message.myAdditionalFixes.size() > 0) { JPanel fixesPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 0)); - fixesPanel.setBorder(IdeBorderFactory.createEmptyBorder(3, 0, 10, 0)); + fixesPanel.setBorder(JBUI.Borders.empty(3, 0, 10, 0)); fixesPanel.setOpaque(false); fixesPanel.add(Box.createHorizontalStrut(icon.getIconWidth())); diff --git a/python/educational-core/src/com/jetbrains/edu/learning/newproject/ui/EduCoursesPanel.java b/python/educational-core/src/com/jetbrains/edu/learning/newproject/ui/EduCoursesPanel.java index a65c83e0b56f..d4e07dc28905 100644 --- a/python/educational-core/src/com/jetbrains/edu/learning/newproject/ui/EduCoursesPanel.java +++ b/python/educational-core/src/com/jetbrains/edu/learning/newproject/ui/EduCoursesPanel.java @@ -84,11 +84,11 @@ public class EduCoursesPanel extends JPanel { GuiUtils.replaceJSplitPaneWithIDEASplitter(mySplitPaneRoot, true); mySplitPane.setDividerLocation(0.5); mySplitPane.setResizeWeight(0.5); - myCourseNameLabel.setBorder(IdeBorderFactory.createEmptyBorder(20, 10, 5, 10)); + myCourseNameLabel.setBorder(JBUI.Borders.empty(20, 10, 5, 10)); Font labelFont = UIUtil.getLabelFont(); myCourseNameLabel.setFont(new Font(labelFont.getName(), Font.BOLD, JBUI.scaleFontSize(18.0f))); - myTagsPanel.setBorder(IdeBorderFactory.createEmptyBorder(0, 10, 0, 10)); - myDescriptionTextArea.setBorder(IdeBorderFactory.createEmptyBorder(20, 10, 10, 10)); + myTagsPanel.setBorder(JBUI.Borders.empty(0, 10)); + myDescriptionTextArea.setBorder(JBUI.Borders.empty(20, 10, 10, 10)); myDescriptionTextArea.setEditorKit(UIUtil.getHTMLEditorKit()); myDescriptionTextArea.setEditable(false); myDescriptionTextArea.setPreferredSize(JBUI.size(myCoursePanel.getPreferredSize())); @@ -97,7 +97,7 @@ public class EduCoursesPanel extends JPanel { myCourses = getCourses(); updateModel(myCourses, null); myErrorLabel.setVisible(false); - myErrorLabel.setBorder(IdeBorderFactory.createEmptyBorder(20, 10, 0, 0)); + myErrorLabel.setBorder(JBUI.Borders.empty(20, 10, 0, 0)); ListCellRendererWrapper renderer = new ListCellRendererWrapper() { @Override @@ -124,7 +124,7 @@ public class EduCoursesPanel extends JPanel { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { Component component = renderer.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); if (component instanceof JLabel) { - ((JLabel)component).setBorder(IdeBorderFactory.createEmptyBorder(5, 0, 5, 0)); + ((JLabel)component).setBorder(JBUI.Borders.empty(5, 0)); } return component; } @@ -176,7 +176,7 @@ public class EduCoursesPanel extends JPanel { myCourseListPanel.setBorder(JBUI.Borders.customLine(OnePixelDivider.BACKGROUND, 1, 1, 1, 1)); HideableDecorator decorator = new HideableDecorator(myAdvancedSettingsPlaceholder, "Advanced Settings", false); decorator.setContentComponent(myAdvancedSettings); - myAdvancedSettings.setBorder(IdeBorderFactory.createEmptyBorder(0, IdeBorderFactory.TITLED_BORDER_INDENT, 5, 0)); + myAdvancedSettings.setBorder(JBUI.Borders.empty(0, IdeBorderFactory.TITLED_BORDER_INDENT, 5, 0)); myCoursesList.setBackground(LIST_COLOR); myDescriptionTextArea.setBackground(UIUtil.getPanelBackground()); myAdvancedSettingsPlaceholder.setVisible(false); @@ -311,7 +311,7 @@ public class EduCoursesPanel extends JPanel { } private static JLabel createTagLabel(String tagText) { - Border emptyBorder = IdeBorderFactory.createEmptyBorder(3, 5, 3, 5); + Border emptyBorder = JBUI.Borders.empty(3, 5); JBLabel label = new JBLabel(tagText); label.setOpaque(true); label.setBorder(emptyBorder); diff --git a/xml/dom-impl/src/com/intellij/codeInsight/navigation/NavigationGutterIconRenderer.java b/xml/dom-impl/src/com/intellij/codeInsight/navigation/NavigationGutterIconRenderer.java index d3682d34b0a6..9ba538fa626c 100644 --- a/xml/dom-impl/src/com/intellij/codeInsight/navigation/NavigationGutterIconRenderer.java +++ b/xml/dom-impl/src/com/intellij/codeInsight/navigation/NavigationGutterIconRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -31,11 +31,11 @@ import com.intellij.openapi.util.NotNullLazyValue; import com.intellij.psi.PsiElement; import com.intellij.psi.SmartPsiElementPointer; import com.intellij.psi.util.PsiUtilCore; -import com.intellij.ui.IdeBorderFactory; import com.intellij.ui.awt.RelativePoint; import com.intellij.util.NullableFunction; import com.intellij.util.PsiNavigateUtil; import com.intellij.util.containers.ContainerUtil; +import com.intellij.util.ui.JBUI; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -119,7 +119,7 @@ public abstract class NavigationGutterIconRenderer extends GutterIconRenderer if (myEmptyText != null) { if (event != null) { final JComponent label = HintUtil.createErrorLabel(myEmptyText); - label.setBorder(IdeBorderFactory.createEmptyBorder(2, 7, 2, 7)); + label.setBorder(JBUI.Borders.empty(2, 7, 2, 7)); JBPopupFactory.getInstance().createBalloonBuilder(label) .setFadeoutTime(3000) .setFillColor(HintUtil.getErrorColor()) diff --git a/xml/impl/src/com/intellij/codeInsight/template/emmet/EmmetAbbreviationBalloon.java b/xml/impl/src/com/intellij/codeInsight/template/emmet/EmmetAbbreviationBalloon.java index 7ebbbdd6efb6..fa8ce0867808 100644 --- a/xml/impl/src/com/intellij/codeInsight/template/emmet/EmmetAbbreviationBalloon.java +++ b/xml/impl/src/com/intellij/codeInsight/template/emmet/EmmetAbbreviationBalloon.java @@ -91,7 +91,7 @@ public class EmmetAbbreviationBalloon { field.setHistorySize(10); JBLabel label = new JBLabel(AllIcons.General.ContextHelp); - label.setBorder(IdeBorderFactory.createEmptyBorder(0, 3, 0, 1)); + label.setBorder(JBUI.Borders.empty(0, 3, 0, 1)); IdeTooltipManager.getInstance().setCustomTooltip(label, new ContextHelpTooltip(label, myDocumentation)); panel.add(field, BorderLayout.CENTER);