Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@
<val name="intValues" val="{javax.swing.SwingConstants.LEFT, javax.swing.SwingConstants.CENTER, javax.swing.SwingConstants.RIGHT, javax.swing.SwingConstants.LEADING, javax.swing.SwingConstants.TRAILING}" />
</annotation>
</item>
<item name="javax.swing.JList void addListSelectionListener(javax.swing.event.ListSelectionListener) 0">

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.

This matches the existing precedent in this same file — AbstractButton "void addActionListener(...) 0" (line 6) already carries consulo.ui.annotation.RequiredUIAccess, and the new entries are inserted in the correct alphabetical position (after JLabel, before JOptionPane). 👍

One thing worth confirming: the trailing " 0" in the item name targets parameter 0 (the ListSelectionListener), not the method itself. RequiredUIAccess is a constraint on the callers thread, which is conceptually a property of the method invocation rather than of the argument. A method-level entry would be written without the trailing index, i.e. the item name would end at the closing paren with no " 0" suffix.

Since the established AbstractButton.addActionListener "... 0" entry uses the same parameter-indexed form and is presumably working as intended, this PR is consistent with repo convention — so I am flagging it only as a question: is the parameter-level placement deliberate, or should these (and the existing precedent) be method-level?

<annotation name="consulo.ui.annotation.RequiredUIAccess" />
</item>
<item name="javax.swing.JList void removeListSelectionListener(javax.swing.event.ListSelectionListener) 0">

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.

Annotating removeListSelectionListener with RequiredUIAccess is reasonable — listener mutation on a Swing component should happen on the EDT, same as the add side.

(The same parameter-index "0" observation from the add... comment above applies here too.)

Scope thought, non-blocking: if the goal is to enforce EDT access for JList selection mutation more broadly, the selection-changing methods such as setSelectedIndex, setSelectionInterval and addSelectionInterval are natural follow-up candidates. Not needed for this PR.

<annotation name="consulo.ui.annotation.RequiredUIAccess" />
</item>
<item name="javax.swing.JOptionPane JOptionPane(java.lang.Object, int) 1">
<annotation name="org.intellij.lang.annotations.MagicConstant">
<val name="intValues" val="{javax.swing.JOptionPane.INFORMATION_MESSAGE,javax.swing.JOptionPane.WARNING_MESSAGE,javax.swing.JOptionPane.ERROR_MESSAGE,javax.swing.JOptionPane.QUESTION_MESSAGE,javax.swing.JOptionPane.PLAIN_MESSAGE}" />
Expand Down