use of com.ramussoft.database.common.RowMover in project ramus by Vitaliy-Yakovchuk.
the class RowTreeTable method importData.
@SuppressWarnings("unchecked")
public boolean importData(final Transferable t, final boolean on, final int index) {
if (index < 0)
return false;
if (canImport(t.getTransferDataFlavors())) {
try {
final ArrayList<Integer> list = (ArrayList<Integer>) t.getTransferData(localListFlavor);
final int[] sels = new int[list.size()];
for (int i = 0; i < sels.length; i++) sels[i] = list.get(i);
final RowMover mover = getRowMover(sels);
try {
if (on)
mover.on(index);
else
mover.insert(index);
} catch (final Exception e) {
e.printStackTrace();
}
return true;
} catch (final UnsupportedFlavorException e) {
e.printStackTrace();
} catch (final IOException e) {
e.printStackTrace();
}
}
return false;
}
use of com.ramussoft.database.common.RowMover in project ramus by Vitaliy-Yakovchuk.
the class RowTreeTable method getRowMover.
private RowMover getRowMover(final int[] sels) {
final Row[] group = getShownRows();
final RowMover mover = new RowMover(rowSet.getRoot(), group, sels, accessRules, rowSet);
return mover;
}
Aggregations