[
https://issues.apache.org/jira/browse/NETBEANS-2274?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Matthias Bläsing closed NETBEANS-2274.
--------------------------------------
Resolution: Fixed
Fix Version/s: Next
> Options Dialog - Panel "Fonts & Colors" - Syntax Pane relies on undocumented
> ActionEvent#getModifiers behavior
> --------------------------------------------------------------------------------------------------------------
>
> Key: NETBEANS-2274
> URL: https://issues.apache.org/jira/browse/NETBEANS-2274
> Project: NetBeans
> Issue Type: Bug
> Components: editor - Options
> Affects Versions: 11.0
> Reporter: Matthias Bläsing
> Assignee: Matthias Bläsing
> Priority: Major
> Labels: pull-request-available
> Fix For: Next
>
> Attachments: Bildschirmfoto_2019-03-18_21-59-36.png
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> In the Options Dialog, the Panel "Fonts & Colors" and there the subpanel
> Syntax Pane relies on undocumented ActionEvent#getModifiers behavior.
> The constructor of ActionEvent:
> [https://docs.oracle.com/javase/8/docs/api/java/awt/event/ActionEvent.html#ActionEvent-java.lang.Object-int-java.lang.String-int-]
> Only talks about modifier keys as parameter options:
> {quote}{{modifiers}} - The modifier keys down during event (shift, ctrl, alt,
> meta). Passing negative parameter is not recommended. Zero value means that
> no modifiers were passed
> {quote}
> The code in the panel checks for the mask for mouse button 1:
> {code:java}
> if(evt.getModifiers() == InputEvent.BUTTON1_MASK) { // mouse
> clicked
> updateLanguageCombobox();
> }{code}
> On Ubuntu 18.10, OpenJDK 1.8u191:
> {noformat}
> openjdk version "1.8.0_191"
> OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-2ubuntu0.18.10.1-b12)
> OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode){noformat}
> As the keyboard handling for the ComboBox is also explicitly coded in the
> panel:
> {code:java}
> cbLanguage.addKeyListener(new java.awt.event.KeyAdapter() {
> @Override
> public void keyReleased(KeyEvent evt) {
> if (evt.getKeyCode() == KeyEvent.VK_ENTER || evt.getKeyCode()
> == KeyEvent.VK_SPACE) {
> updateLanguageCombobox();
> }
> }
> });{code}
> Both special cases should be removed and replaced with the default combobox
> behavior.
> The attached screenshot shows the broken state (combobox content for language
> does not match displayed language).
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists