Polish whitespace and field ordering in view classes

This commit is contained in:
Chris Beams 2014-11-23 07:06:51 +01:00
parent 349f7dbc51
commit 68a1140a6d
No known key found for this signature in database
GPG key ID: 3D214F8F5BC5ED73
29 changed files with 146 additions and 425 deletions

View file

@ -31,7 +31,6 @@ public abstract class ActivatableViewAndModel<R extends Node, M extends Activata
this((M) Activatable.NOOP_INSTANCE); this((M) Activatable.NOOP_INSTANCE);
} }
@Override @Override
public final void activate() { public final void activate() {
model.activate(); model.activate();
@ -49,5 +48,4 @@ public abstract class ActivatableViewAndModel<R extends Node, M extends Activata
protected void doDeactivate() { protected void doDeactivate() {
} }
} }

View file

@ -30,15 +30,14 @@ import javafx.scene.control.*;
public class AccountView extends ActivatableView<TabPane, AccountViewModel> { public class AccountView extends ActivatableView<TabPane, AccountViewModel> {
@FXML Tab accountSettingsTab, arbitratorSettingsTab;
private Navigation.Listener navigationListener; private Navigation.Listener navigationListener;
private ChangeListener<Tab> tabChangeListener; private ChangeListener<Tab> tabChangeListener;
@FXML Tab accountSettingsTab, arbitratorSettingsTab;
private final ViewLoader viewLoader; private final ViewLoader viewLoader;
private final Navigation navigation; private final Navigation navigation;
@Inject @Inject
private AccountView(AccountViewModel model, ViewLoader viewLoader, Navigation navigation) { private AccountView(AccountViewModel model, ViewLoader viewLoader, Navigation navigation) {
super(model); super(model);
@ -46,7 +45,6 @@ public class AccountView extends ActivatableView<TabPane, AccountViewModel> {
this.navigation = navigation; this.navigation = navigation;
} }
@Override @Override
public void initialize() { public void initialize() {
navigationListener = navigationItems -> { navigationListener = navigationItems -> {

View file

@ -33,13 +33,12 @@ import javafx.stage.Stage;
// TODO Arbitration is very basic yet // TODO Arbitration is very basic yet
public class ArbitratorSettingsView extends AbstractView { public class ArbitratorSettingsView extends AbstractView {
private ArbitratorRegistrationView arbitratorRegistrationView;
private final ViewLoader viewLoader; private final ViewLoader viewLoader;
private final Navigation navigation; private final Navigation navigation;
private final Stage primaryStage; private final Stage primaryStage;
private ArbitratorRegistrationView arbitratorRegistrationView;
@Inject @Inject
private ArbitratorSettingsView(ViewLoader viewLoader, Navigation navigation, Stage primaryStage) { private ArbitratorSettingsView(ViewLoader viewLoader, Navigation navigation, Stage primaryStage) {
this.viewLoader = viewLoader; this.viewLoader = viewLoader;
@ -47,8 +46,6 @@ public class ArbitratorSettingsView extends AbstractView {
this.primaryStage = primaryStage; this.primaryStage = primaryStage;
} }
@Override @Override
protected View loadView(Navigation.Item navigationItem) { protected View loadView(Navigation.Item navigationItem) {
ViewLoader.Item loaded = viewLoader.load(navigationItem.getFxmlUrl(), false); ViewLoader.Item loaded = viewLoader.load(navigationItem.getFxmlUrl(), false);
@ -71,7 +68,6 @@ public class ArbitratorSettingsView extends AbstractView {
return arbitratorRegistrationView; return arbitratorRegistrationView;
} }
@FXML @FXML
public void onArbitratorRegistration() { public void onArbitratorRegistration() {
loadView(Navigation.Item.ARBITRATOR_REGISTRATION); loadView(Navigation.Item.ARBITRATOR_REGISTRATION);

View file

@ -42,20 +42,19 @@ import javafx.stage.Stage;
// TODO Arbitration is very basic yet // TODO Arbitration is very basic yet
public class ArbitratorBrowserView extends ActivatableView<Pane, Void> implements ArbitratorListener { public class ArbitratorBrowserView extends ActivatableView<Pane, Void> implements ArbitratorListener {
private final ViewLoader viewLoader; @FXML Button prevButton, nextButton, selectButton, closeButton;
private final AccountSettings accountSettings; @FXML Pane arbitratorProfile;
private final Persistence persistence;
private final MessageService messageService;
private final List<Arbitrator> allArbitrators = new ArrayList<>();
private Arbitrator currentArbitrator; private Arbitrator currentArbitrator;
private ArbitratorProfileView arbitratorProfileView; private ArbitratorProfileView arbitratorProfileView;
private int index = -1; private int index = -1;
@FXML Button prevButton, nextButton, selectButton, closeButton; private final List<Arbitrator> allArbitrators = new ArrayList<>();
@FXML Pane arbitratorProfile;
private final ViewLoader viewLoader;
private final AccountSettings accountSettings;
private final Persistence persistence;
private final MessageService messageService;
@Inject @Inject
public ArbitratorBrowserView(ViewLoader viewLoader, AccountSettings accountSettings, Persistence persistence, public ArbitratorBrowserView(ViewLoader viewLoader, AccountSettings accountSettings, Persistence persistence,
@ -66,7 +65,6 @@ public class ArbitratorBrowserView extends ActivatableView<Pane, Void> implement
this.messageService = messageService; this.messageService = messageService;
} }
@Override @Override
public void initialize() { public void initialize() {
messageService.addArbitratorListener(this); messageService.addArbitratorListener(this);

View file

@ -31,33 +31,22 @@ import javafx.scene.control.*;
// TODO Arbitration is very basic yet // TODO Arbitration is very basic yet
public class ArbitratorProfileView extends AbstractView { public class ArbitratorProfileView extends AbstractView {
private final Preferences preferences; @FXML Label nameLabel;
@FXML TextArea descriptionTextArea;
@FXML TextField nameTextField, languagesTextField, reputationTextField, feeTextField, methodsTextField,
passiveServiceFeeTextField, idVerificationsTextField, webPageTextField, maxTradeVolumeTextField;
private final Preferences preferences;
private final Persistence persistence; private final Persistence persistence;
private final BSFormatter formatter; private final BSFormatter formatter;
@FXML Label nameLabel;
@FXML TextField nameTextField, languagesTextField, reputationTextField,
feeTextField, methodsTextField, passiveServiceFeeTextField,
idVerificationsTextField, webPageTextField, maxTradeVolumeTextField;
@FXML TextArea descriptionTextArea;
@Inject @Inject
public ArbitratorProfileView(Preferences preferences, Persistence persistence, public ArbitratorProfileView(Preferences preferences, Persistence persistence, BSFormatter formatter) {
BSFormatter formatter) {
this.preferences = preferences; this.preferences = preferences;
this.persistence = persistence; this.persistence = persistence;
// ApplicationPreferences persistedApplicationPreferences = (ApplicationPreferences) storage
// .read(settings.getClass().getName());
// settings.applyPersistedSettings(persistedApplicationPreferences);
this.formatter = formatter; this.formatter = formatter;
} }
public void applyArbitrator(Arbitrator arbitrator) { public void applyArbitrator(Arbitrator arbitrator) {
if (arbitrator != null && arbitrator.getIdType() != null) { if (arbitrator != null && arbitrator.getIdType() != null) {
String name = ""; String name = "";
@ -85,6 +74,5 @@ public class ArbitratorProfileView extends AbstractView {
descriptionTextArea.setText(arbitrator.getDescription()); descriptionTextArea.setText(arbitrator.getDescription());
} }
} }
} }

View file

@ -58,36 +58,34 @@ import de.jensd.fx.fontawesome.AwesomeIcon;
// TODO Arbitration is very basic yet // TODO Arbitration is very basic yet
public class ArbitratorRegistrationView extends ActivatableView<AnchorPane, Void> { public class ArbitratorRegistrationView extends ActivatableView<AnchorPane, Void> {
private final Persistence persistence;
private final WalletService walletService;
private final MessageService messageService;
private final User user;
private final BSFormatter formatter;
private Arbitrator arbitrator = new Arbitrator();
private boolean isEditMode;
private List<Locale> languageList = new ArrayList<>();
private List<Arbitrator.METHOD> methodList = new ArrayList<>();
private List<Arbitrator.ID_VERIFICATION> idVerificationList = new ArrayList<>();
private Arbitrator.ID_TYPE idType;
@FXML Accordion accordion; @FXML Accordion accordion;
@FXML TitledPane profileTitledPane, paySecurityDepositTitledPane; @FXML TextArea descriptionTextArea;
@FXML Button saveProfileButton, paymentDoneButton; @FXML Button saveProfileButton, paymentDoneButton;
@FXML Label nameLabel, infoLabel, copyIcon, confirmationLabel; @FXML Label nameLabel, infoLabel, copyIcon, confirmationLabel;
@FXML ComboBox<Locale> languageComboBox; @FXML ComboBox<Locale> languageComboBox;
@FXML ComboBox<Arbitrator.ID_TYPE> idTypeComboBox; @FXML ComboBox<Arbitrator.ID_TYPE> idTypeComboBox;
@FXML ComboBox<Arbitrator.METHOD> methodsComboBox; @FXML ComboBox<Arbitrator.METHOD> methodsComboBox;
@FXML ConfidenceProgressIndicator progressIndicator;
@FXML ComboBox<Arbitrator.ID_VERIFICATION> idVerificationsComboBox; @FXML ComboBox<Arbitrator.ID_VERIFICATION> idVerificationsComboBox;
@FXML TitledPane profileTitledPane, paySecurityDepositTitledPane;
@FXML TextField nameTextField, idTypeTextField, languagesTextField, maxTradeVolumeTextField, @FXML TextField nameTextField, idTypeTextField, languagesTextField, maxTradeVolumeTextField,
passiveServiceFeeTextField, minPassiveServiceFeeTextField, arbitrationFeeTextField, passiveServiceFeeTextField, minPassiveServiceFeeTextField, arbitrationFeeTextField,
minArbitrationFeeTextField, methodsTextField, idVerificationsTextField, webPageTextField, minArbitrationFeeTextField, methodsTextField, idVerificationsTextField, webPageTextField,
securityDepositAddressTextField, balanceTextField; securityDepositAddressTextField, balanceTextField;
@FXML TextArea descriptionTextArea;
@FXML ConfidenceProgressIndicator progressIndicator;
private boolean isEditMode;
private Arbitrator.ID_TYPE idType;
private List<Locale> languageList = new ArrayList<>();
private List<Arbitrator.METHOD> methodList = new ArrayList<>();
private List<Arbitrator.ID_VERIFICATION> idVerificationList = new ArrayList<>();
private Arbitrator arbitrator = new Arbitrator();
private final Persistence persistence;
private final WalletService walletService;
private final MessageService messageService;
private final User user;
private final BSFormatter formatter;
@Inject @Inject
private ArbitratorRegistrationView(Persistence persistence, WalletService walletService, private ArbitratorRegistrationView(Persistence persistence, WalletService walletService,
@ -99,7 +97,6 @@ public class ArbitratorRegistrationView extends ActivatableView<AnchorPane, Void
this.formatter = formatter; this.formatter = formatter;
} }
@Override @Override
public void initialize() { public void initialize() {
accordion.setExpandedPane(profileTitledPane); accordion.setExpandedPane(profileTitledPane);
@ -187,7 +184,6 @@ public class ArbitratorRegistrationView extends ActivatableView<AnchorPane, Void
} }
} }
@FXML @FXML
public void onSelectIDType() { public void onSelectIDType() {
idType = idTypeComboBox.getSelectionModel().getSelectedItem(); idType = idTypeComboBox.getSelectionModel().getSelectedItem();
@ -244,7 +240,6 @@ public class ArbitratorRegistrationView extends ActivatableView<AnchorPane, Void
methodsTextField.setText(""); methodsTextField.setText("");
} }
@FXML @FXML
public void onAddIDVerification() { public void onAddIDVerification() {
Arbitrator.ID_VERIFICATION idVerification = idVerificationsComboBox.getSelectionModel().getSelectedItem(); Arbitrator.ID_VERIFICATION idVerification = idVerificationsComboBox.getSelectionModel().getSelectedItem();
@ -287,7 +282,6 @@ public class ArbitratorRegistrationView extends ActivatableView<AnchorPane, Void
public void onPaymentDone() { public void onPaymentDone() {
} }
private void setupPaySecurityDepositScreen() { private void setupPaySecurityDepositScreen() {
infoLabel.setText("You need to pay 2 x the max. trading volume as security deposit.\n\nThat payment will be " + infoLabel.setText("You need to pay 2 x the max. trading volume as security deposit.\n\nThat payment will be " +
"locked into a MultiSig fund and be refunded when you leave the arbitration pool.\nIn case of fraud " + "locked into a MultiSig fund and be refunded when you leave the arbitration pool.\nIn case of fraud " +

View file

@ -28,26 +28,19 @@ import javafx.fxml.FXML;
import javafx.scene.control.*; import javafx.scene.control.*;
import javafx.scene.layout.*; import javafx.scene.layout.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ChangePasswordView extends InitializableView<GridPane, ChangePasswordViewModel> implements Wizard.Step { public class ChangePasswordView extends InitializableView<GridPane, ChangePasswordViewModel> implements Wizard.Step {
private static final Logger log = LoggerFactory.getLogger(ChangePasswordView.class);
@FXML HBox buttonsHBox; @FXML HBox buttonsHBox;
@FXML Button saveButton, skipButton; @FXML Button saveButton, skipButton;
@FXML PasswordField oldPasswordField, passwordField, repeatedPasswordField; @FXML PasswordField oldPasswordField, passwordField, repeatedPasswordField;
private Wizard parent; private Wizard parent;
@Inject @Inject
private ChangePasswordView(ChangePasswordViewModel model) { private ChangePasswordView(ChangePasswordViewModel model) {
super(model); super(model);
} }
@Override @Override
public void initialize() { public void initialize() {
passwordField.textProperty().bindBidirectional(model.passwordField); passwordField.textProperty().bindBidirectional(model.passwordField);
@ -66,7 +59,6 @@ public class ChangePasswordView extends InitializableView<GridPane, ChangePasswo
buttonsHBox.getChildren().remove(skipButton); buttonsHBox.getChildren().remove(skipButton);
} }
@FXML @FXML
private void onSaved() { private void onSaved() {
if (model.requestSavePassword()) if (model.requestSavePassword())
@ -84,6 +76,5 @@ public class ChangePasswordView extends InitializableView<GridPane, ChangePasswo
private void onSkipped() { private void onSkipped() {
parent.nextStep(this); parent.nextStep(this);
} }
} }

View file

@ -60,19 +60,16 @@ public class FiatAccountView extends ActivatableViewAndModel<GridPane, FiatAccou
@FXML ComboBox<BankAccountType> typesComboBox; @FXML ComboBox<BankAccountType> typesComboBox;
@FXML ComboBox<Currency> currencyComboBox; @FXML ComboBox<Currency> currencyComboBox;
private final OverlayManager overlayManager;
private Wizard parent; private Wizard parent;
private final OverlayManager overlayManager;
@Inject @Inject
FiatAccountView(FiatAccountViewModel model, OverlayManager overlayManager) { public FiatAccountView(FiatAccountViewModel model, OverlayManager overlayManager) {
super(model); super(model);
this.overlayManager = overlayManager; this.overlayManager = overlayManager;
} }
@Override @Override
public void initialize() { public void initialize() {
typesComboBox.setItems(model.getAllTypes()); typesComboBox.setItems(model.getAllTypes());
@ -98,8 +95,6 @@ public class FiatAccountView extends ActivatableViewAndModel<GridPane, FiatAccou
selectionComboBox.setItems(model.getAllBankAccounts()); selectionComboBox.setItems(model.getAllBankAccounts());
} }
@Override @Override
public void setParent(Wizard parent) { public void setParent(Wizard parent) {
this.parent = parent; this.parent = parent;
@ -110,7 +105,6 @@ public class FiatAccountView extends ActivatableViewAndModel<GridPane, FiatAccou
buttonsHBox.getChildren().remove(completedButton); buttonsHBox.getChildren().remove(completedButton);
} }
@FXML @FXML
void onSelectAccount() { void onSelectAccount() {
if (selectionComboBox.getSelectionModel().getSelectedItem() != null) if (selectionComboBox.getSelectionModel().getSelectedItem() != null)
@ -259,7 +253,6 @@ public class FiatAccountView extends ActivatableViewAndModel<GridPane, FiatAccou
removeBankAccountButton.disableProperty().bind(createBooleanBinding(() -> removeBankAccountButton.disableProperty().bind(createBooleanBinding(() ->
(selectionComboBox.getSelectionModel().selectedIndexProperty().get() == -1), (selectionComboBox.getSelectionModel().selectedIndexProperty().get() == -1),
selectionComboBox.getSelectionModel().selectedIndexProperty())); selectionComboBox.getSelectionModel().selectedIndexProperty()));
} }
} }

View file

@ -36,16 +36,11 @@ import javafx.scene.control.*;
import javafx.scene.layout.*; import javafx.scene.layout.*;
import javafx.util.Callback; import javafx.util.Callback;
import org.slf4j.Logger; /**
import org.slf4j.LoggerFactory; * Just temporary for giving the user a possibility to test the app via simulating the bank transfer in a IRC chat.
/*
Just temporary for giving the user a possibility to test the app via simulating the bank transfer in a IRC chat.
*/ */
public class IrcAccountView extends ActivatableViewAndModel<GridPane, IrcAccountViewModel> implements Wizard.Step { public class IrcAccountView extends ActivatableViewAndModel<GridPane, IrcAccountViewModel> implements Wizard.Step {
private static final Logger log = LoggerFactory.getLogger(IrcAccountView.class);
@FXML HBox buttonsHBox; @FXML HBox buttonsHBox;
@FXML InputTextField ircNickNameTextField; @FXML InputTextField ircNickNameTextField;
@FXML Button saveButton; @FXML Button saveButton;
@ -54,13 +49,11 @@ public class IrcAccountView extends ActivatableViewAndModel<GridPane, IrcAccount
private Wizard parent; private Wizard parent;
@Inject @Inject
IrcAccountView(IrcAccountViewModel model) { public IrcAccountView(IrcAccountViewModel model) {
super(model); super(model);
} }
@Override @Override
public void doActivate() { public void doActivate() {
ircNickNameTextField.setValidator(model.getNickNameValidator()); ircNickNameTextField.setValidator(model.getNickNameValidator());
@ -135,7 +128,6 @@ public class IrcAccountView extends ActivatableViewAndModel<GridPane, IrcAccount
"bank transfer.")); "bank transfer."));
} }
@Override @Override
public void setParent(Wizard parent) { public void setParent(Wizard parent) {
this.parent = parent; this.parent = parent;
@ -145,8 +137,6 @@ public class IrcAccountView extends ActivatableViewAndModel<GridPane, IrcAccount
public void hideWizardNavigation() { public void hideWizardNavigation() {
} }
@FXML @FXML
void onSelectType() { void onSelectType() {
model.setType(typesComboBox.getSelectionModel().getSelectedItem()); model.setType(typesComboBox.getSelectionModel().getSelectedItem());
@ -179,7 +169,6 @@ public class IrcAccountView extends ActivatableViewAndModel<GridPane, IrcAccount
} }
} }
private void setupListeners() { private void setupListeners() {
model.type.addListener((ov, oldValue, newValue) -> { model.type.addListener((ov, oldValue, newValue) -> {
if (newValue != null) if (newValue != null)
@ -201,7 +190,5 @@ public class IrcAccountView extends ActivatableViewAndModel<GridPane, IrcAccount
ircNickNameTextField.textProperty().bindBidirectional(model.ircNickName); ircNickNameTextField.textProperty().bindBidirectional(model.ircNickName);
saveButton.disableProperty().bind(model.saveButtonDisable); saveButton.disableProperty().bind(model.saveButtonDisable);
} }
} }

View file

@ -28,28 +28,19 @@ import javafx.fxml.FXML;
import javafx.scene.control.*; import javafx.scene.control.*;
import javafx.scene.layout.*; import javafx.scene.layout.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class PasswordView extends InitializableView<GridPane, PasswordViewModel> implements Wizard.Step { public class PasswordView extends InitializableView<GridPane, PasswordViewModel> implements Wizard.Step {
private static final Logger log = LoggerFactory.getLogger(PasswordView.class);
@FXML HBox buttonsHBox; @FXML HBox buttonsHBox;
@FXML Button saveButton, skipButton; @FXML Button saveButton, skipButton;
@FXML PasswordField oldPasswordField, passwordField, repeatedPasswordField; @FXML PasswordField oldPasswordField, passwordField, repeatedPasswordField;
private Wizard parent; private Wizard parent;
@Inject @Inject
private PasswordView(PasswordViewModel model) { private PasswordView(PasswordViewModel model) {
super(model); super(model);
} }
@Override @Override
public void initialize() { public void initialize() {
passwordField.textProperty().bindBidirectional(model.passwordField); passwordField.textProperty().bindBidirectional(model.passwordField);
@ -58,8 +49,6 @@ public class PasswordView extends InitializableView<GridPane, PasswordViewModel>
saveButton.disableProperty().bind(model.saveButtonDisabled); saveButton.disableProperty().bind(model.saveButtonDisabled);
} }
@Override @Override
public void setParent(Wizard parent) { public void setParent(Wizard parent) {
this.parent = parent; this.parent = parent;
@ -70,15 +59,12 @@ public class PasswordView extends InitializableView<GridPane, PasswordViewModel>
buttonsHBox.getChildren().remove(skipButton); buttonsHBox.getChildren().remove(skipButton);
} }
@FXML @FXML
private void onSaved() { private void onSaved() {
if (model.requestSavePassword()) if (model.requestSavePassword())
parent.nextStep(this); parent.nextStep(this);
else else
// TODO use validating passwordTF log.debug(model.getErrorMessage()); // TODO use validating passwordTF
log.debug(model.getErrorMessage());
} }
@FXML @FXML

View file

@ -43,8 +43,6 @@ import org.controlsfx.dialog.Dialog;
public class RegistrationView extends InitializableView<GridPane, RegistrationViewModel> implements Wizard.Step { public class RegistrationView extends InitializableView<GridPane, RegistrationViewModel> implements Wizard.Step {
private final OverlayManager overlayManager;
@FXML TextField feeTextField; @FXML TextField feeTextField;
@FXML AddressTextField addressTextField; @FXML AddressTextField addressTextField;
@FXML BalanceTextField balanceTextField; @FXML BalanceTextField balanceTextField;
@ -54,7 +52,7 @@ public class RegistrationView extends InitializableView<GridPane, RegistrationVi
private Wizard parent; private Wizard parent;
private final OverlayManager overlayManager;
@Inject @Inject
private RegistrationView(RegistrationViewModel model, OverlayManager overlayManager) { private RegistrationView(RegistrationViewModel model, OverlayManager overlayManager) {
@ -62,8 +60,6 @@ public class RegistrationView extends InitializableView<GridPane, RegistrationVi
this.overlayManager = overlayManager; this.overlayManager = overlayManager;
} }
@Override @Override
public void initialize() { public void initialize() {
feeTextField.setText(model.getFeeAsString()); feeTextField.setText(model.getFeeAsString());
@ -128,7 +124,6 @@ public class RegistrationView extends InitializableView<GridPane, RegistrationVi
}); });
} }
@Override @Override
public void setParent(Wizard parent) { public void setParent(Wizard parent) {
this.parent = parent; this.parent = parent;
@ -138,8 +133,6 @@ public class RegistrationView extends InitializableView<GridPane, RegistrationVi
public void hideWizardNavigation() { public void hideWizardNavigation() {
} }
@FXML @FXML
private void onPayFee() { private void onPayFee() {
model.payFee(); model.payFee();
@ -149,8 +142,5 @@ public class RegistrationView extends InitializableView<GridPane, RegistrationVi
private void onOpenHelp() { private void onOpenHelp() {
Help.openWindow(HelpId.PAY_ACCOUNT_FEE); Help.openWindow(HelpId.PAY_ACCOUNT_FEE);
} }
} }

View file

@ -53,12 +53,10 @@ public class RestrictionsView extends ActivatableViewAndModel<GridPane, Restrict
@FXML ComboBox<Country> countryComboBox; @FXML ComboBox<Country> countryComboBox;
@FXML Button completedButton, addAllEuroCountriesButton; @FXML Button completedButton, addAllEuroCountriesButton;
private final ViewLoader viewLoader;
private final Stage primaryStage;
private Wizard parent; private Wizard parent;
private final ViewLoader viewLoader;
private final Stage primaryStage;
@Inject @Inject
private RestrictionsView(RestrictionsViewModel model, ViewLoader viewLoader, Stage primaryStage) { private RestrictionsView(RestrictionsViewModel model, ViewLoader viewLoader, Stage primaryStage) {
@ -67,8 +65,6 @@ public class RestrictionsView extends ActivatableViewAndModel<GridPane, Restrict
this.primaryStage = primaryStage; this.primaryStage = primaryStage;
} }
@Override @Override
public void initialize() { public void initialize() {
initLanguage(); initLanguage();
@ -85,7 +81,6 @@ public class RestrictionsView extends ActivatableViewAndModel<GridPane, Restrict
arbitratorsListView.setItems(model.getArbitratorList()); arbitratorsListView.setItems(model.getArbitratorList());
} }
@Override @Override
public void setParent(Wizard parent) { public void setParent(Wizard parent) {
this.parent = parent; this.parent = parent;
@ -96,8 +91,6 @@ public class RestrictionsView extends ActivatableViewAndModel<GridPane, Restrict
root.getChildren().remove(completedButton); root.getChildren().remove(completedButton);
} }
@FXML @FXML
private void onAddLanguage() { private void onAddLanguage() {
model.addLanguage(languageComboBox.getSelectionModel().getSelectedItem()); model.addLanguage(languageComboBox.getSelectionModel().getSelectedItem());
@ -151,8 +144,6 @@ public class RestrictionsView extends ActivatableViewAndModel<GridPane, Restrict
Help.openWindow(HelpId.SETUP_RESTRICTION_ARBITRATORS); Help.openWindow(HelpId.SETUP_RESTRICTION_ARBITRATORS);
} }
@Override @Override
protected View loadView(Navigation.Item navigationItem) { protected View loadView(Navigation.Item navigationItem) {
ViewLoader.Item loaded = viewLoader.load(navigationItem.getFxmlUrl(), false); ViewLoader.Item loaded = viewLoader.load(navigationItem.getFxmlUrl(), false);
@ -178,8 +169,6 @@ public class RestrictionsView extends ActivatableViewAndModel<GridPane, Restrict
return (View) loaded.controller; return (View) loaded.controller;
} }
void updateArbitratorList() { void updateArbitratorList() {
model.updateArbitratorList(); model.updateArbitratorList();
arbitratorsListView.setItems(model.getArbitratorList()); arbitratorsListView.setItems(model.getArbitratorList());
@ -333,23 +322,5 @@ public class RestrictionsView extends ActivatableViewAndModel<GridPane, Restrict
private void removeArbitrator(Arbitrator arbitrator) { private void removeArbitrator(Arbitrator arbitrator) {
model.removeArbitrator(arbitrator); model.removeArbitrator(arbitrator);
} }
/* private void addCountry(Country country) {
if (!countryList.contains(country) && country != null) {
countryList.add(country);
settings.addAcceptedCountry(country);
saveSettings();
}
}*/
/* private void addLanguage(Locale locale) {
if (locale != null && !languageList.contains(locale)) {
languageList.add(locale);
settings.addAcceptedLanguageLocale(locale);
}
}*/
} }

View file

@ -30,20 +30,16 @@ import javafx.scene.layout.*;
public class SeedWordsView extends InitializableView<GridPane, SeedWordsViewModel> implements Wizard.Step { public class SeedWordsView extends InitializableView<GridPane, SeedWordsViewModel> implements Wizard.Step {
private Wizard parent;
@FXML Button completedButton; @FXML Button completedButton;
@FXML TextArea seedWordsTextArea; @FXML TextArea seedWordsTextArea;
private Wizard parent;
@Inject @Inject
private SeedWordsView(SeedWordsViewModel model) { private SeedWordsView(SeedWordsViewModel model) {
super(model); super(model);
} }
@Override @Override
public void initialize() { public void initialize() {
seedWordsTextArea.setText(model.seedWords.get()); seedWordsTextArea.setText(model.seedWords.get());
@ -59,8 +55,6 @@ public class SeedWordsView extends InitializableView<GridPane, SeedWordsViewMode
root.getChildren().remove(completedButton); root.getChildren().remove(completedButton);
} }
@FXML @FXML
private void onCompleted() { private void onCompleted() {
parent.nextStep(this); parent.nextStep(this);

View file

@ -46,16 +46,12 @@ public class AccountSettingsView extends ActivatableViewAndModel {
@FXML private VBox leftVBox; @FXML private VBox leftVBox;
@FXML private AnchorPane content; @FXML private AnchorPane content;
@Inject @Inject
private AccountSettingsView(ViewLoader viewLoader, Navigation navigation) { private AccountSettingsView(ViewLoader viewLoader, Navigation navigation) {
this.viewLoader = viewLoader; this.viewLoader = viewLoader;
this.navigation = navigation; this.navigation = navigation;
} }
@Override @Override
public void initialize() { public void initialize() {
listener = navigationItems -> { listener = navigationItems -> {
@ -111,8 +107,6 @@ public class AccountSettingsView extends ActivatableViewAndModel {
navigation.removeListener(listener); navigation.removeListener(listener);
} }
@Override @Override
protected View loadView(Navigation.Item navigationItem) { protected View loadView(Navigation.Item navigationItem) {
ViewLoader.Item loaded = viewLoader.load(navigationItem.getFxmlUrl()); ViewLoader.Item loaded = viewLoader.load(navigationItem.getFxmlUrl());
@ -123,8 +117,6 @@ public class AccountSettingsView extends ActivatableViewAndModel {
return child; return child;
} }
private void selectMainMenuButton(Navigation.Item item) { private void selectMainMenuButton(Navigation.Item item) {
switch (item) { switch (item) {
case SEED_WORDS: case SEED_WORDS:
@ -149,6 +141,7 @@ public class AccountSettingsView extends ActivatableViewAndModel {
} }
} }
class MenuItem extends ToggleButton { class MenuItem extends ToggleButton {
MenuItem(Navigation navigation, String title, Navigation.Item navigationItem, MenuItem(Navigation navigation, String title, Navigation.Item navigationItem,

View file

@ -36,30 +36,23 @@ import javafx.scene.control.*;
import javafx.scene.image.*; import javafx.scene.image.*;
import javafx.scene.layout.*; import javafx.scene.layout.*;
/**
* This UI is not cached as it is normally only needed once.
*/
public class AccountSetupWizard extends ActivatableView implements Wizard { public class AccountSetupWizard extends ActivatableView implements Wizard {
private WizardItem seedWords, password, fiatAccount, restrictions, registration;
private Navigation.Listener listener;
@FXML VBox leftVBox; @FXML VBox leftVBox;
@FXML AnchorPane content; @FXML AnchorPane content;
private WizardItem seedWords, password, fiatAccount, restrictions, registration;
private Navigation.Listener listener;
private final ViewLoader viewLoader; private final ViewLoader viewLoader;
private final Navigation navigation; private final Navigation navigation;
@Inject @Inject
private AccountSetupWizard(ViewLoader viewLoader, Navigation navigation) { private AccountSetupWizard(ViewLoader viewLoader, Navigation navigation) {
this.viewLoader = viewLoader; this.viewLoader = viewLoader;
this.navigation = navigation; this.navigation = navigation;
} }
@Override @Override
public void initialize() { public void initialize() {
listener = navigationItems -> { listener = navigationItems -> {
@ -130,7 +123,6 @@ public class AccountSetupWizard extends ActivatableView implements Wizard {
navigation.removeListener(listener); navigation.removeListener(listener);
} }
@Override @Override
public void nextStep(Step currentStep) { public void nextStep(Step currentStep) {
if (currentStep instanceof SeedWordsView) { if (currentStep instanceof SeedWordsView) {
@ -159,8 +151,6 @@ public class AccountSetupWizard extends ActivatableView implements Wizard {
} }
} }
@Override @Override
protected View loadView(Navigation.Item navigationItem) { protected View loadView(Navigation.Item navigationItem) {
ViewLoader.Item loaded = viewLoader.load(navigationItem.getFxmlUrl()); ViewLoader.Item loaded = viewLoader.load(navigationItem.getFxmlUrl());
@ -172,6 +162,7 @@ public class AccountSetupWizard extends ActivatableView implements Wizard {
} }
} }
class WizardItem extends HBox { class WizardItem extends HBox {
private final ImageView imageView; private final ImageView imageView;

View file

@ -31,25 +31,21 @@ import javafx.scene.control.*;
public class FundsView extends ActivatableViewAndModel<TabPane, Activatable> { public class FundsView extends ActivatableViewAndModel<TabPane, Activatable> {
@FXML Tab withdrawalTab, transactionsTab;
private Navigation.Listener navigationListener; private Navigation.Listener navigationListener;
private ChangeListener<Tab> tabChangeListener; private ChangeListener<Tab> tabChangeListener;
private Tab currentTab; private Tab currentTab;
@FXML Tab withdrawalTab, transactionsTab;
private final ViewLoader viewLoader; private final ViewLoader viewLoader;
private final Navigation navigation; private final Navigation navigation;
@Inject @Inject
FundsView(ViewLoader viewLoader, Navigation navigation) { FundsView(ViewLoader viewLoader, Navigation navigation) {
this.viewLoader = viewLoader; this.viewLoader = viewLoader;
this.navigation = navigation; this.navigation = navigation;
} }
@Override @Override
public void initialize() { public void initialize() {
navigationListener = navigationItems -> { navigationListener = navigationItems -> {
@ -83,8 +79,6 @@ public class FundsView extends ActivatableViewAndModel<TabPane, Activatable> {
navigation.removeListener(navigationListener); navigation.removeListener(navigationListener);
} }
@Override @Override
protected View loadView(Navigation.Item navigationItem) { protected View loadView(Navigation.Item navigationItem) {
// we want to get activate/deactivate called, so we remove the old view on tab change // we want to get activate/deactivate called, so we remove the old view on tab change
@ -104,6 +98,5 @@ public class FundsView extends ActivatableViewAndModel<TabPane, Activatable> {
root.getSelectionModel().select(currentTab); root.getSelectionModel().select(currentTab);
return (View) loaded.controller; return (View) loaded.controller;
} }
} }

View file

@ -38,15 +38,14 @@ import javafx.util.Callback;
public class TransactionsView extends ActivatableViewAndModel { public class TransactionsView extends ActivatableViewAndModel {
private final WalletService walletService;
private final BSFormatter formatter;
private ObservableList<TransactionsListItem> transactionsListItems;
@FXML TableView<TransactionsListItem> table; @FXML TableView<TransactionsListItem> table;
@FXML TableColumn<TransactionsListItem, TransactionsListItem> dateColumn, addressColumn, amountColumn, typeColumn, @FXML TableColumn<TransactionsListItem, TransactionsListItem> dateColumn, addressColumn, amountColumn, typeColumn,
confidenceColumn; confidenceColumn;
private ObservableList<TransactionsListItem> transactionsListItems;
private final WalletService walletService;
private final BSFormatter formatter;
@Inject @Inject
private TransactionsView(WalletService walletService, BSFormatter formatter) { private TransactionsView(WalletService walletService, BSFormatter formatter) {
@ -54,8 +53,6 @@ public class TransactionsView extends ActivatableViewAndModel {
this.formatter = formatter; this.formatter = formatter;
} }
@Override @Override
public void initialize() { public void initialize() {
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
@ -81,10 +78,6 @@ public class TransactionsView extends ActivatableViewAndModel {
transactionsListItem.cleanup(); transactionsListItem.cleanup();
} }
private void openTxDetails(TransactionsListItem item) { private void openTxDetails(TransactionsListItem item) {
// TODO Open popup with details view // TODO Open popup with details view
log.debug("openTxDetails " + item); log.debug("openTxDetails " + item);
@ -93,8 +86,6 @@ public class TransactionsView extends ActivatableViewAndModel {
"This will open a details popup but that is not implemented yet."); "This will open a details popup but that is not implemented yet.");
} }
private void setAddressColumnCellFactory() { private void setAddressColumnCellFactory() {
addressColumn.setCellValueFactory((addressListItem) -> new ReadOnlyObjectWrapper<>(addressListItem.getValue())); addressColumn.setCellValueFactory((addressListItem) -> new ReadOnlyObjectWrapper<>(addressListItem.getValue()));
addressColumn.setCellFactory( addressColumn.setCellFactory(
@ -154,6 +145,5 @@ public class TransactionsView extends ActivatableViewAndModel {
} }
}); });
} }
} }

View file

@ -55,18 +55,16 @@ import org.jetbrains.annotations.NotNull;
public class WithdrawalView extends ActivatableViewAndModel { public class WithdrawalView extends ActivatableViewAndModel {
@FXML TableView<WithdrawalListItem> table;
@FXML Button addNewAddressButton;
@FXML TextField withdrawFromTextField, withdrawToTextField, amountTextField;
@FXML TableColumn<WithdrawalListItem, WithdrawalListItem> labelColumn, addressColumn, balanceColumn, copyColumn,
confidenceColumn;
private final WalletService walletService; private final WalletService walletService;
private final BSFormatter formatter; private final BSFormatter formatter;
private final ObservableList<WithdrawalListItem> addressList = FXCollections.observableArrayList(); private final ObservableList<WithdrawalListItem> addressList = FXCollections.observableArrayList();
@FXML TableView<WithdrawalListItem> table;
@FXML TableColumn<WithdrawalListItem, WithdrawalListItem> labelColumn, addressColumn, balanceColumn, copyColumn,
confidenceColumn;
@FXML Button addNewAddressButton;
@FXML TextField withdrawFromTextField, withdrawToTextField, amountTextField;
@Inject @Inject
private WithdrawalView(WalletService walletService, BSFormatter formatter) { private WithdrawalView(WalletService walletService, BSFormatter formatter) {
this.walletService = walletService; this.walletService = walletService;
@ -120,8 +118,6 @@ public class WithdrawalView extends ActivatableViewAndModel {
item.cleanup(); item.cleanup();
} }
@FXML @FXML
public void onWithdraw() { public void onWithdraw() {
Coin amount = formatter.parseToCoin(amountTextField.getText()); Coin amount = formatter.parseToCoin(amountTextField.getText());
@ -178,8 +174,6 @@ public class WithdrawalView extends ActivatableViewAndModel {
} }
private void fillList() { private void fillList() {
addressList.clear(); addressList.clear();
List<AddressEntry> addressEntryList = walletService.getAddressEntryList(); List<AddressEntry> addressEntryList = walletService.getAddressEntryList();
@ -189,7 +183,6 @@ public class WithdrawalView extends ActivatableViewAndModel {
.collect(Collectors.toList())); .collect(Collectors.toList()));
} }
private void setLabelColumnCellFactory() { private void setLabelColumnCellFactory() {
labelColumn.setCellValueFactory((addressListItem) -> new ReadOnlyObjectWrapper<>(addressListItem.getValue())); labelColumn.setCellValueFactory((addressListItem) -> new ReadOnlyObjectWrapper<>(addressListItem.getValue()));
labelColumn.setCellFactory(new Callback<TableColumn<WithdrawalListItem, WithdrawalListItem>, labelColumn.setCellFactory(new Callback<TableColumn<WithdrawalListItem, WithdrawalListItem>,

View file

@ -23,18 +23,5 @@ import javax.inject.Inject;
// will be probably only used for arbitration communication, will be renamed and the icon changed // will be probably only used for arbitration communication, will be renamed and the icon changed
public class MsgView extends AbstractView { public class MsgView extends AbstractView {
@Inject
private MsgView() {
}
} }

View file

@ -32,27 +32,23 @@ import javafx.scene.control.*;
public class PortfolioView extends ActivatableViewAndModel<TabPane, Activatable> { public class PortfolioView extends ActivatableViewAndModel<TabPane, Activatable> {
@FXML Tab offersTab, openTradesTab, closedTradesTab;
private Tab currentTab; private Tab currentTab;
private Navigation.Listener navigationListener; private Navigation.Listener navigationListener;
private ChangeListener<Tab> tabChangeListener; private ChangeListener<Tab> tabChangeListener;
@FXML Tab offersTab, openTradesTab, closedTradesTab;
private final ViewLoader viewLoader; private final ViewLoader viewLoader;
private final Navigation navigation; private final Navigation navigation;
private final TradeManager tradeManager; private final TradeManager tradeManager;
@Inject @Inject
PortfolioView(ViewLoader viewLoader, Navigation navigation, TradeManager tradeManager) { public PortfolioView(ViewLoader viewLoader, Navigation navigation, TradeManager tradeManager) {
this.viewLoader = viewLoader; this.viewLoader = viewLoader;
this.navigation = navigation; this.navigation = navigation;
this.tradeManager = tradeManager; this.tradeManager = tradeManager;
} }
@Override @Override
public void initialize() { public void initialize() {
navigationListener = navigationItems -> { navigationListener = navigationItems -> {
@ -90,8 +86,6 @@ public class PortfolioView extends ActivatableViewAndModel<TabPane, Activatable>
currentTab = null; currentTab = null;
} }
@Override @Override
protected View loadView(Navigation.Item navigationItem) { protected View loadView(Navigation.Item navigationItem) {

View file

@ -30,19 +30,15 @@ import javafx.util.Callback;
public class ClosedTradesView extends ActivatableViewAndModel<GridPane, ClosedTradesViewModel> { public class ClosedTradesView extends ActivatableViewAndModel<GridPane, ClosedTradesViewModel> {
@FXML TableView<ClosedTradesListItem> table;
@FXML TableColumn<ClosedTradesListItem, ClosedTradesListItem> priceColumn, amountColumn, volumeColumn, @FXML TableColumn<ClosedTradesListItem, ClosedTradesListItem> priceColumn, amountColumn, volumeColumn,
directionColumn, dateColumn, tradeIdColumn; directionColumn, dateColumn, tradeIdColumn;
@FXML TableView<ClosedTradesListItem> table;
@Inject @Inject
private ClosedTradesView(ClosedTradesViewModel model) { public ClosedTradesView(ClosedTradesViewModel model) {
super(model); super(model);
} }
@Override @Override
public void initialize() { public void initialize() {
setTradeIdColumnCellFactory(); setTradeIdColumnCellFactory();
@ -61,8 +57,6 @@ public class ClosedTradesView extends ActivatableViewAndModel<GridPane, ClosedTr
table.setItems(model.getList()); table.setItems(model.getList());
} }
private void openOfferDetails(ClosedTradesListItem item) { private void openOfferDetails(ClosedTradesListItem item) {
// TODO Open popup with details view // TODO Open popup with details view
log.debug("Trade details " + item); log.debug("Trade details " + item);
@ -70,8 +64,6 @@ public class ClosedTradesView extends ActivatableViewAndModel<GridPane, ClosedTr
"popup but that is not implemented yet."); "popup but that is not implemented yet.");
} }
private void setTradeIdColumnCellFactory() { private void setTradeIdColumnCellFactory() {
tradeIdColumn.setCellValueFactory((offerListItem) -> new ReadOnlyObjectWrapper<>(offerListItem.getValue())); tradeIdColumn.setCellValueFactory((offerListItem) -> new ReadOnlyObjectWrapper<>(offerListItem.getValue()));
tradeIdColumn.setCellFactory( tradeIdColumn.setCellFactory(

View file

@ -32,19 +32,15 @@ import javafx.util.Callback;
public class OffersView extends ActivatableViewAndModel<GridPane, OffersViewModel> { public class OffersView extends ActivatableViewAndModel<GridPane, OffersViewModel> {
@FXML TableView<OfferListItem> table;
@FXML TableColumn<OfferListItem, OfferListItem> priceColumn, amountColumn, volumeColumn, @FXML TableColumn<OfferListItem, OfferListItem> priceColumn, amountColumn, volumeColumn,
directionColumn, dateColumn, offerIdColumn, removeItemColumn; directionColumn, dateColumn, offerIdColumn, removeItemColumn;
@FXML TableView<OfferListItem> table;
@Inject @Inject
private OffersView(OffersViewModel model) { public OffersView(OffersViewModel model) {
super(model); super(model);
} }
@Override @Override
public void initialize() { public void initialize() {
setOfferIdColumnCellFactory(); setOfferIdColumnCellFactory();
@ -64,7 +60,6 @@ public class OffersView extends ActivatableViewAndModel<GridPane, OffersViewMode
table.setItems(model.getList()); table.setItems(model.getList());
} }
private void removeOffer(OfferListItem item) { private void removeOffer(OfferListItem item) {
model.removeOffer(item); model.removeOffer(item);
} }
@ -79,8 +74,6 @@ public class OffersView extends ActivatableViewAndModel<GridPane, OffersViewMode
"Later this will open a details popup but that is not implemented yet."); "Later this will open a details popup but that is not implemented yet.");
} }
private void setOfferIdColumnCellFactory() { private void setOfferIdColumnCellFactory() {
offerIdColumn.setCellValueFactory((offerListItem) -> new ReadOnlyObjectWrapper<>(offerListItem.getValue())); offerIdColumn.setCellValueFactory((offerListItem) -> new ReadOnlyObjectWrapper<>(offerListItem.getValue()));
offerIdColumn.setCellFactory( offerIdColumn.setCellFactory(
@ -135,7 +128,6 @@ public class OffersView extends ActivatableViewAndModel<GridPane, OffersViewMode
}); });
} }
private void setAmountColumnCellFactory() { private void setAmountColumnCellFactory() {
amountColumn.setCellValueFactory((offer) -> new ReadOnlyObjectWrapper<>(offer.getValue())); amountColumn.setCellValueFactory((offer) -> new ReadOnlyObjectWrapper<>(offer.getValue()));
amountColumn.setCellFactory( amountColumn.setCellFactory(
@ -215,7 +207,6 @@ public class OffersView extends ActivatableViewAndModel<GridPane, OffersViewMode
}); });
} }
private void setRemoveColumnCellFactory() { private void setRemoveColumnCellFactory() {
removeItemColumn.setCellValueFactory((offerListItem) -> new ReadOnlyObjectWrapper<>(offerListItem.getValue())); removeItemColumn.setCellValueFactory((offerListItem) -> new ReadOnlyObjectWrapper<>(offerListItem.getValue()));
removeItemColumn.setCellFactory( removeItemColumn.setCellFactory(

View file

@ -54,29 +54,21 @@ import javafx.util.StringConverter;
public class PendingTradesView extends ActivatableViewAndModel<AnchorPane, PendingTradesViewModel> { public class PendingTradesView extends ActivatableViewAndModel<AnchorPane, PendingTradesViewModel> {
private ChangeListener<PendingTradesListItem> selectedItemChangeListener;
private ListChangeListener<PendingTradesListItem> listChangeListener;
private ChangeListener<String> txIdChangeListener;
private ChangeListener<PendingTradesViewModel.State> offererStateChangeListener;
private ChangeListener<PendingTradesViewModel.State> takerStateChangeListener;
private ChangeListener<Throwable> faultChangeListener;
private final Navigation navigation;
@FXML ScrollPane scrollPane;
@FXML GridPane gridPane; @FXML GridPane gridPane;
@FXML TitledGroupBg titledGroupBg, paymentsGroupBg, summaryGroupBg, withdrawGroupBg; @FXML ScrollPane scrollPane;
@FXML ProcessStepBar processBar; @FXML ProcessStepBar processBar;
@FXML TxIdTextField txIdTextField;
@FXML TableView<PendingTradesListItem> table;
@FXML InputTextField withdrawAddressTextField;
@FXML InfoDisplay infoDisplay, paymentsInfoDisplay, summaryInfoDisplay;
@FXML Button confirmPaymentReceiptButton, paymentsButton, withdrawButton;
@FXML TitledGroupBg titledGroupBg, paymentsGroupBg, summaryGroupBg, withdrawGroupBg;
@FXML TextFieldWithCopyIcon fiatAmountTextField, holderNameTextField, secondaryIdTextField, primaryIdTextField;
@FXML TextField statusTextField, paymentMethodTextField, btcTradeAmountTextField, fiatTradeAmountTextField,
feesTextField, securityDepositTextField, withdrawAmountTextField;
@FXML Label statusLabel, txIdLabel, paymentMethodLabel, fiatAmountLabel, holderNameLabel, primaryIdLabel, @FXML Label statusLabel, txIdLabel, paymentMethodLabel, fiatAmountLabel, holderNameLabel, primaryIdLabel,
secondaryIdLabel, btcTradeAmountLabel, fiatTradeAmountLabel, feesLabel, securityDepositLabel, secondaryIdLabel, btcTradeAmountLabel, fiatTradeAmountLabel, feesLabel, securityDepositLabel,
withdrawAmountLabel, withdrawAddressLabel; withdrawAmountLabel, withdrawAddressLabel;
@FXML TextField statusTextField, paymentMethodTextField, btcTradeAmountTextField, fiatTradeAmountTextField,
feesTextField, securityDepositTextField, withdrawAmountTextField;
@FXML InputTextField withdrawAddressTextField;
@FXML TxIdTextField txIdTextField;
@FXML InfoDisplay infoDisplay, paymentsInfoDisplay, summaryInfoDisplay;
@FXML Button confirmPaymentReceiptButton, paymentsButton, withdrawButton;
@FXML TextFieldWithCopyIcon fiatAmountTextField, holderNameTextField, secondaryIdTextField, primaryIdTextField;
@FXML TableView<PendingTradesListItem> table;
@FXML TableColumn<PendingTradesListItem, Fiat> priceColumn; @FXML TableColumn<PendingTradesListItem, Fiat> priceColumn;
@FXML TableColumn<PendingTradesListItem, Fiat> tradeVolumeColumn; @FXML TableColumn<PendingTradesListItem, Fiat> tradeVolumeColumn;
@ -85,17 +77,22 @@ public class PendingTradesView extends ActivatableViewAndModel<AnchorPane, Pendi
@FXML TableColumn<PendingTradesListItem, Date> dateColumn; @FXML TableColumn<PendingTradesListItem, Date> dateColumn;
@FXML TableColumn<PendingTradesListItem, Coin> tradeAmountColumn; @FXML TableColumn<PendingTradesListItem, Coin> tradeAmountColumn;
private ChangeListener<PendingTradesListItem> selectedItemChangeListener;
private ListChangeListener<PendingTradesListItem> listChangeListener;
private ChangeListener<String> txIdChangeListener;
private ChangeListener<PendingTradesViewModel.State> offererStateChangeListener;
private ChangeListener<PendingTradesViewModel.State> takerStateChangeListener;
private ChangeListener<Throwable> faultChangeListener;
private final Navigation navigation;
@Inject @Inject
PendingTradesView(PendingTradesViewModel model, Navigation navigation) { public PendingTradesView(PendingTradesViewModel model, Navigation navigation) {
super(model); super(model);
this.navigation = navigation; this.navigation = navigation;
} }
@Override @Override
public void initialize() { public void initialize() {
setTradeIdColumnCellFactory(); setTradeIdColumnCellFactory();
@ -167,8 +164,6 @@ public class PendingTradesView extends ActivatableViewAndModel<AnchorPane, Pendi
model.state.removeListener(takerStateChangeListener); model.state.removeListener(takerStateChangeListener);
} }
@FXML @FXML
void onPaymentStarted() { void onPaymentStarted() {
model.fiatPaymentStarted(); model.fiatPaymentStarted();
@ -342,7 +337,6 @@ public class PendingTradesView extends ActivatableViewAndModel<AnchorPane, Pendi
} }
} }
private void applyTakerState(PendingTradesViewModel.State state) { private void applyTakerState(PendingTradesViewModel.State state) {
confirmPaymentReceiptButton.setVisible(false); confirmPaymentReceiptButton.setVisible(false);
confirmPaymentReceiptButton.setManaged(false); confirmPaymentReceiptButton.setManaged(false);
@ -507,8 +501,6 @@ public class PendingTradesView extends ActivatableViewAndModel<AnchorPane, Pendi
Platform.runLater(() -> scrollPane.setVvalue(visible ? scrollPane.getVmax() : 0)); Platform.runLater(() -> scrollPane.setVvalue(visible ? scrollPane.getVmax() : 0));
} }
private void setTradeIdColumnCellFactory() { private void setTradeIdColumnCellFactory() {
idColumn.setCellFactory( idColumn.setCellFactory(
new Callback<TableColumn<PendingTradesListItem, String>, TableCell<PendingTradesListItem, String>>() { new Callback<TableColumn<PendingTradesListItem, String>, TableCell<PendingTradesListItem, String>>() {
@ -540,7 +532,6 @@ public class PendingTradesView extends ActivatableViewAndModel<AnchorPane, Pendi
}); });
} }
private void setDateColumnCellFactory() { private void setDateColumnCellFactory() {
dateColumn.setCellFactory(TextFieldTableCell.<PendingTradesListItem, Date>forTableColumn( dateColumn.setCellFactory(TextFieldTableCell.<PendingTradesListItem, Date>forTableColumn(
new StringConverter<Date>() { new StringConverter<Date>() {

View file

@ -32,26 +32,22 @@ import javafx.scene.control.*;
public class SettingsView extends ActivatableViewAndModel<TabPane, Activatable> { public class SettingsView extends ActivatableViewAndModel<TabPane, Activatable> {
private final ViewLoader viewLoader; @FXML Tab preferencesTab, networkSettingsTab;
private final Navigation navigation;
private Preferences preferences;
private Preferences preferences;
private Navigation.Listener navigationListener; private Navigation.Listener navigationListener;
private ChangeListener<Tab> tabChangeListener; private ChangeListener<Tab> tabChangeListener;
@FXML Tab preferencesTab, networkSettingsTab; private final ViewLoader viewLoader;
private final Navigation navigation;
@Inject @Inject
SettingsView(ViewLoader viewLoader, Navigation navigation, Preferences preferences) { public SettingsView(ViewLoader viewLoader, Navigation navigation, Preferences preferences) {
this.viewLoader = viewLoader; this.viewLoader = viewLoader;
this.navigation = navigation; this.navigation = navigation;
this.preferences = preferences; this.preferences = preferences;
} }
@Override @Override
public void initialize() { public void initialize() {
navigationListener = navigationItems -> { navigationListener = navigationItems -> {
@ -91,8 +87,6 @@ public class SettingsView extends ActivatableViewAndModel<TabPane, Activatable>
navigation.removeListener(navigationListener); navigation.removeListener(navigationListener);
} }
@Override @Override
protected View loadView(Navigation.Item navigationItem) { protected View loadView(Navigation.Item navigationItem) {
ViewLoader.Item loaded = viewLoader.load(navigationItem.getFxmlUrl()); ViewLoader.Item loaded = viewLoader.load(navigationItem.getFxmlUrl());
@ -111,6 +105,5 @@ public class SettingsView extends ActivatableViewAndModel<TabPane, Activatable>
root.getSelectionModel().select(tab); root.getSelectionModel().select(tab);
return (View) loaded.controller; return (View) loaded.controller;
} }
} }

View file

@ -25,23 +25,16 @@ import javafx.fxml.FXML;
import javafx.scene.control.*; import javafx.scene.control.*;
import javafx.scene.layout.*; import javafx.scene.layout.*;
/**
* This UI is not cached as it is normally only needed once.
*/
public class PreferencesView extends ActivatableViewAndModel<GridPane, PreferencesViewModel> { public class PreferencesView extends ActivatableViewAndModel<GridPane, PreferencesViewModel> {
@FXML ComboBox<String> btcDenominationComboBox; @FXML ComboBox<String> btcDenominationComboBox;
@FXML CheckBox useAnimationsCheckBox, useEffectsCheckBox; @FXML CheckBox useAnimationsCheckBox, useEffectsCheckBox;
@Inject @Inject
private PreferencesView(PreferencesViewModel model) { public PreferencesView(PreferencesViewModel model) {
super(model); super(model);
} }
@Override @Override
public void doActivate() { public void doActivate() {
btcDenominationComboBox.setItems(model.getBtcDenominationItems()); btcDenominationComboBox.setItems(model.getBtcDenominationItems());
@ -58,8 +51,6 @@ public class PreferencesView extends ActivatableViewAndModel<GridPane, Preferenc
useEffectsCheckBox.selectedProperty().unbind(); useEffectsCheckBox.selectedProperty().unbind();
} }
@FXML @FXML
void onSelectBtcDenomination() { void onSelectBtcDenomination() {
model.btcDenomination().set(btcDenominationComboBox.getSelectionModel().getSelectedItem()); model.btcDenomination().set(btcDenominationComboBox.getSelectionModel().getSelectedItem());

View file

@ -55,15 +55,11 @@ public class TradeView extends ActivatableView<TabPane, Void> {
private final ViewLoader viewLoader; private final ViewLoader viewLoader;
private final Navigation navigation; private final Navigation navigation;
protected TradeView(ViewLoader viewLoader, Navigation navigation) { protected TradeView(ViewLoader viewLoader, Navigation navigation) {
this.viewLoader = viewLoader; this.viewLoader = viewLoader;
this.navigation = navigation; this.navigation = navigation;
} }
@Override @Override
protected void initialize() { protected void initialize() {
direction = (this instanceof BuyView) ? Direction.BUY : Direction.SELL; direction = (this instanceof BuyView) ? Direction.BUY : Direction.SELL;
@ -121,8 +117,6 @@ public class TradeView extends ActivatableView<TabPane, Void> {
navigation.navigationTo(Navigation.Item.MAIN, navigationItem, Navigation.Item.TAKE_OFFER); navigation.navigationTo(Navigation.Item.MAIN, navigationItem, Navigation.Item.TAKE_OFFER);
} }
@Override @Override
protected View loadView(Navigation.Item navigationItem) { protected View loadView(Navigation.Item navigationItem) {
TabPane tabPane = root; TabPane tabPane = root;
@ -172,10 +166,6 @@ public class TradeView extends ActivatableView<TabPane, Void> {
return null; return null;
} }
private void onCreateOfferViewRemoved() { private void onCreateOfferViewRemoved() {
createOfferView = null; createOfferView = null;
offerBookView.enableCreateOfferButton(); offerBookView.enableCreateOfferButton();
@ -190,6 +180,5 @@ public class TradeView extends ActivatableView<TabPane, Void> {
// update the navigation state // update the navigation state
navigation.navigationTo(Navigation.Item.MAIN, navigationItem, Navigation.Item.OFFER_BOOK); navigation.navigationTo(Navigation.Item.MAIN, navigationItem, Navigation.Item.OFFER_BOOK);
} }
} }

View file

@ -67,40 +67,34 @@ import static javafx.beans.binding.Bindings.createStringBinding;
// priceAmountHBox is too large after redesign as to be used as layoutReference. // priceAmountHBox is too large after redesign as to be used as layoutReference.
public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateOfferViewModel> { public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateOfferViewModel> {
private final Navigation navigation;
private final OverlayManager overlayManager;
private BooleanProperty tabIsClosable;
private boolean detailsVisible;
private boolean advancedScreenInited;
private ImageView expand;
private ImageView collapse;
private PopOver totalToPayInfoPopover;
@FXML InfoDisplay advancedInfoDisplay, fundsBoxInfoDisplay;
@FXML ScrollPane scrollPane; @FXML ScrollPane scrollPane;
@FXML ImageView imageView; @FXML ImageView imageView;
@FXML AddressTextField addressTextField;
@FXML BalanceTextField balanceTextField;
@FXML ProgressIndicator placeOfferSpinner;
@FXML InfoDisplay advancedInfoDisplay, fundsBoxInfoDisplay;
@FXML TitledGroupBg priceAmountPane, payFundsPane, showDetailsPane; @FXML TitledGroupBg priceAmountPane, payFundsPane, showDetailsPane;
@FXML Label buyLabel, addressLabel,
balanceLabel, totalToPayLabel, totalToPayInfoIconLabel,
bankAccountTypeLabel, bankAccountCurrencyLabel, bankAccountCountyLabel,
acceptedCountriesLabel, acceptedCountriesLabelIcon, acceptedLanguagesLabel, acceptedLanguagesLabelIcon,
acceptedArbitratorsLabel, acceptedArbitratorsLabelIcon, amountBtcLabel,
priceFiatLabel, volumeFiatLabel, minAmountBtcLabel, priceDescriptionLabel, volumeDescriptionLabel,
placeOfferSpinnerInfoLabel;
@FXML Button showPaymentInfoScreenButton, showAdvancedSettingsButton, placeOfferButton; @FXML Button showPaymentInfoScreenButton, showAdvancedSettingsButton, placeOfferButton;
@FXML InputTextField amountTextField, minAmountTextField, priceTextField, volumeTextField; @FXML InputTextField amountTextField, minAmountTextField, priceTextField, volumeTextField;
@FXML TextField acceptedArbitratorsTextField, totalToPayTextField, bankAccountTypeTextField, @FXML TextField acceptedArbitratorsTextField, totalToPayTextField, bankAccountTypeTextField,
bankAccountCurrencyTextField, bankAccountCountyTextField, acceptedCountriesTextField, bankAccountCurrencyTextField, bankAccountCountyTextField, acceptedCountriesTextField,
acceptedLanguagesTextField; acceptedLanguagesTextField;
@FXML AddressTextField addressTextField; @FXML Label buyLabel, addressLabel, balanceLabel, totalToPayLabel, totalToPayInfoIconLabel, bankAccountTypeLabel,
@FXML BalanceTextField balanceTextField; bankAccountCurrencyLabel, bankAccountCountyLabel, acceptedCountriesLabel, acceptedCountriesLabelIcon,
@FXML ProgressIndicator placeOfferSpinner; acceptedLanguagesLabel, acceptedLanguagesLabelIcon, acceptedArbitratorsLabel,
acceptedArbitratorsLabelIcon, amountBtcLabel, priceFiatLabel, volumeFiatLabel, minAmountBtcLabel,
priceDescriptionLabel, volumeDescriptionLabel,
placeOfferSpinnerInfoLabel;
private ImageView expand;
private ImageView collapse;
private PopOver totalToPayInfoPopover;
private BooleanProperty tabIsClosable;
private boolean detailsVisible;
private boolean advancedScreenInited;
private final Navigation navigation;
private final OverlayManager overlayManager;
@Inject @Inject
private CreateOfferView(CreateOfferViewModel model, Navigation navigation, private CreateOfferView(CreateOfferViewModel model, Navigation navigation,
@ -110,8 +104,6 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
this.overlayManager = overlayManager; this.overlayManager = overlayManager;
} }
@Override @Override
protected void initialize() { protected void initialize() {
setupListeners(); setupListeners();
@ -126,7 +118,6 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
tabIsClosable.unbind(); tabIsClosable.unbind();
} }
public void initWithData(Direction direction, Coin amount, Fiat price) { public void initWithData(Direction direction, Coin amount, Fiat price) {
model.initWithData(direction, amount, price); model.initWithData(direction, amount, price);
@ -141,8 +132,6 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
tabIsClosable.bind(model.tabIsClosable); tabIsClosable.bind(model.tabIsClosable);
} }
@FXML @FXML
void onPlaceOffer() { void onPlaceOffer() {
model.placeOffer(); model.placeOffer();
@ -230,8 +219,6 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
Help.openWindow(HelpId.CREATE_OFFER_ADVANCED); Help.openWindow(HelpId.CREATE_OFFER_ADVANCED);
} }
private void openAccountSettings() { private void openAccountSettings() {
navigation.navigationTo(Navigation.Item.MAIN, navigation.navigationTo(Navigation.Item.MAIN,
Navigation.Item.ACCOUNT, Navigation.Item.ACCOUNT,
@ -246,8 +233,6 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
navigation.navigationTo(Navigation.Item.MAIN, Navigation.Item.PORTFOLIO, Navigation.Item.OFFERS); navigation.navigationTo(Navigation.Item.MAIN, Navigation.Item.PORTFOLIO, Navigation.Item.OFFERS);
} }
private void setupListeners() { private void setupListeners() {
scrollPane.setOnScroll(e -> InputTextField.hideErrorMessageDisplay()); scrollPane.setOnScroll(e -> InputTextField.hideErrorMessageDisplay());

View file

@ -53,36 +53,31 @@ import org.controlsfx.dialog.Dialog;
import static javafx.beans.binding.Bindings.createStringBinding; import static javafx.beans.binding.Bindings.createStringBinding;
/** public class OfferBookView extends ActivatableViewAndModel<GridPane, OfferBookViewModel>
* TODO: The advanced filters are not impl. yet implements ChildView<TradeView> {
* The restrictions handling is open from the concept and is only implemented for countries yet.
*/ @FXML CheckBox showOnlyMatchingCheckBox;
public class OfferBookView extends ActivatableViewAndModel<GridPane, OfferBookViewModel> implements @FXML TableView<OfferBookListItem> table;
ChildView<TradeView> { @FXML InputTextField volumeTextField, amountTextField, priceTextField;
@FXML Button createOfferButton, showAdvancedSettingsButton, openCountryFilterButton, openPaymentMethodsFilterButton;
@FXML TableColumn<OfferBookListItem, OfferBookListItem> priceColumn, amountColumn, volumeColumn, directionColumn,
countryColumn, bankAccountTypeColumn;
@FXML Label amountBtcLabel, priceDescriptionLabel, priceFiatLabel, volumeDescriptionLabel, volumeFiatLabel,
extendedButton1Label, extendedButton2Label, extendedCheckBoxLabel;
private TradeView parent;
private ImageView expand;
private ImageView collapse;
private boolean detailsVisible;
private boolean advancedScreenInited;
private final Navigation navigation; private final Navigation navigation;
private final OverlayManager overlayManager; private final OverlayManager overlayManager;
private final OptionalBtcValidator optionalBtcValidator; private final OptionalBtcValidator optionalBtcValidator;
private final OptionalFiatValidator optionalFiatValidator; private final OptionalFiatValidator optionalFiatValidator;
private boolean detailsVisible;
private boolean advancedScreenInited;
private ImageView expand;
private ImageView collapse;
@FXML CheckBox showOnlyMatchingCheckBox;
@FXML Label amountBtcLabel, priceDescriptionLabel, priceFiatLabel, volumeDescriptionLabel,
volumeFiatLabel, extendedButton1Label, extendedButton2Label, extendedCheckBoxLabel;
@FXML InputTextField volumeTextField, amountTextField, priceTextField;
@FXML TableView<OfferBookListItem> table;
@FXML Button createOfferButton, showAdvancedSettingsButton, openCountryFilterButton, openPaymentMethodsFilterButton;
@FXML TableColumn<OfferBookListItem, OfferBookListItem> priceColumn, amountColumn, volumeColumn,
directionColumn, countryColumn, bankAccountTypeColumn;
private TradeView parent;
@Inject @Inject
OfferBookView(OfferBookViewModel model, OfferBookView(OfferBookViewModel model,
Navigation navigation, Navigation navigation,
@ -97,8 +92,6 @@ public class OfferBookView extends ActivatableViewAndModel<GridPane, OfferBookVi
this.optionalFiatValidator = optionalFiatValidator; this.optionalFiatValidator = optionalFiatValidator;
} }
@Override @Override
public void initialize() { public void initialize() {
// init table // init table
@ -150,20 +143,14 @@ public class OfferBookView extends ActivatableViewAndModel<GridPane, OfferBookVi
removeBindings(); removeBindings();
} }
public void enableCreateOfferButton() { public void enableCreateOfferButton() {
createOfferButton.setDisable(false); createOfferButton.setDisable(false);
} }
public void setDirection(Direction direction) { public void setDirection(Direction direction) {
model.setDirection(direction); model.setDirection(direction);
} }
@FXML @FXML
void createOffer() { void createOffer() {
if (model.isRegistered()) { if (model.isRegistered()) {
@ -205,8 +192,6 @@ public class OfferBookView extends ActivatableViewAndModel<GridPane, OfferBookVi
Popups.openWarningPopup("Under construction", "This feature is not implemented yet."); Popups.openWarningPopup("Under construction", "This feature is not implemented yet.");
} }
private void openSetupScreen() { private void openSetupScreen() {
overlayManager.blurContent(); overlayManager.blurContent();
List<Action> actions = new ArrayList<>(); List<Action> actions = new ArrayList<>();
@ -309,8 +294,6 @@ public class OfferBookView extends ActivatableViewAndModel<GridPane, OfferBookVi
showOnlyMatchingCheckBox.setManaged(visible); showOnlyMatchingCheckBox.setManaged(visible);
} }
private void setupBindings() { private void setupBindings() {
amountTextField.textProperty().bindBidirectional(model.amount); amountTextField.textProperty().bindBidirectional(model.amount);
priceTextField.textProperty().bindBidirectional(model.price); priceTextField.textProperty().bindBidirectional(model.price);
@ -362,13 +345,10 @@ public class OfferBookView extends ActivatableViewAndModel<GridPane, OfferBookVi
.getBankAccountType())); .getBankAccountType()));
} }
public void setParent(TradeView parent) { public void setParent(TradeView parent) {
this.parent = parent; this.parent = parent;
} }
private void setAmountColumnCellFactory() { private void setAmountColumnCellFactory() {
amountColumn.setCellValueFactory((offer) -> new ReadOnlyObjectWrapper<>(offer.getValue())); amountColumn.setCellValueFactory((offer) -> new ReadOnlyObjectWrapper<>(offer.getValue()));
amountColumn.setCellFactory( amountColumn.setCellFactory(

View file

@ -64,40 +64,32 @@ import org.controlsfx.dialog.Dialog;
public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOfferViewModel> { public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOfferViewModel> {
private final Navigation navigation; @FXML ScrollPane scrollPane;
private final OverlayManager overlayManager; @FXML ImageView imageView;
private BooleanProperty tabIsClosable; @FXML InputTextField amountTextField;
@FXML AddressTextField addressTextField;
@FXML BalanceTextField balanceTextField;
@FXML ProgressIndicator takeOfferSpinner;
@FXML InfoDisplay advancedInfoDisplay, fundsBoxInfoDisplay;
@FXML TitledGroupBg priceAmountPane, payFundsPane, showDetailsPane;
@FXML Button showPaymentInfoScreenButton, showAdvancedSettingsButton, takeOfferButton;
@FXML TextField priceTextField, volumeTextField, acceptedArbitratorsTextField, totalToPayTextField,
bankAccountTypeTextField, bankAccountCurrencyTextField, bankAccountCountyTextField,
acceptedCountriesTextField, acceptedLanguagesTextField;
@FXML Label buyLabel, addressLabel, amountRangeTextField, balanceLabel, totalToPayLabel, totalToPayInfoIconLabel,
bankAccountTypeLabel, bankAccountCurrencyLabel, bankAccountCountyLabel, acceptedCountriesLabel,
acceptedLanguagesLabel, acceptedArbitratorsLabel, amountBtcLabel, priceDescriptionLabel,
volumeDescriptionLabel, takeOfferSpinnerInfoLabel;
private BooleanProperty tabIsClosable;
private boolean detailsVisible; private boolean detailsVisible;
private boolean advancedScreenInited; private boolean advancedScreenInited;
private ImageView expand; private ImageView expand;
private ImageView collapse; private ImageView collapse;
private PopOver totalToPayInfoPopover; private PopOver totalToPayInfoPopover;
@FXML InfoDisplay advancedInfoDisplay, fundsBoxInfoDisplay; private final Navigation navigation;
@FXML ScrollPane scrollPane; private final OverlayManager overlayManager;
@FXML ImageView imageView;
@FXML TitledGroupBg priceAmountPane, payFundsPane, showDetailsPane;
@FXML Label buyLabel, addressLabel, amountRangeTextField,
balanceLabel, totalToPayLabel, totalToPayInfoIconLabel,
bankAccountTypeLabel, bankAccountCurrencyLabel, bankAccountCountyLabel,
acceptedCountriesLabel, acceptedLanguagesLabel,
acceptedArbitratorsLabel, amountBtcLabel,
priceDescriptionLabel, volumeDescriptionLabel, takeOfferSpinnerInfoLabel;
@FXML Button showPaymentInfoScreenButton, showAdvancedSettingsButton, takeOfferButton;
@FXML InputTextField amountTextField;
@FXML TextField priceTextField, volumeTextField, acceptedArbitratorsTextField,
totalToPayTextField,
bankAccountTypeTextField,
bankAccountCurrencyTextField, bankAccountCountyTextField, acceptedCountriesTextField,
acceptedLanguagesTextField;
@FXML AddressTextField addressTextField;
@FXML BalanceTextField balanceTextField;
@FXML ProgressIndicator takeOfferSpinner;
@Inject @Inject
private TakeOfferView(TakeOfferViewModel model, Navigation navigation, private TakeOfferView(TakeOfferViewModel model, Navigation navigation,
@ -108,15 +100,12 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
this.overlayManager = overlayManager; this.overlayManager = overlayManager;
} }
@Override @Override
public void initialize() { public void initialize() {
setupListeners(); setupListeners();
setupBindings(); setupBindings();
} }
public void initWithData(Direction direction, Coin amount, Offer offer) { public void initWithData(Direction direction, Coin amount, Offer offer) {
model.initWithData(direction, amount, offer); model.initWithData(direction, amount, offer);
@ -152,7 +141,6 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
tabIsClosable.bind(model.tabIsClosable); tabIsClosable.bind(model.tabIsClosable);
} }
@FXML @FXML
void onTakeOffer() { void onTakeOffer() {
model.takeOffer(); model.takeOffer();
@ -240,15 +228,11 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
Help.openWindow(HelpId.TAKE_OFFER_ADVANCED); Help.openWindow(HelpId.TAKE_OFFER_ADVANCED);
} }
private void close() { private void close() {
TabPane tabPane = ((TabPane) (root.getParent().getParent())); TabPane tabPane = ((TabPane) (root.getParent().getParent()));
tabPane.getTabs().remove(tabPane.getSelectionModel().getSelectedItem()); tabPane.getTabs().remove(tabPane.getSelectionModel().getSelectedItem());
} }
private void setupListeners() { private void setupListeners() {
scrollPane.setOnScroll(e -> InputTextField.hideErrorMessageDisplay()); scrollPane.setOnScroll(e -> InputTextField.hideErrorMessageDisplay());