From a85cd347e3a5207320eac5dd315d163733252be8 Mon Sep 17 00:00:00 2001 From: Kirill Kirichenko Date: Tue, 23 Jan 2018 08:41:57 +0300 Subject: [PATCH] remove factory classes and interfaces for Panel Builders. Javadoc restored. --- .../ui/panel/ComponentPanelBuilder.java | 10 +++++- .../src/com/intellij/util/ui/UI.java | 33 +++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/platform/platform-api/src/com/intellij/openapi/ui/panel/ComponentPanelBuilder.java b/platform/platform-api/src/com/intellij/openapi/ui/panel/ComponentPanelBuilder.java index 3b2cd8bad435..12a08f6c1b56 100644 --- a/platform/platform-api/src/com/intellij/openapi/ui/panel/ComponentPanelBuilder.java +++ b/platform/platform-api/src/com/intellij/openapi/ui/panel/ComponentPanelBuilder.java @@ -83,7 +83,15 @@ public class ComponentPanelBuilder implements GridBagPanelBuilder { return this; } - + /** + * Sets optional help tooltip link and link action. + * + * @param linkText help tooltip link text. + * + * @param action help tooltip link action. + * + * @return this + */ public ComponentPanelBuilder withTooltipLink(@NotNull String linkText, @NotNull Runnable action) { myHTLinkText = linkText; myHTAction = action; diff --git a/platform/platform-api/src/com/intellij/util/ui/UI.java b/platform/platform-api/src/com/intellij/util/ui/UI.java index f4b6431a80c7..d86408fce4a8 100644 --- a/platform/platform-api/src/com/intellij/util/ui/UI.java +++ b/platform/platform-api/src/com/intellij/util/ui/UI.java @@ -12,6 +12,39 @@ import javax.swing.*; */ public class UI extends JBUI { + /** + *

Factory class for creating panels of components. There are two different types of panels.

+ * + *

1) Component panel. It's essentially a JComponent that can be decorated with: + *

+ * For more information see {@link ComponentPanelBuilder}

+ * + *

2) ProgressBar panel. A panel containing JProgressBar that has specific layout + * which is different from an arbitrary component panel. A progress bar panel can contain following items: + *

+ * For more information see {@link ProgressPanelBuilder}

+ * + *

Either of the mentioned panels can be grouped together in a grid. I.e. it's possible to create a grid of + * panels see {@link #grid()}. + * When using grid internal implementation makes sure all labels (if the are placed on the left) are located + * in the leftmost column and components/progress bars are in the second column expanding horizontally. + *

+ * + *

{@link PanelGridBuilder} has convenient {@link PanelGridBuilder#expandVertically()} method that allows rows to expand + * vertically when the grid is resized. By default all rows stick to the top of the grid and all available empty space is + * expanded below rows. + *

+ * + *

For concrete examples look ComponentPanelTestAction test action and class.

+ */ public static class PanelFactory { /**