Skip to content

feat: support explicit UI in ComponentEvent constructor#24262

Merged
mshabarov merged 2 commits intomainfrom
chore/componentevent-ui-ctor
May 8, 2026
Merged

feat: support explicit UI in ComponentEvent constructor#24262
mshabarov merged 2 commits intomainfrom
chore/componentevent-ui-ctor

Conversation

@mcollovati
Copy link
Copy Markdown
Collaborator

Allows the UI to be provided at construction time so that getUI() can return it even when the source component is not yet attached.

Related to #18818

@mstahv
Copy link
Copy Markdown
Member

mstahv commented May 5, 2026

Looks like a good way to proceed 👍

@github-actions github-actions Bot added the +0.0.1 label May 5, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

Test Results

 1 405 files  ±0   1 405 suites  ±0   1h 20m 12s ⏱️ - 2m 19s
10 137 tests +1  10 067 ✅ +1  70 💤 ±0  0 ❌ ±0 
10 612 runs  +1  10 533 ✅ +1  79 💤 ±0  0 ❌ ±0 

Results for commit 16ca10b. ± Comparison against base commit 266c51f.

♻️ This comment has been updated with latest results.

}

/**
* Creates a new event using the given source and indicator whether the
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should mention the UI argument.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update the Javadoc

* <code>true</code> if the event originated from the client
* side, <code>false</code> otherwise
*/
public ComponentEvent(UI ui, T source, boolean fromClient) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could place UI in the end, because it's not a mandatory argument in all CTORs.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is that it must become mandatory. This is the reason to make it the first argument

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But, OK, I'll move UI to the last position

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Allows the UI to be provided at construction time so that `getUI()`
can return it even when the source component is not yet attached.
@mcollovati mcollovati force-pushed the chore/componentevent-ui-ctor branch from 0431ab8 to a45e3e0 Compare May 8, 2026 12:43
@mshabarov mshabarov enabled auto-merge May 8, 2026 13:32
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 8, 2026

@mshabarov mshabarov added this pull request to the merge queue May 8, 2026
Merged via the queue into main with commit ba7d3cb May 8, 2026
31 checks passed
@mshabarov mshabarov deleted the chore/componentevent-ui-ctor branch May 8, 2026 14:03
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.

3 participants