Get multiple selected AuthorNodes
Posted: Fri Dec 09, 2016 2:24 am
Hi I am attempting to get multiple selected nodes (something like List<AuthorNode>) from AuthorAccess object in our custom framework. Consider the scenario of multiple cells selected in a table (we are using oasis:table). You can see from the attached screenshot the user has selected 4 cells across 2 columns and see the corresponding selected elements in the outline view to the left.
I have attempted the following test code:
The log output shows that only the trow parent elements are selected by this:
I am trying to get a List<AuthorNode> of the selected (in this case) <oasis:entry/> elements. Any thoughts?
I have attempted the following test code:
Code: Select all
List<ContentInterval> selections = aa.getEditorAccess().getAuthorSelectionModel().getSelectionIntervals();
for (ContentInterval contentInterval : selections) {
log.debug(aa.getDocumentController().getNodeAtOffset(contentInterval.getStartOffset()).getDisplayName());
}
Code: Select all
7004548 DEBUG[ AWT-EventQueue-0 ] ca.bc.gov.qp.civix.municipal.action.TableOperation - oasis:trow
7005643 DEBUG [ AWT-EventQueue-0 ] ca.bc.gov.qp.civix.municipal.action.TableOperation - oasis:trow