I have a JComboBox with a custom Editor.
Why I make a selection from the dropdown list, I find that setItem() method of the Editor is called twice with the same selected item from the drop list.
Why is that?
As explained here:
It fires twice because one item becomes DESELECTED and another becomes SELECTED. Event fires for both. You can check which one occured by calling e.getStateChange().
Related
I am searching for a solution to how I can start an ag-grid table with only cell editors. That means I do not want to click into the row or cell to edit the data.
I have found almost a solution for me with this example in the doc:
Full row editing
This is exactly what I am searching for. I can programmatically start editing immediately. The problem with that example is that onCellValueChanged is only fired after the keyboard click "enter" or click on the next row.
I would need a solution where onCellValueChanged is fired immediately after a cell changed.
I can think of two ideas to accomplish this:
Use "No Click Editing"
This is similar to having all cells contain an input box. It just takes 1 click to focus.
https://www.ag-grid.com/javascript-grid-cell-editing/#no-click-editing
Custom cell renderer
Use a custom cell renderer to have input boxes in each cell. Then, you are always in edit mode. And you can control when the value is saved.
https://www.ag-grid.com/javascript-grid-cell-rendering-components/
I am using this EA_OnNotifyContextItemModified method for tracing the changes in the properties window of an element in EA.
I need to know is there any event on click of “OK/Cancel/Apply” buttons in the properties window of EA.
As shown in the image, i need to know is there any event that will be called particularly on click of "OK/Cancel/Apply" buttons of that window
It's either EA_OnPostNewElement if the element has been created newly or EA_OnNotifyContextItemModified if you have modified an existing element.
Btw. you find both in the help in this chapter and this one.
My custom CQ5 component has a dialog which consists of 2 drop down menus. I would like to automatically set a default value to second menu depending on whatever is the value selected from the previous drop down.
How can I achieve this?
you can register handlers for different events triggered by the widgets. You can use the "selectionchanged" event to register a function that will read the new content from the dropdown and then use the setValue() method in the second dropdown to put whatever you want there.
To obtain the second dropdown from the first you can use the nextSibling() method.
The widget documentation will help you a lot. look for "selection"
I would like to reject the selection of a row in a datagrid based on the state of a form. If the form has fields with changed data, I would like the row selection to rejected.
Is there an event I could trap (before selection) and cancel or do I have to implement the logic myself?
You can either use a SelectionChangeHandler on your SelectionModel (it gives you an object which was selected, and you can unselect it), or you can use the CellPreviewHandler on your DataGrid (it gives you a row which was clicked - event.getContext().getIndex() - and you can unselect it in your SelectionModel).
The choice depends on what you want to do after the event: you have to do something obvious in your UI so that users are not confused why clicking on one row selects it, while clicking on another row does not. For example, you can change the background color of unselectable rows as soon as you render your DataGrid, and then show an error message when the wrong row is selected.
I have a menu drop down action in the coolbar. It has 3 sub items that form a radio group. I would like to change the icon shown in the coolbar when the user selects one of these options.
I've googled and seen that I should look at:
org.eclipse.ui.commands.ICommandService.refreshElements(String, Map)
and
org.eclipse.ui.commands.IElementUpdater
Its probably the right thing to look at exception its not enough information. One or two small code snippets will be excellent.
Thanks in advance.
Ok basically if you don't want to use a "custom" control the what to do it is to have your handler (handler that is linked to the specific command) implement IElementUpdater. When every the toolbar item gets shown or clicked on (i.e if the user selects on the the radio buttons) the method: updateElement(UIElement element, Map parameters) gets called.
The element has a setIcon() method and this is what i used to change the icon of the menu drop down action.
Every update to the Coolbar points to the specialization of the WorkbenchWindowControlContribution class.
This bug 186800 has some code example in it which can be of interest.