constellation icon indicating copy to clipboard operation
constellation copied to clipboard

Scope select all (ctrl+a) to UI element in focus

Open antares1470 opened this issue 3 years ago • 8 comments

Prerequisites

  • [x] Put an X between the brackets on this line if you have done all of the following:
    • Running the latest version of Constellation
    • Attached the Support Package via Help > Support Package
    • Checked the FAQs: https://github.com/constellation-app/constellation/wiki/FAQ
    • Checked that your issue isn't already filed: https://github.com/constellation-app/constellation/issues
    • Checked that there is not already a module that provides the described functionality: https://github.com/constellation-app/constellation/wiki/Catalogue-of-Repositories

Description

Even when the cursor shows up in a particular UI element, such as a text field in the Data Access View or Histogram, pressing ctrl+a selects all nodes and transactions in the graph. Properly scoping the select all function to just the element in focus would make it faster to copy/paste data into and out of Constellation.

Steps to Reproduce

  1. Create a new graph with a few nodes and transactions
  2. Open Data Access View
  3. Place the cursor in any string plugin parameter and type a few characters
  4. Press ctrl+a

Expected behaviour: Ctrl+a only highlights everything in the current scope (in this case, the string parameter)

Actual behaviour: Ctrl+a highlights everything in the current scope as well as everything in the graph

Reproduces how often: 100%

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

antares1470 avatar Nov 05 '20 21:11 antares1470

@antares1470 Confirmed this also occurs in Attribute Editor and Conversation View. It also takes the focus out of these views as well after ctrl + a is pressed.

I resolved it in Conversation View by using an event filter to consume the event, and then manually perform a select all on any text in the text element.

editTranslationArea.addEventFilter(KeyEvent.KEY_PRESSED, e -> { if (e.isShortcutDown() && e.getCode() == KeyCode.A)) { e.consume(); editTranslationArea.selectAll(); }

sol695510 avatar Feb 17 '21 07:02 sol695510

This behaviour only occurs when you first open the graph and doesn't seem to happen after deselecting and then subsequent ctrl+a presses. 6lfgys

sol695510 avatar Mar 04 '21 06:03 sol695510

This behaviour only occurs when you first open the graph and doesn't seem to happen after deselecting and then subsequent ctrl+a presses.

I too got this when testing purely in Core. When I added the Adaptors module suite on top of that though, I started seeing it happen every time ctrl-a is pressed (even in subsequent ctrl-a presses)

antares1470 avatar Mar 04 '21 22:03 antares1470

My proposed solution to this issue is to not use the program wide shortcut but instead execute the the select all plugin from a key listener on the graph listening for ctrl+a.

The problem is I am not sure where to place this key listener. I've tried implementing them in GraphNode.java, SimpleGraphTopComponent.java, FrameworkGraphManager.java, GraphDisplayer.java and GraphRenderable.java but none of them trigger the listener at all.

The attempts are on this branch: https://github.com/constellation-app/constellation/tree/bugfix/Scope-select-all-to-UI-element-in-focus-%23888

@antares1470 @cygnus-x-1 do you have any ideas what I can do here?

sol695510 avatar Mar 16 '21 00:03 sol695510

My proposed solution to this issue is to not use the program wide shortcut but instead execute the the select all plugin from a key listener on the graph listening for ctrl+a.

The problem is I am not sure where to place this key listener. I've tried implementing them in GraphNode.java, SimpleGraphTopComponent.java, FrameworkGraphManager.java, GraphDisplayer.java and GraphRenderable.java but none of them trigger the listener at all.

The attempts are on this branch: https://github.com/constellation-app/constellation/tree/bugfix/Scope-select-all-to-UI-element-in-focus-%23888

@antares1470 @cygnus-x-1 do you have any ideas what I can do here?

@sol695510 Have you removed (or are you able to remove) any existing listener on ctrl+a? If not, chances are that regardless of where you put the listener, that other listener will still be triggered and execute alongside any listener you come up with (I'm not sure exactly whether this is what you're seeing but I encountered something similar to this working on #757)

antares1470 avatar Mar 16 '21 00:03 antares1470

@sol695510 have you tried VisualGraphTopComponent, JavaFxTopComponent and SwingTopComponent ? The VisualGraphTopComponent is the Top Component for the analytic graph and the other 2 Top Components are used by the various views.

I am not a fan of adding the KeyListener to the GraphNode though but if you are doing it a test then that is fine. The GraphNode is the bridge between NetBeans and the Constellation frameworks and I'd like to keep that as lean as possible. Let me know how you go.

arcturus2 avatar Mar 16 '21 03:03 arcturus2

#342 is a close relation to this.

aldebaran30701 avatar May 28 '21 05:05 aldebaran30701

This issue is stale because it has been open for 6 months with no activity. Consider reviewing and taking an action on this issue.

github-actions[bot] avatar Jun 04 '22 00:06 github-actions[bot]

This is working really nicely now, thank you for fixing it @OrionsGuardian. It is great it turned out to be a simple fix in the end.

GammaVel avatar Jan 09 '23 04:01 GammaVel