Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Porting ho table model to kotlin #2177

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/main/java/core/db/UserColumnsTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ void deleteModel(int modelId) {
}

void saveModel(HOTableModel model) {
deleteModel(model.getId());
deleteModel(model.id);
UserColumn[] dbcolumns = model.getColumns();
for (int i = 0; i < dbcolumns.length; i++) {

if (model.getId() == 2 && dbcolumns[i].getId() == UserColumnFactory.ID) {
if (model.id == 2 && dbcolumns[i].getId() == UserColumnFactory.ID) {
dbcolumns[i].setDisplay(true); // force ID column
}

if (dbcolumns[i].isDisplay()) {
var _userColumn = new _UserColumn();
_userColumn.setModelIndex(i);
_userColumn.setId(model.getId() * 1000 + dbcolumns[i].getId());
_userColumn.setId(model.id * 1000 + dbcolumns[i].getId());
_userColumn.setPreferredWidth(dbcolumns[i].getPreferredWidth());
_userColumn.setIndex(dbcolumns[i].getIndex());
_userColumn.setSortPriority(dbcolumns[i].getSortPriority());
Expand All @@ -76,7 +76,7 @@ void insertDefault(HOTableModel model) {

void loadModel(HOTableModel model) {
int count = 0;
var userColumns = load(_UserColumn.class, model.getId() * 1000, model.getId() * 1000 + 999);
var userColumns = load(_UserColumn.class, model.id * 1000, model.id * 1000 + 999);
if (!userColumns.isEmpty()) { // user may not delete all columns
var modelColumns = model.getColumns();
if (model.userCanDisableColumns() && !DBManager.instance().isFirstStart()) {
Expand Down
222 changes: 0 additions & 222 deletions src/main/java/core/gui/comp/table/FixedColumnsTable.java

This file was deleted.

Loading