From c59bb7d52b9dee0c6a4480186b2bd077ee69096a Mon Sep 17 00:00:00 2001 From: Ivan Gagarkin Date: Wed, 18 Sep 2024 15:45:58 +0200 Subject: [PATCH] dbeaver/pro#2599 Expand UIUtils API --- .../src/org/jkiss/dbeaver/ui/UIUtils.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/plugins/org.jkiss.dbeaver.ui/src/org/jkiss/dbeaver/ui/UIUtils.java b/plugins/org.jkiss.dbeaver.ui/src/org/jkiss/dbeaver/ui/UIUtils.java index 64955eb53d36..ddeb87613381 100644 --- a/plugins/org.jkiss.dbeaver.ui/src/org/jkiss/dbeaver/ui/UIUtils.java +++ b/plugins/org.jkiss.dbeaver.ui/src/org/jkiss/dbeaver/ui/UIUtils.java @@ -693,9 +693,24 @@ public static Control createInfoLabel( @NotNull public static Link createInfoLink(@NotNull Composite parent, @NotNull String text, @NotNull Runnable callback) { - final Composite composite = new Composite(parent, SWT.NONE); - composite.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).create()); + return createInfoLink(parent, text, callback, SWT.NONE, 1, SWT.DEFAULT); + } + @NotNull + public static Link createInfoLink( + @NotNull Composite parent, + @NotNull String text, + @NotNull Runnable callback, + int style, + int colsSpan, + int widthHint + ) { + final Composite composite = new Composite(parent, style); + composite.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).create()); + composite.setLayoutData(GridDataFactory.fillDefaults() + .span(colsSpan, 1) + .hint(widthHint, SWT.DEFAULT) + .grab(true, false).create()); final Label imageLabel = new Label(composite, SWT.NONE); imageLabel.setImage(DBeaverIcons.getImage(DBIcon.SMALL_INFO)); imageLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false));