Git Product home page Git Product logo

Comments (5)

cseppan avatar cseppan commented on August 30, 2024

Currently the dataset types menu has an action listener, typeAction()

https://github.com/USEPA-OAQPS/emf/blob/9e2d935119c2418ad6477ba735ce67b39ab5a6aa/EMF/src/client/gov/epa/emissions/framework/client/data/dataset/DatasetsBrowserWindow.java#L115-L119

For a JComboBox, the action listener gets called whenever an item is selected. This means that typing in a single letter will fire the action event (because almost every letter matches a dataset type), which isn't what we want so this action listener needs to be removed.

I see three different ways of interacting with the dataset types menu:

  1. With the mouse, the user opens the popup menu and clicks on the item. A PopupMenuListener for popupMenuWillBecomeInvisible() seems like it should work in this case.
  2. The user opens the popup menu (either with the mouse or keyboard), uses the up and down arrows to select an item or types letters, then hits Enter to close the popup. The same popupMenuWillBecomeInvisible listener should be good here.
  3. The user never opens the popup menu, just types letters to select an item. I'm not sure how this case should work in terms of user expectations. Right now (with the action listener removed), the user can tab to the Name Contains field and hit Enter to trigger the reload.

So, I'd suggest adding a PopupMenuListener to call typeAction() when the popup menu is closed (becomes invisible), and we'll see how that works out.

from emf.

ddelvecchio avatar ddelvecchio commented on August 30, 2024

Catherine, please test in Mac and Windows. I want to make sure it's functioning as expected.

from emf.

ddelvecchio avatar ddelvecchio commented on August 30, 2024

Back to square one with the code, the code has basically been reverted back to the original code.

A new set of eyes should look at this in the future.

from emf.

cseppan avatar cseppan commented on August 30, 2024

To prevent the datasets from being loaded as soon as a letter is typed, I updated the actionListener to only call typeAction() if the dataset types popup menu is not open.

https://github.com/USEPA-OAQPS/emf/blob/86a783ce30c7707fbf06181925e03c22ac0cbac1/EMF/src/client/gov/epa/emissions/framework/client/data/dataset/DatasetsBrowserWindow.java#L123-L133

Then I added a popupMenuWillBecomeInvisible listener to trigger the datasets to load when the popup menu is closed.

https://github.com/USEPA-OAQPS/emf/blob/86a783ce30c7707fbf06181925e03c22ac0cbac1/EMF/src/client/gov/epa/emissions/framework/client/data/dataset/DatasetsBrowserWindow.java#L134-L146

I also added in the variable dsTypeLoaded to keep track of the currently loaded dataset type so that if the user selects the same dataset type the datasets don't bother getting refetched.

from emf.

cseppan avatar cseppan commented on August 30, 2024

Looking at commit 1648b60, the problem with that code was the key listener that got added. There's no need to specifically listen for the Enter key being pressed because the default Java behavior does what we want.

from emf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.