Skip to content

issue #8655 - dialogs of db join and write to logs - #8665

Merged
bamaer merged 3 commits into
apache:mainfrom
mattcasters:issue-8655
Oct 7, 2026
Merged

bamaer merged 3 commits into
apache:mainfrom
mattcasters:issue-8655

Conversation

@mattcasters

Copy link
Copy Markdown
Contributor

issue #8655 improve dialogs: Write to log & DB Join

@bamaer

bamaer commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Blockers

  1. Numeric fields are not saved. limitRowsNumber (WriteToLogMeta.java:117), cacheSize and rowLimit (DatabaseJoinMeta.java:140, :201) are int fields behind GuiElementType.TEXT widgets. GuiCompositeWidgets.getWidgetsData does not convert a String for an int setter: it logs Value of type java.lang.String does not fit setter setLimitRowsNumber(int) ... value not applied (same for setCacheSize / setRowLimit) and keeps the old value. In a SWTBot test, changing "Nr of rows to print" from 5 to 42 and pressing OK leaves 5 in the meta.
    Fix: add String→int/long conversion (Const.toInt) in GuiCompositeWidgets, or persist these three by hand in persistContents; add a test that edits a number and presses OK.

  2. Resolved SQL parameters and the line/column readout are invisible. In addSql, wSql is attached to the bottom of the tab (DatabaseJoinDialog.java:267) while wlPosition and the resolved-parameter table hang below it (:274), outside the tab's client area. Measured in the default dialog: tab content 317px high, position label at y=321, table at y=379; same at 1000×900. theSqlTabHoldsBothTheEditorAndTheResolvedParameters still passes because SWTBot finds the clipped table.
    Fix: attach wResolvedParam to the bottom, stack wlPosition and its label above it, and end wSql at wlPosition. Assert the bounds lie inside the tab, like the Write to log overlap test does.

Should fix

  1. DB Join OK can no longer be confirmed with a variable connection. ok() (DatabaseJoinDialog.java:750) now returns when findDatabase(...) is null, so a connection like ${DB} that only resolves at runtime blocks OK entirely; before, the dialog warned and saved. It also runs getWidgetsContents (line 744) before the check, so a later Cancel keeps the edits.
    Fix: keep the warning but still close (or skip the check when the name contains a variable), and validate before writing to input.

  2. Browse (SQL from file). GuiCompositeWidgets calls refreshWidgetsAfterButton immediately and again via asyncExec, so afterButtonPressed (:175), which opens the file dialog, runs twice per click and the picker opens twice. buttonPressed (:171) also writes all widgets into the meta, so Cancel after Browse keeps the edits (checkbox changes survive Cancel in a SWTBot test).
    Fix: make sqlFromFile a GuiElementType.FILENAME widget and drop the no-op browseSqlFromFile on the Meta; onSqlFromFileChanged already loads the file when the path changes.

Verified: code reviewed; both modules built; the PR's uitests run headless (all pass). 1, 2 and 4 reproduced with additional SWTBot tests; 3 from code, compared against the dialog on main.

The SQL tab layout is expressed as the stack the dialog actually uses, and the
caret tracking, parameter refresh, and OK path no longer carry the old dialog's
unused listeners.
@bamaer
bamaer merged commit 0c81eb6 into apache:main Oct 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants