Javafx tableview comboboxtablecell filter - javafx

Please if any one know is it possible to add filter feature to comboboxtablecell in an editable tableview, the problem i have is that i have an editable tableview with a combobox in a column and the amount of data populated in combobox is huge (near of 25500 items) so it's hard for a user to seek an item in the combobox so i was wondering if it's possible to add filter feature to comboboxtablecell.
Thank you for your help.

Related

Highlight NSTableView rows as if right-clicked

I'd like to make an NSTableView highlight its selected rows as if one was right-clicked.
When a selected row is right-clicked (and if the table view implements a menu), the view draws a rectangle at the perimeter of each block of selected rows. This is the default behaviour. See below:
I want the table to do that outside of the context of a right-click. FYI, this is to implement a custom dragging Destination Feedback Style to make clear that some action will be applied on the selected rows.
I can programmatically select rows, but not make them highlight in this way.
Still, Appkit must have some method for that since it does it upon right-click.
I could find a solution involving subclassing NSTableView or NSTableRowView, but there may be a simple solution.
Thanks.

How to get the tableview object which is inside a tab which inturn is inside a Tabpane Javafx

I have a tabpane which has 13 tabs and each of those thirteen tabs have 13 table views as well as some components like buttons and labels in each tab
I want to get the tableview object by selecting the tableview from a particular tab.
Like if the focus comes to a table view i can get to know from which tab it has come so that i can use the particular tableview object in a method.
As i have a method that will do a task which is same just the tableview changes depending upon the tab , si if i can get the tableviews i do not need to code 13 methods. But the issue is the tab on tabpane dosent only have tableview it has labels buttons also. How to fetch the extact I am not sure how to move further as beacuse what i exactly want is like i have a method that will do a task which ia same just the tableview changes depending upon the tab , so if i can get the tableview obj of each tab i do not need to code 13 methods. But the issue is the tab on tabpane dosent only have tableview it has labels buttons also. How to fetch the extact node.
The logic behind the tab and tab pane is a fxml component . I am using fxml component to develop my application.
eg:-
Set<Report> selection = new HashSet<Report>(businessEventReport.getSelectionModel().getSelectedItems());
here the businessEventreport is a table view in a table , i want to get the particular tableview by focusing on the particular tableview of the tab.
how do i do that .
i can get the tabs using
SingleSelectionModel<Tab> selectionModel = tabpane.getSelectionModel();
selectionModel.getSelectedItem().getContent();
but i am stuck after that.
One solution would be to assign each of your TableViews an identifier. This
identifier would then be used to discover the TableView from amongst the set of controls on each tab (or the whole Scene) using the lookup method.
To set the identifier for each TableView use the Node.setId method.
tableView.setId("MyTable")
To find the TableView from the TabPane use the Node.lookup method.
Tab selectedTab = tabPane.getSelectionModel().getSelectedItem()
Node selectedContent = selectedTab.getContent()
TableView selectedTable = selectedContent.lookup("#MyTable")
The lookup method searches through the children of the Node used to perform the lookup. This gives you the flexibility to either assign each of your TableViews a unique identifier, allowing lookup from TabPane itself or to assign them all the same identifier and use the parent Tab to discover the TableView (example above).
The lookup method uses a CSS selector to find controls so identifiers aren't mandatory. An alternative approach would be to use the class type and state of the TabPane and TableView to form a selector. Something like the following (untested).
selectedContent.lookup(".tab-pane > .tab:selected > .table-view")

JavaFX TableView how to get a row cell graphic

I have a JavaFX TableView, the first column is a selection checkbox column, user can select the checkbox and do something. And in the header column, it have a checkbox, I wan't it to be select all, when selected this column, it will select all checkbox to be selected. But the question is I haven't found there have any methods or ways in the JavaFX TableView or TableColumn to get the checkbox in the table row. If I can the checkboxs in the table row, I can change their state to checked.
Thanks in advance.

Adobe Flex Combobox as itemrenderer

I have a flex combobox as a datagrid itemEditor.
However, after selecting an item in the combobox, its necessary to click out of the combo (i.e. into another cell or elsewhere in the app) for the value to be committed to the combo. Prior to this, the combo sits 'proud' of the datagrid and the value hasnt actually been committed.
Is there a way to force the value to be immediately committed after an item has been selected and for the combo to 'lose focus'?
Ahh, so easy.
this.parentDocument.setFocus();

Include ComboBox in flex datagrid header

I want the comboBox to be placed in one of the columns of the datagrid header.The datagrid should be filtered according to the value selected in the comboBox.
Can anyone help me out in this with a sample code.
Thanks in advance.
Provide headerRenderer for DatagridColumn. Just create canvas with label and combobox.

Resources