Add a listener to the tree
Posted: Wed May 30, 2018 11:44 am
Hi All
I use java to develop libreoffice extension. I have already drawn a tree view on a dialog, but I need to add a listener on the tree now, by selecting or double-clicking on the bottommost item and performing some actions.
I want to use XSelectionChangeListener to achieve, but I haven't found a way yet to link it to my tree
Object treeControl = xMultiComponentFactory.createInstanceWithContext("com.sun.star.awt.tree.TreeControl", context);
XTreeControl oTree = (XTreeControl)UnoRuntime.queryInterface(XTreeControl.class, treeControl);
oTree.addSelectionChangeListener(new SelectionListener(context, xDialog, oTree));
Is there any way to link? or you have a better way to do. Thank you for all your Suggestions!
I use java to develop libreoffice extension. I have already drawn a tree view on a dialog, but I need to add a listener on the tree now, by selecting or double-clicking on the bottommost item and performing some actions.
I want to use XSelectionChangeListener to achieve, but I haven't found a way yet to link it to my tree
Object treeControl = xMultiComponentFactory.createInstanceWithContext("com.sun.star.awt.tree.TreeControl", context);
XTreeControl oTree = (XTreeControl)UnoRuntime.queryInterface(XTreeControl.class, treeControl);
oTree.addSelectionChangeListener(new SelectionListener(context, xDialog, oTree));
Is there any way to link? or you have a better way to do. Thank you for all your Suggestions!