Line 1... |
Line 1... |
1 |
/*
|
1 |
/*
|
2 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
2 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
3 |
*
|
3 |
*
|
4 |
* Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
|
4 |
* Copyright 2011-2019 OpenConcerto, by ILM Informatique. All rights reserved.
|
5 |
*
|
5 |
*
|
6 |
* The contents of this file are subject to the terms of the GNU General Public License Version 3
|
6 |
* The contents of this file are subject to the terms of the GNU General Public License Version 3
|
7 |
* only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
|
7 |
* only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
|
8 |
* copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
|
8 |
* copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
|
9 |
* language governing permissions and limitations under the License.
|
9 |
* language governing permissions and limitations under the License.
|
Line 80... |
Line 80... |
80 |
try {
|
80 |
try {
|
81 |
if (destID.get() != null) {
|
81 |
if (destID.get() != null) {
|
82 |
SQLUtils.executeAtomic(getTable().getDBSystemRoot().getDataSource(), new ConnectionHandlerNoSetup<Object, Exception>() {
|
82 |
SQLUtils.executeAtomic(getTable().getDBSystemRoot().getDataSource(), new ConnectionHandlerNoSetup<Object, Exception>() {
|
83 |
@Override
|
83 |
@Override
|
84 |
public Object handle(SQLDataSource ds) throws Exception {
|
84 |
public Object handle(SQLDataSource ds) throws Exception {
|
85 |
moveQuick(rows, after, destID.get().getRow().asRow());
|
85 |
moveQuick(rows, after, destID.get().getRowAccessor().asRow());
|
86 |
return null;
|
86 |
return null;
|
87 |
}
|
87 |
}
|
88 |
});
|
88 |
});
|
89 |
}
|
89 |
}
|
90 |
} catch (Exception e) {
|
90 |
} catch (Exception e) {
|
Line 105... |
Line 105... |
105 |
assert rowIndex >= 0;
|
105 |
assert rowIndex >= 0;
|
106 |
assert SwingUtilities.isEventDispatchThread();
|
106 |
assert SwingUtilities.isEventDispatchThread();
|
107 |
final int rowCount = this.tableModel.getRowCount();
|
107 |
final int rowCount = this.tableModel.getRowCount();
|
108 |
final boolean after = rowIndex >= rowCount;
|
108 |
final boolean after = rowIndex >= rowCount;
|
109 |
final int index = after ? rowCount - 1 : rowIndex;
|
109 |
final int index = after ? rowCount - 1 : rowIndex;
|
110 |
final SQLRowValues line = this.tableModel.getRow(index).getRow();
|
110 |
final SQLRowAccessor line = this.tableModel.getRow(index).getRowAccessor();
|
111 |
assert line.isFrozen() : "row could change by the time move() is called";
|
111 |
assert line.isFrozen() : "row could change by the time move() is called";
|
112 |
|
112 |
|
113 |
return this.put(new Runnable() {
|
113 |
return this.put(new Runnable() {
|
114 |
@Override
|
114 |
@Override
|
115 |
public void run() {
|
115 |
public void run() {
|