Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drag and drop of a group to a the groups field should add the paper to the dropped group #569

Closed
koppor opened this issue May 20, 2022 · 7 comments · Fixed by JabRef/jabref#9965

Comments

@koppor
Copy link
Member

koppor commented May 20, 2022

image

@bryce-carson
Copy link

The blurring of the screenshot makes it difficult to see what is shown.

What is the intent of the image? What is the full meaning of the title of this issue?

@koppor
Copy link
Member Author

koppor commented Apr 7, 2023

See the group "demo group" in the screenshot?

image

See that that the article is not beloging to the group "demo group"?

Switch tot he tab "General", scroll down to "Groups", now drag and drop the group "demo group":

image

  • Expected result: Entry is added to the group "demo group"
    @Article{ostgaard2002,
      journal = {Phys Rev B},
      title   = {energy},
      year    = {2012},
      month   = sep,
      groups  = {demo group},
    }
  • Actual result: Dropping not allowed

Note that drag and drop of an entry to a group works:

image

@wy8881
Copy link

wy8881 commented May 30, 2023

Hi,
I want to try this issue and now I'm checking with the code. I have some questions and it would be greatly appreciated if anyone can give me some advice.

  1. According to the comment in GroupTreeView.java, it put the group nodes as content. But it seems like I can only get the name of the group.

Image
I wonder if there is a way I can get the variable row, and therefore I can use the same method in GroupTreeView.java to move to the group.

Image

  1. I notice that if I change the group directly in General-Group, this paper will be moved to this group. If the group's name is the only thing I can get while dragging, can I add the name to this field directly to move the paper? But I'm not sure what functions are triggered when I change the content manually. It's great if you can give me some hints.

@k3KAW8Pnf7mkmdSMPHz27
Copy link
Member

k3KAW8Pnf7mkmdSMPHz27 commented May 30, 2023

I wonder if there is a way I can get the variable row, and therefore I can use the same method in GroupTreeView.java to move to the group.

I don't understand, what is the "variable row"?

If the group's name is the only thing I can get while dragging, can I add the name to this field directly to move the paper?

Yes, this should be possible as long as you can access the BibEntry object, it is responsible for notifying listeners

https://github.com/JabRef/jabref/blob/424ff1c7cac2db2cc8d4321253bf6614cd4984b3/src/main/java/org/jabref/model/entry/BibEntry.java#L612-L620

EDIT: linked the wrong method

@wy8881
Copy link

wy8881 commented May 31, 2023

Hello, thanks for your reply. By "row" I mean this"

Image

Although I still don't know where this variable is from, it seems nothing to do with my issue.
Your advice is helpful and now I know how to add a group. However, this drag or drop will happen when dragging the group to the EntryEditor panel instead of dragging it to the exact group field inside General Tab. I try to add setOnDragDropped() function to a table, but it seems I can't do it. It'll be helpful if someone can give me some advice.

@k3KAW8Pnf7mkmdSMPHz27
Copy link
Member

Although I still don't know where this variable is from, it seems nothing to do with my issue.

Probably not. If you look at when the ViewModelTreeTableRowFactory is created, you'll notice it is calling install at the end. Following the method call chain will lead you to that it comes from TreeTableView, a JavaFX class that supplies a TreeTableView and a TreeTableRow, so it looks like it is built-in to the TreeTable of JavaFX.

@wy8881
Copy link

wy8881 commented Jun 1, 2023

Thank you, got it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants