Cleanup.
This commit is contained in:
parent
755dc87aec
commit
c08276abbf
|
@ -4,7 +4,6 @@ import com.andrewlalis.javafx_scene_router.RouteSelectionListener;
|
||||||
import com.andrewlalis.perfin.data.DateUtil;
|
import com.andrewlalis.perfin.data.DateUtil;
|
||||||
import com.andrewlalis.perfin.model.Account;
|
import com.andrewlalis.perfin.model.Account;
|
||||||
import com.andrewlalis.perfin.model.Profile;
|
import com.andrewlalis.perfin.model.Profile;
|
||||||
import javafx.event.ActionEvent;
|
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.scene.control.Alert;
|
import javafx.scene.control.Alert;
|
||||||
import javafx.scene.control.ButtonType;
|
import javafx.scene.control.ButtonType;
|
||||||
|
|
|
@ -8,7 +8,6 @@ import javafx.beans.property.BooleanProperty;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.scene.Node;
|
import javafx.scene.Node;
|
||||||
import javafx.scene.control.Button;
|
import javafx.scene.control.Button;
|
||||||
import javafx.scene.control.Label;
|
|
||||||
import javafx.scene.control.TextField;
|
import javafx.scene.control.TextField;
|
||||||
import javafx.scene.layout.AnchorPane;
|
import javafx.scene.layout.AnchorPane;
|
||||||
import javafx.scene.layout.HBox;
|
import javafx.scene.layout.HBox;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package com.andrewlalis.perfin.control;
|
package com.andrewlalis.perfin.control;
|
||||||
|
|
||||||
import com.andrewlalis.perfin.view.component.AttachmentPreview;
|
|
||||||
import com.andrewlalis.perfin.data.CurrencyUtil;
|
import com.andrewlalis.perfin.data.CurrencyUtil;
|
||||||
import com.andrewlalis.perfin.data.DateUtil;
|
import com.andrewlalis.perfin.data.DateUtil;
|
||||||
import com.andrewlalis.perfin.model.CreditAndDebitAccounts;
|
import com.andrewlalis.perfin.model.CreditAndDebitAccounts;
|
||||||
|
@ -8,6 +7,7 @@ import com.andrewlalis.perfin.model.Profile;
|
||||||
import com.andrewlalis.perfin.model.Transaction;
|
import com.andrewlalis.perfin.model.Transaction;
|
||||||
import com.andrewlalis.perfin.model.TransactionAttachment;
|
import com.andrewlalis.perfin.model.TransactionAttachment;
|
||||||
import com.andrewlalis.perfin.view.BindingUtil;
|
import com.andrewlalis.perfin.view.BindingUtil;
|
||||||
|
import com.andrewlalis.perfin.view.component.AttachmentPreview;
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.beans.property.SimpleListProperty;
|
import javafx.beans.property.SimpleListProperty;
|
||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
|
@ -16,7 +16,6 @@ import javafx.fxml.FXML;
|
||||||
import javafx.scene.control.Hyperlink;
|
import javafx.scene.control.Hyperlink;
|
||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
||||||
import javafx.scene.control.ScrollPane;
|
import javafx.scene.control.ScrollPane;
|
||||||
import javafx.scene.control.skin.ScrollPaneSkin;
|
|
||||||
import javafx.scene.layout.HBox;
|
import javafx.scene.layout.HBox;
|
||||||
import javafx.scene.layout.VBox;
|
import javafx.scene.layout.VBox;
|
||||||
import javafx.scene.text.TextFlow;
|
import javafx.scene.text.TextFlow;
|
||||||
|
|
|
@ -3,13 +3,13 @@ package com.andrewlalis.perfin.control;
|
||||||
import com.andrewlalis.javafx_scene_router.RouteSelectionListener;
|
import com.andrewlalis.javafx_scene_router.RouteSelectionListener;
|
||||||
import com.andrewlalis.perfin.Pair;
|
import com.andrewlalis.perfin.Pair;
|
||||||
import com.andrewlalis.perfin.SceneUtil;
|
import com.andrewlalis.perfin.SceneUtil;
|
||||||
import com.andrewlalis.perfin.view.component.DataSourcePaginationControls;
|
|
||||||
import com.andrewlalis.perfin.view.component.TransactionTile;
|
|
||||||
import com.andrewlalis.perfin.data.pagination.Page;
|
import com.andrewlalis.perfin.data.pagination.Page;
|
||||||
import com.andrewlalis.perfin.data.pagination.PageRequest;
|
import com.andrewlalis.perfin.data.pagination.PageRequest;
|
||||||
import com.andrewlalis.perfin.data.pagination.Sort;
|
import com.andrewlalis.perfin.data.pagination.Sort;
|
||||||
import com.andrewlalis.perfin.model.Profile;
|
import com.andrewlalis.perfin.model.Profile;
|
||||||
import com.andrewlalis.perfin.model.Transaction;
|
import com.andrewlalis.perfin.model.Transaction;
|
||||||
|
import com.andrewlalis.perfin.view.component.DataSourcePaginationControls;
|
||||||
|
import com.andrewlalis.perfin.view.component.TransactionTile;
|
||||||
import javafx.beans.property.ObjectProperty;
|
import javafx.beans.property.ObjectProperty;
|
||||||
import javafx.beans.property.SimpleObjectProperty;
|
import javafx.beans.property.SimpleObjectProperty;
|
||||||
import javafx.beans.value.ObservableValue;
|
import javafx.beans.value.ObservableValue;
|
||||||
|
@ -95,25 +95,4 @@ public class TransactionsViewController implements RouteSelectionListener {
|
||||||
tile.selected.bind(selectedTransaction.map(t -> t != null && t.getId() == transaction.getId()));
|
tile.selected.bind(selectedTransaction.map(t -> t != null && t.getId() == transaction.getId()));
|
||||||
return tile;
|
return tile;
|
||||||
}
|
}
|
||||||
|
|
||||||
// private void refreshTransactions() {
|
|
||||||
// Thread.ofVirtual().start(() -> {
|
|
||||||
// Profile.getCurrent().getDataSource().useTransactionRepository(repo -> {
|
|
||||||
// var page = repo.findAll(PageRequest.unpaged(Sort.desc("timestamp")));
|
|
||||||
// var components = page.items().stream().map(transaction -> {
|
|
||||||
// var tile = new TransactionTile(transaction, this::refreshTransactions);
|
|
||||||
// tile.setOnMouseClicked(event -> {
|
|
||||||
// if (selectedTransaction.get() == null || selectedTransaction.get().getId() != transaction.getId()) {
|
|
||||||
// selectedTransaction.set(transaction);
|
|
||||||
// } else {
|
|
||||||
// selectedTransaction.set(null);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// tile.selected.bind(selectedTransaction.map(t -> t != null && t.getId() == transaction.getId()));
|
|
||||||
// return tile;
|
|
||||||
// }).toList();
|
|
||||||
// Platform.runLater(() -> transactionsVBox.getChildren().setAll(components));
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class AttachmentPreview extends BorderPane {
|
||||||
Image img = new Image(in, IMAGE_SIZE, IMAGE_SIZE, true, true);
|
Image img = new Image(in, IMAGE_SIZE, IMAGE_SIZE, true, true);
|
||||||
contentContainer.setCenter(new ImageView(img));
|
contentContainer.setCenter(new ImageView(img));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace(System.err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue