You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Matthias Bläsing (JIRA)" <ji...@apache.org> on 2019/03/18 21:21:00 UTC

[jira] [Created] (NETBEANS-2274) Options Dialog - Panel "Fonts & Colors" - Syntax Pane relies on undocumented ActionEvent#getModifiers behavior

Matthias Bläsing created NETBEANS-2274:
------------------------------------------

             Summary: 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


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.

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists