TreeViewer custom node rendering (adding checkboxe and clickeable image) - java

I'm actually trying to create a tree following that article : https://www.eclipse.org/articles/Article-TreeViewer/TreeViewerArticle.htm
But the problem is that I need to add 2 clickable images (1 for reloading sub-nodes and 1 for adding new sub-node)
And as optional, if someone can explain me how to add a check box on sub-nodes so then I can delete from the parent node all selected sub-nodes
Thank you in advance for all your help

Related

How to change item position of RecyclerView before the 0 element in my ArrayList

I have a RecyclerView with a cell row that have a favorite button. I was searching on SO and found a question with the same thing that I want to do here : implementing "add to favourite" mechanism in RecyclerView
the problem is that is not clear for me for now.
I dont want to have 2 recyclerViews and delegate the view to the other one because I will need to have 2 onCreateViewHolders and will be really unconfortable to work with, also bad coded.
What I need to do is like a row and then move it to the top with the title Favorite on it.
What comes to my mind is just delete the item im clicking and moving it to the 0 position of my ArrayList<Object> , but if I move that element to the 0 position it will overwrite my current element in the 0 position. Instead, I need to create a transparent row cell that says for example Favorites, and then below that cell (assuming is before 0 position in my array) start adding the favorites below it.
I will illustrate what I need to do.
This image is in the same RecyclerView without creating a new one above to show favorites. What I need to do is clicking one element, removing it and just replace it at the top of the RecyclerView but with a text on the top that says favorites, and after that each element that I add to the favorite list is just placed below the latest one there, so I was wondering what is the best way to accomplish this behaviour
This is what I need, pressing to like below, and then have my liked rows above, all in one place.
Thanks for any hint !

Highlight specific item in treetableview or treeview

I have two TreeViews/TreeTableViews. When clicking on a specific TreeItem in one of those Trees I first collapse the other Tree and then expand only the path to the Item that holds the same information. This is already working nicely.
What is missing still: When expanding the second path of the second Tree I would like Highlight the TreeItem in the second Tree that hold the same information for a shot time( a second or so).
I tried to set it selected and played around setStyle function, which did not have any effect.
Could you give me a hint how to solve this?
Thanks in advance

Tree Table : links are not shown

I've created a custom Table structure by combining a JTree and JTable.
it looks like this:
addition of leafs can be done to any element.
But when I try to add a node to a row which has children already, the link in not shown and the newly added row is also not shown.
this is how it looks when a new row is added to "Package":
But this problem does not occurred when a node is appended to a leaf.
But there are no errors or exceptions thrown.
after a node is added i do the following:
fireTableDataChanged
fireTableStructureChanged
scrollPathToVisible
although these are called the problem remains.
can anyone please give a suggestion?
thanks in advance...
Try calling updateUI() on the JTable or JTree. updateUI() will propagate, rendering the rest of the components beneath it.
http://docs.oracle.com/javase/6/docs/api/javax/swing/JTable.html#updateUI()

Filtering a ListView in wicket using 2 drop down boxes

I am trying to filter a list that is placed into a listview through the use of 2 drop down boxes.
The first dropdown box is titled price and the second is owner.
I want to be able to select a value in one or more of these drop down boxes and then have the List view re-render with the filtered results.
The trouble is I do not know how to begin this task, would someone be so kind as to enlighten me :D
Thanks in advance!
Your best starting point is probably this example: (Source code also available on this page, ChoicePage.java is the name)
First of all, you have to use a dynamic model in your ListView that generates the list of items depending on what you had selected in the dropdown boxes.
Then the basic idea is that you add an AjaxFormComponentUpdatingBehavior to the components that control the updates (your two dropdown boxes in your case), and in the onUpdate() method of this behaviour you should add the component you want to update to that AjaxRequestTarget passed.

Rich faces tree refresh selected node

Can someone provide me a working example of rich tree which refreshes it's nodes, when there is a new child added or removed. It should be done using ajaxKeys attribute, but I can't find any working examples on it.
Thanks in advance

Categories