use of com.servoy.j2db.util.model.AlwaysRowSelectedSelectionModel in project servoy-client by Servoy.
the class SwingRelatedFoundSet method createSelectionModel.
private void createSelectionModel() {
if (selectionModel == null) {
selectionModel = new AlwaysRowSelectedSelectionModel(this);
addListDataListener(selectionModel);
}
}
use of com.servoy.j2db.util.model.AlwaysRowSelectedSelectionModel in project servoy-client by Servoy.
the class SwingRelatedFoundSet method copyCurrentRecordFoundSet.
@Override
public // used for printing current record
IFoundSetInternal copyCurrentRecordFoundSet() throws // used for printing current record
ServoyException {
SwingRelatedFoundSet sfs = (SwingRelatedFoundSet) super.copyCurrentRecordFoundSet();
if (sfs != null) {
sfs.selectionModel = new AlwaysRowSelectedSelectionModel(this);
sfs.addListDataListener(sfs.selectionModel);
}
return sfs;
}
use of com.servoy.j2db.util.model.AlwaysRowSelectedSelectionModel in project servoy-client by Servoy.
the class SwingFoundSet method createSelectionModel.
private void createSelectionModel() {
if (selectionModel == null) {
selectionModel = new AlwaysRowSelectedSelectionModel(this);
addListDataListener(selectionModel);
}
}
use of com.servoy.j2db.util.model.AlwaysRowSelectedSelectionModel in project servoy-client by Servoy.
the class FixedJTable method changeSelection.
/**
* @see javax.swing.JTable#changeSelection(int, int, boolean, boolean)
*/
@Override
public void changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend) {
if (cellEditor != null && getEditingRow() != rowIndex && !cellEditor.stopCellEditing()) {
// don't change selection if there is a celleditor hanging around.
return;
}
ListSelectionModel rsm = getSelectionModel();
boolean isSelected = false;
for (int index : getSelectedRows()) if (index == rowIndex)
isSelected = true;
if (!isSelected && rsm instanceof AlwaysRowSelectedSelectionModel && !((AlwaysRowSelectedSelectionModel) rsm).canChangeSelection())
return;
ListSelectionModel csm = getColumnModel().getSelectionModel();
// get the value so it will be loaded first.
TableModel model = getModel();
if (model instanceof FoundSet)
((FoundSet) model).getRecord(rowIndex);
changeSelectionModel(csm, columnIndex, toggle, extend, false, false);
changeSelectionModel(rsm, rowIndex, toggle, extend, rsm.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION ? rsm.isSelectedIndex(rowIndex) : false, true);
// everything!
if (getAutoscrolls()) {
Rectangle cellRect = getCellRect(rowIndex, columnIndex, false);
if (cellRect != null) {
scrollRectToVisible(cellRect);
}
}
}
Aggregations