itemElement.setAttribute("rollover-enabled", "true");
}
if (selectionEnabled) {
itemElement.setAttribute("selection-enabled", "true");
ListSelectionModel selectionModel = table.getSelectionModel();
if (selectionModel.getSelectionMode() == ListSelectionModel.MULTIPLE_SELECTION) {
itemElement.setAttribute("selection-mode", "multiple");
}
if (selectionModel.getMinSelectedIndex() != -1) {
Element selectionElement = document.createElement("selection");
int minimumIndex = selectionModel.getMinSelectedIndex();
int maximumIndex = selectionModel.getMaxSelectedIndex();
if (maximumIndex > table.getModel().getRowCount() - 1) {
maximumIndex = table.getModel().getRowCount() - 1;
}
for (int i = minimumIndex; i <= maximumIndex; ++i) {
if (selectionModel.isSelectedIndex(i)) {
Element rowElement = document.createElement("row");
rowElement.setAttribute("index", Integer.toString(i));
selectionElement.appendChild(rowElement);
}
}