The other DataGrid from TableDiffViewer

Answered

Hi,

I'd like to extend the functionality of DataGrip/DatabaseTools tables comparison, so that I can select a cell in one side, perform some calculations based on its value, perform some calculations for value of respective cell from the other side, and display the results with standard DiffTool.

I registered an action in Console.TableResult.PopupGroup group and found out I can access DataGrid for selected cell with

val dataGrid = anActionEvent.getData(DatabaseDataKeys.DATA_GRID_KEY)

However I didn't found a way to access the DataGrid of the other side (or TableDiffViewer to access both DataGrids). How can I do it?

 

Regards,
Andrzej

2 comments
Comment actions Permalink

There is no simple and open-API way to do that. You can access it from `com.intellij.diff.tools.util.DiffDataKeys#DIFF_VIEWER`, that will be table diff viewer which has `getEditor1` & `getEditor2` methods

1
Comment actions Permalink

Maybe not prettiest, as I need to access these methods using reflection, but works!
Thanks a lot!

0

Please sign in to leave a comment.