Skip to content

Commit

Permalink
dbeaver/pro#2599 Expand UIUtils API
Browse files Browse the repository at this point in the history
  • Loading branch information
ivgag committed Sep 18, 2024
1 parent eee26a6 commit c59bb7d
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions plugins/org.jkiss.dbeaver.ui/src/org/jkiss/dbeaver/ui/UIUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit c59bb7d

Please sign in to comment.