mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-25 07:27:18 +01:00
Refine initializ/activate/deactivate lifecycle methods
... and eliminate terminate entirely
This commit is contained in:
parent
97817aa724
commit
7435e1890a
33 changed files with 98 additions and 261 deletions
|
@ -59,19 +59,29 @@ public abstract class View<M> implements Initializable {
|
|||
* @param rb
|
||||
*/
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
public final void initialize(URL url, ResourceBundle rb) {
|
||||
log.trace("Lifecycle: initialize " + this.getClass().getSimpleName());
|
||||
if (root != null) {
|
||||
root.sceneProperty().addListener((ov, oldValue, newValue) -> {
|
||||
// we got removed from the scene
|
||||
// lets terminate
|
||||
if (oldValue != null && newValue == null)
|
||||
terminate();
|
||||
if (oldValue == null && newValue != null)
|
||||
activate();
|
||||
else if (oldValue != null && newValue == null)
|
||||
deactivate();
|
||||
});
|
||||
}
|
||||
|
||||
initialize();
|
||||
}
|
||||
|
||||
public void terminate() {
|
||||
protected void initialize() {
|
||||
}
|
||||
|
||||
protected void activate() {
|
||||
}
|
||||
|
||||
protected void deactivate() {
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -17,10 +17,6 @@
|
|||
|
||||
package io.bitsquare.gui;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -30,44 +26,18 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
|||
* If caching is used for loader we use the CachedViewController for turning the controller into sleep mode if not
|
||||
* active and awake it at reactivation.
|
||||
*/
|
||||
public abstract class ActivatableView<M extends Activatable> extends View<M> implements Activatable {
|
||||
private static final Logger log = LoggerFactory.getLogger(ActivatableView.class);
|
||||
public abstract class ViewWithActivatableModel<M extends Activatable> extends View<M> {
|
||||
private static final Logger log = LoggerFactory.getLogger(ViewWithActivatableModel.class);
|
||||
|
||||
public ActivatableView(M model) {
|
||||
public ViewWithActivatableModel(M model) {
|
||||
super(checkNotNull(model, "Model must not be null"));
|
||||
}
|
||||
|
||||
public ActivatableView() {
|
||||
public ViewWithActivatableModel() {
|
||||
this((M) Activatable.NOOP_INSTANCE);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get called form GUI framework when the UI is ready.
|
||||
* In caching controllers the initialize is only used for static UI setup.
|
||||
* The activate() method is called to start resources like.
|
||||
*
|
||||
* @param url
|
||||
* @param rb
|
||||
*/
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
log.trace("Lifecycle: initialize " + this.getClass().getSimpleName());
|
||||
if (root != null) {
|
||||
root.sceneProperty().addListener((ov, oldValue, newValue) -> {
|
||||
// we got removed from the scene
|
||||
// lets terminate
|
||||
log.trace("Lifecycle: sceneProperty changed: " + this.getClass().getSimpleName() + " / oldValue=" +
|
||||
oldValue + " / newValue=" + newValue);
|
||||
|
||||
if (oldValue == null && newValue != null)
|
||||
this.activate();
|
||||
else if (oldValue != null && newValue == null)
|
||||
this.deactivate();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to activate resources (adding listeners, starting timers or animations,...)
|
||||
*/
|
|
@ -27,10 +27,6 @@ import io.bitsquare.gui.components.Popups;
|
|||
import io.bitsquare.gui.components.SystemNotification;
|
||||
import io.bitsquare.gui.util.Transitions;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
|
@ -77,9 +73,7 @@ public class MainView extends View<MainViewModel> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
super.initialize(url, rb);
|
||||
|
||||
protected void activate() {
|
||||
ToggleButton homeButton = new NavButton(HOME) {{
|
||||
setDisable(true); // during irc demo
|
||||
}};
|
||||
|
|
|
@ -17,14 +17,10 @@
|
|||
|
||||
package io.bitsquare.gui.main.account;
|
||||
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.View;
|
||||
import io.bitsquare.gui.ViewLoader;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
@ -36,7 +32,7 @@ import javafx.scene.control.*;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class AccountView extends ActivatableView {
|
||||
public class AccountView extends ViewWithActivatableModel {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(AccountView.class);
|
||||
|
||||
|
@ -67,7 +63,7 @@ public class AccountView extends ActivatableView {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
public void initialize() {
|
||||
navigationListener = navigationItems -> {
|
||||
if (navigationItems != null &&
|
||||
navigationItems.length == 3 &&
|
||||
|
@ -84,8 +80,6 @@ public class AccountView extends ActivatableView {
|
|||
Navigation.Item.ARBITRATOR_SETTINGS);
|
||||
|
||||
};
|
||||
|
||||
super.initialize(url, rb);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
|
||||
package io.bitsquare.gui.main.account.arbitrator;
|
||||
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.ViewLoader;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.main.account.arbitrator.registration.ArbitratorRegistrationView;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
@ -31,7 +31,7 @@ import javafx.stage.Modality;
|
|||
import javafx.stage.Stage;
|
||||
|
||||
// TODO Arbitration is very basic yet
|
||||
public class ArbitratorSettingsView extends ActivatableView {
|
||||
public class ArbitratorSettingsView extends ViewWithActivatableModel {
|
||||
|
||||
private final ViewLoader viewLoader;
|
||||
private final Navigation navigation;
|
||||
|
|
|
@ -19,7 +19,6 @@ package io.bitsquare.gui.main.account.arbitrator.browser;
|
|||
|
||||
import io.bitsquare.account.AccountSettings;
|
||||
import io.bitsquare.arbitrator.Arbitrator;
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.View;
|
||||
import io.bitsquare.gui.ViewLoader;
|
||||
|
@ -29,11 +28,8 @@ import io.bitsquare.msg.MessageService;
|
|||
import io.bitsquare.msg.listeners.ArbitratorListener;
|
||||
import io.bitsquare.persistence.Persistence;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
@ -44,7 +40,7 @@ import javafx.scene.layout.*;
|
|||
import javafx.stage.Stage;
|
||||
|
||||
// TODO Arbitration is very basic yet
|
||||
public class ArbitratorBrowserView extends ActivatableView implements ArbitratorListener {
|
||||
public class ArbitratorBrowserView extends View implements ArbitratorListener {
|
||||
|
||||
private final ViewLoader viewLoader;
|
||||
private final AccountSettings accountSettings;
|
||||
|
@ -80,15 +76,12 @@ public class ArbitratorBrowserView extends ActivatableView implements Arbitrator
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
public void initialize() {
|
||||
messageService.addArbitratorListener(this);
|
||||
messageService.getArbitrators(LanguageUtil.getDefaultLanguageLocale());
|
||||
|
||||
loadView(Navigation.Item.ARBITRATOR_PROFILE);
|
||||
checkButtonState();
|
||||
|
||||
super.initialize(url, rb);
|
||||
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
package io.bitsquare.gui.main.account.arbitrator.profile;
|
||||
|
||||
import io.bitsquare.arbitrator.Arbitrator;
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
import io.bitsquare.persistence.Persistence;
|
||||
import io.bitsquare.settings.Preferences;
|
||||
|
@ -29,7 +29,7 @@ import javafx.fxml.FXML;
|
|||
import javafx.scene.control.*;
|
||||
|
||||
// TODO Arbitration is very basic yet
|
||||
public class ArbitratorProfileView extends ActivatableView {
|
||||
public class ArbitratorProfileView extends ViewWithActivatableModel {
|
||||
|
||||
private final Preferences preferences;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ package io.bitsquare.gui.main.account.arbitrator.registration;
|
|||
import io.bitsquare.arbitrator.Arbitrator;
|
||||
import io.bitsquare.arbitrator.Reputation;
|
||||
import io.bitsquare.btc.WalletService;
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.View;
|
||||
import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
import io.bitsquare.locale.BSResources;
|
||||
|
@ -38,13 +38,10 @@ import org.bitcoinj.core.Wallet;
|
|||
import org.bitcoinj.core.WalletEventListener;
|
||||
import org.bitcoinj.script.Script;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
@ -61,7 +58,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
// TODO Arbitration is very basic yet
|
||||
public class ArbitratorRegistrationView extends ActivatableView {
|
||||
public class ArbitratorRegistrationView extends View {
|
||||
private static final Logger log = LoggerFactory.getLogger(ArbitratorRegistrationView.class);
|
||||
|
||||
private final Persistence persistence;
|
||||
|
@ -115,9 +112,7 @@ public class ArbitratorRegistrationView extends ActivatableView {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
super.initialize(url, rb);
|
||||
|
||||
public void initialize() {
|
||||
accordion.setExpandedPane(profileTitledPane);
|
||||
|
||||
Arbitrator persistedArbitrator = (Arbitrator) persistence.read(arbitrator);
|
||||
|
|
|
@ -23,10 +23,6 @@ import io.bitsquare.gui.main.account.content.ContextAware;
|
|||
import io.bitsquare.gui.main.help.Help;
|
||||
import io.bitsquare.gui.main.help.HelpId;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
|
@ -60,9 +56,7 @@ public class ChangePasswordView extends View<ChangePasswordViewModel> implements
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
super.initialize(url, rb);
|
||||
|
||||
public void initialize() {
|
||||
passwordField.textProperty().bindBidirectional(model.passwordField);
|
||||
repeatedPasswordField.textProperty().bindBidirectional(model.repeatedPasswordField);
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@ package io.bitsquare.gui.main.account.content.fiat;
|
|||
|
||||
import io.bitsquare.bank.BankAccount;
|
||||
import io.bitsquare.bank.BankAccountType;
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.OverlayManager;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.components.InputTextField;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.gui.main.account.MultiStepNavigation;
|
||||
|
@ -32,12 +32,9 @@ import io.bitsquare.locale.BSResources;
|
|||
import io.bitsquare.locale.Country;
|
||||
import io.bitsquare.locale.Region;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Currency;
|
||||
import java.util.List;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
@ -56,7 +53,7 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
import static javafx.beans.binding.Bindings.createBooleanBinding;
|
||||
|
||||
public class FiatAccountView extends ActivatableView<FiatAccountViewModel> implements ContextAware {
|
||||
public class FiatAccountView extends ViewWithActivatableModel<FiatAccountViewModel> implements ContextAware {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(FiatAccountView.class);
|
||||
|
||||
|
@ -88,7 +85,7 @@ public class FiatAccountView extends ActivatableView<FiatAccountViewModel> imple
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
public void initialize() {
|
||||
typesComboBox.setItems(model.getAllTypes());
|
||||
typesComboBox.setConverter(model.getTypesConverter());
|
||||
selectionComboBox.setConverter(model.getSelectionConverter());
|
||||
|
@ -102,8 +99,6 @@ public class FiatAccountView extends ActivatableView<FiatAccountViewModel> imple
|
|||
holderNameTextField.setValidator(model.getBankAccountNumberValidator());
|
||||
primaryIDTextField.setValidator(model.getBankAccountNumberValidator());
|
||||
secondaryIDTextField.setValidator(model.getBankAccountNumberValidator());
|
||||
|
||||
super.initialize(url, rb);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
package io.bitsquare.gui.main.account.content.irc;
|
||||
|
||||
import io.bitsquare.bank.BankAccountType;
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.components.InputTextField;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.gui.main.account.MultiStepNavigation;
|
||||
|
@ -28,10 +28,7 @@ import io.bitsquare.gui.main.help.HelpId;
|
|||
import io.bitsquare.gui.util.validation.InputValidator;
|
||||
import io.bitsquare.util.Utilities;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.Currency;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
@ -47,7 +44,7 @@ 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.
|
||||
*/
|
||||
public class IrcAccountView extends ActivatableView<IrcAccountViewModel> implements ContextAware {
|
||||
public class IrcAccountView extends ViewWithActivatableModel<IrcAccountViewModel> implements ContextAware {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(IrcAccountView.class);
|
||||
|
||||
|
@ -73,7 +70,7 @@ public class IrcAccountView extends ActivatableView<IrcAccountViewModel> impleme
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
public void doActivate() {
|
||||
ircNickNameTextField.setValidator(model.getNickNameValidator());
|
||||
|
||||
typesComboBox.setItems(model.getAllTypes());
|
||||
|
@ -132,11 +129,6 @@ public class IrcAccountView extends ActivatableView<IrcAccountViewModel> impleme
|
|||
});
|
||||
currencyComboBox.getSelectionModel().select(0);
|
||||
|
||||
super.initialize(url, rb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doActivate() {
|
||||
setupListeners();
|
||||
setupBindings();
|
||||
|
||||
|
|
|
@ -60,9 +60,7 @@ public class PasswordView extends View<PasswordViewModel> implements ContextAwar
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
super.initialize(url, rb);
|
||||
|
||||
public void initialize() {
|
||||
passwordField.textProperty().bindBidirectional(model.passwordField);
|
||||
repeatedPasswordField.textProperty().bindBidirectional(model.repeatedPasswordField);
|
||||
|
||||
|
|
|
@ -28,11 +28,8 @@ import io.bitsquare.gui.main.help.Help;
|
|||
import io.bitsquare.gui.main.help.HelpId;
|
||||
import io.bitsquare.locale.BSResources;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
@ -78,9 +75,7 @@ public class RegistrationView extends View<RegistrationViewModel> implements Con
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
super.initialize(url, rb);
|
||||
|
||||
public void initialize() {
|
||||
feeTextField.setText(model.getFeeAsString());
|
||||
addressTextField.setAmountAsCoin(model.getFeeAsCoin());
|
||||
addressTextField.setPaymentLabel(model.getPaymentLabel());
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
package io.bitsquare.gui.main.account.content.restrictions;
|
||||
|
||||
import io.bitsquare.arbitrator.Arbitrator;
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.ViewLoader;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.main.account.MultiStepNavigation;
|
||||
import io.bitsquare.gui.main.account.content.ContextAware;
|
||||
import io.bitsquare.gui.main.help.Help;
|
||||
|
@ -29,10 +29,7 @@ import io.bitsquare.gui.util.ImageUtil;
|
|||
import io.bitsquare.locale.Country;
|
||||
import io.bitsquare.locale.Region;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
@ -50,7 +47,7 @@ import javafx.util.StringConverter;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class RestrictionsView extends ActivatableView<RestrictionsViewModel> implements ContextAware {
|
||||
public class RestrictionsView extends ViewWithActivatableModel<RestrictionsViewModel> implements ContextAware {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(RestrictionsView.class);
|
||||
|
||||
|
@ -83,9 +80,7 @@ public class RestrictionsView extends ActivatableView<RestrictionsViewModel> imp
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
super.initialize(url, rb);
|
||||
|
||||
public void initialize() {
|
||||
initLanguage();
|
||||
initCountry();
|
||||
initArbitrators();
|
||||
|
|
|
@ -23,10 +23,6 @@ import io.bitsquare.gui.main.account.content.ContextAware;
|
|||
import io.bitsquare.gui.main.help.Help;
|
||||
import io.bitsquare.gui.main.help.HelpId;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
|
@ -59,9 +55,7 @@ public class SeedWordsView extends View<SeedWordsViewModel> implements ContextAw
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
super.initialize(url, rb);
|
||||
|
||||
public void initialize() {
|
||||
seedWordsTextArea.setText(model.seedWords.get());
|
||||
}
|
||||
|
||||
|
|
|
@ -17,17 +17,13 @@
|
|||
|
||||
package io.bitsquare.gui.main.account.settings;
|
||||
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.View;
|
||||
import io.bitsquare.gui.ViewLoader;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.main.account.content.ContextAware;
|
||||
import io.bitsquare.gui.util.Colors;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
|
@ -43,7 +39,7 @@ import de.jensd.fx.fontawesome.AwesomeIcon;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class AccountSettingsView extends ActivatableView {
|
||||
public class AccountSettingsView extends ViewWithActivatableModel {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(AccountSettingsView.class);
|
||||
|
||||
|
@ -73,7 +69,7 @@ public class AccountSettingsView extends ActivatableView {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
public void initialize() {
|
||||
listener = navigationItems -> {
|
||||
if (navigationItems != null &&
|
||||
navigationItems.length == 4 &&
|
||||
|
@ -102,8 +98,6 @@ public class AccountSettingsView extends ActivatableView {
|
|||
|
||||
leftVBox.getChildren().addAll(seedWords, password,
|
||||
restrictions, fiatAccount, registration);
|
||||
|
||||
super.initialize(url, rb);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -28,10 +28,6 @@ import io.bitsquare.gui.main.account.content.registration.RegistrationView;
|
|||
import io.bitsquare.gui.main.account.content.restrictions.RestrictionsView;
|
||||
import io.bitsquare.gui.main.account.content.seedwords.SeedWordsView;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
|
@ -77,7 +73,7 @@ public class AccountSetupView extends View implements MultiStepNavigation {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
public void initialize() {
|
||||
listener = navigationItems -> {
|
||||
if (navigationItems != null &&
|
||||
navigationItems.length == 4 &&
|
||||
|
@ -133,15 +129,16 @@ public class AccountSetupView extends View implements MultiStepNavigation {
|
|||
password.setDisable(true);
|
||||
restrictions.setDisable(true);
|
||||
registration.setDisable(true);
|
||||
}
|
||||
|
||||
super.initialize(url, rb);
|
||||
|
||||
@Override
|
||||
public void activate() {
|
||||
navigation.addListener(listener);
|
||||
childController = fiatAccount.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void terminate() {
|
||||
public void deactivate() {
|
||||
navigation.removeListener(listener);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,14 +17,10 @@
|
|||
|
||||
package io.bitsquare.gui.main.funds;
|
||||
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.View;
|
||||
import io.bitsquare.gui.ViewLoader;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
@ -33,7 +29,7 @@ import javafx.fxml.FXML;
|
|||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.*;
|
||||
|
||||
public class FundsView extends ActivatableView {
|
||||
public class FundsView extends ViewWithActivatableModel {
|
||||
|
||||
private Navigation.Listener navigationListener;
|
||||
private ChangeListener<Tab> tabChangeListener;
|
||||
|
@ -61,7 +57,7 @@ public class FundsView extends ActivatableView {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
public void initialize() {
|
||||
navigationListener = navigationItems -> {
|
||||
if (navigationItems != null && navigationItems.length == 3
|
||||
&& navigationItems[1] == Navigation.Item.FUNDS)
|
||||
|
@ -74,8 +70,6 @@ public class FundsView extends ActivatableView {
|
|||
else if (newValue == transactionsTab)
|
||||
navigation.navigationTo(Navigation.Item.MAIN, Navigation.Item.FUNDS, Navigation.Item.TRANSACTIONS);
|
||||
};
|
||||
|
||||
super.initialize(url, rb);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -18,16 +18,13 @@
|
|||
package io.bitsquare.gui.main.funds.transactions;
|
||||
|
||||
import io.bitsquare.btc.WalletService;
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
|
||||
import org.bitcoinj.core.Transaction;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
@ -42,7 +39,7 @@ import javafx.util.Callback;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TransactionsView extends ActivatableView {
|
||||
public class TransactionsView extends ViewWithActivatableModel {
|
||||
private static final Logger log = LoggerFactory.getLogger(TransactionsView.class);
|
||||
|
||||
private final WalletService walletService;
|
||||
|
@ -70,9 +67,7 @@ public class TransactionsView extends ActivatableView {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
super.initialize(url, rb);
|
||||
|
||||
public void initialize() {
|
||||
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
|
||||
table.setPlaceholder(new Label("No transactions available"));
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ import io.bitsquare.btc.FeePolicy;
|
|||
import io.bitsquare.btc.Restrictions;
|
||||
import io.bitsquare.btc.WalletService;
|
||||
import io.bitsquare.btc.listeners.BalanceListener;
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
import io.bitsquare.util.Utilities;
|
||||
|
@ -34,10 +34,7 @@ import org.bitcoinj.core.Transaction;
|
|||
|
||||
import com.google.common.util.concurrent.FutureCallback;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
@ -59,7 +56,7 @@ import org.jetbrains.annotations.NotNull;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class WithdrawalView extends ActivatableView {
|
||||
public class WithdrawalView extends ViewWithActivatableModel {
|
||||
private static final Logger log = LoggerFactory.getLogger(WithdrawalView.class);
|
||||
|
||||
|
||||
|
@ -89,7 +86,7 @@ public class WithdrawalView extends ActivatableView {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
public void initialize() {
|
||||
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
|
||||
table.setPlaceholder(new Label("No funded wallets for withdrawal available"));
|
||||
|
||||
|
@ -97,8 +94,6 @@ public class WithdrawalView extends ActivatableView {
|
|||
setBalanceColumnCellFactory();
|
||||
setCopyColumnCellFactory();
|
||||
setConfidenceColumnCellFactory();
|
||||
|
||||
super.initialize(url, rb);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,14 +17,14 @@
|
|||
|
||||
package io.bitsquare.gui.main.home;
|
||||
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
// home is just hosting the arbiters buttons yet, but that's just for dev, not clear yet what will be in home,
|
||||
// probably overview, event history, news, charts,... -> low prio
|
||||
public class HomeView extends ActivatableView {
|
||||
public class HomeView extends ViewWithActivatableModel {
|
||||
private static final Logger log = LoggerFactory.getLogger(HomeView.class);
|
||||
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
package io.bitsquare.gui.main.msg;
|
||||
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
@ -30,7 +30,7 @@ import org.slf4j.LoggerFactory;
|
|||
// will be probably only used for arbitration communication, will be renamed and the icon changed
|
||||
|
||||
|
||||
public class MsgView extends ActivatableView {
|
||||
public class MsgView extends ViewWithActivatableModel {
|
||||
private static final Logger log = LoggerFactory.getLogger(MsgView.class);
|
||||
|
||||
|
||||
|
|
|
@ -17,16 +17,12 @@
|
|||
|
||||
package io.bitsquare.gui.main.portfolio;
|
||||
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.View;
|
||||
import io.bitsquare.gui.ViewLoader;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.trade.TradeManager;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import javafx.beans.value.ChangeListener;
|
||||
|
@ -34,7 +30,7 @@ import javafx.fxml.FXML;
|
|||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.*;
|
||||
|
||||
public class PortfolioView extends ActivatableView {
|
||||
public class PortfolioView extends ViewWithActivatableModel {
|
||||
|
||||
private Tab currentTab;
|
||||
private Navigation.Listener navigationListener;
|
||||
|
@ -64,7 +60,7 @@ public class PortfolioView extends ActivatableView {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
public void initialize() {
|
||||
navigationListener = navigationItems -> {
|
||||
if (navigationItems != null && navigationItems.length == 3
|
||||
&& navigationItems[1] == Navigation.Item.PORTFOLIO)
|
||||
|
@ -80,8 +76,6 @@ public class PortfolioView extends ActivatableView {
|
|||
else if (newValue == closedTradesTab)
|
||||
navigation.navigationTo(Navigation.Item.MAIN, Navigation.Item.PORTFOLIO, Navigation.Item.CLOSED_TRADES);
|
||||
};
|
||||
|
||||
super.initialize(url, rb);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,13 +17,9 @@
|
|||
|
||||
package io.bitsquare.gui.main.portfolio.closed;
|
||||
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import javafx.beans.property.ReadOnlyObjectWrapper;
|
||||
|
@ -34,7 +30,7 @@ import javafx.util.Callback;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class ClosedTradesView extends ActivatableView<ClosedTradesViewModel> {
|
||||
public class ClosedTradesView extends ViewWithActivatableModel<ClosedTradesViewModel> {
|
||||
private static final Logger log = LoggerFactory.getLogger(ClosedTradesView.class);
|
||||
|
||||
@FXML TableColumn<ClosedTradesListItem, ClosedTradesListItem> priceColumn, amountColumn, volumeColumn,
|
||||
|
@ -57,7 +53,7 @@ public class ClosedTradesView extends ActivatableView<ClosedTradesViewModel> {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
public void initialize() {
|
||||
setTradeIdColumnCellFactory();
|
||||
setDirectionColumnCellFactory();
|
||||
setAmountColumnCellFactory();
|
||||
|
@ -67,8 +63,6 @@ public class ClosedTradesView extends ActivatableView<ClosedTradesViewModel> {
|
|||
|
||||
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
|
||||
table.setPlaceholder(new Label("No closed trades available"));
|
||||
|
||||
super.initialize(url, rb);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,14 +17,10 @@
|
|||
|
||||
package io.bitsquare.gui.main.portfolio.offer;
|
||||
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.util.Utilities;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import javafx.beans.property.ReadOnlyObjectWrapper;
|
||||
|
@ -36,7 +32,7 @@ import javafx.util.Callback;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class OffersView extends ActivatableView<OffersViewModel> {
|
||||
public class OffersView extends ViewWithActivatableModel<OffersViewModel> {
|
||||
private static final Logger log = LoggerFactory.getLogger(OffersView.class);
|
||||
|
||||
@FXML TableColumn<OfferListItem, OfferListItem> priceColumn, amountColumn, volumeColumn,
|
||||
|
@ -59,7 +55,7 @@ public class OffersView extends ActivatableView<OffersViewModel> {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
public void initialize() {
|
||||
setOfferIdColumnCellFactory();
|
||||
setDirectionColumnCellFactory();
|
||||
setAmountColumnCellFactory();
|
||||
|
@ -70,8 +66,6 @@ public class OffersView extends ActivatableView<OffersViewModel> {
|
|||
|
||||
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
|
||||
table.setPlaceholder(new Label("No open offers available"));
|
||||
|
||||
super.initialize(url, rb);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
package io.bitsquare.gui.main.portfolio.pending;
|
||||
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.components.InfoDisplay;
|
||||
import io.bitsquare.gui.components.InputTextField;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
|
@ -35,12 +35,9 @@ import io.bitsquare.util.Utilities;
|
|||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.utils.Fiat;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
@ -58,7 +55,7 @@ import javafx.util.StringConverter;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class PendingTradesView extends ActivatableView<PendingTradesViewModel> {
|
||||
public class PendingTradesView extends ViewWithActivatableModel<PendingTradesViewModel> {
|
||||
private static final Logger log = LoggerFactory.getLogger(PendingTradesView.class);
|
||||
|
||||
|
||||
|
@ -111,7 +108,7 @@ public class PendingTradesView extends ActivatableView<PendingTradesViewModel> {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
public void initialize() {
|
||||
setTradeIdColumnCellFactory();
|
||||
setDirectionColumnCellFactory();
|
||||
setAmountColumnCellFactory();
|
||||
|
@ -145,7 +142,6 @@ public class PendingTradesView extends ActivatableView<PendingTradesViewModel> {
|
|||
|
||||
withdrawAddressTextField.setValidator(model.getBtcAddressValidator());
|
||||
withdrawButton.disableProperty().bind(model.withdrawalButtonDisable);
|
||||
super.initialize(url, rb);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,16 +17,12 @@
|
|||
|
||||
package io.bitsquare.gui.main.settings;
|
||||
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.View;
|
||||
import io.bitsquare.gui.ViewLoader;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.settings.Preferences;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import javafx.beans.value.ChangeListener;
|
||||
|
@ -34,7 +30,7 @@ import javafx.fxml.FXML;
|
|||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.*;
|
||||
|
||||
public class SettingsView extends ActivatableView {
|
||||
public class SettingsView extends ViewWithActivatableModel {
|
||||
|
||||
private final ViewLoader viewLoader;
|
||||
private final Navigation navigation;
|
||||
|
@ -63,7 +59,7 @@ public class SettingsView extends ActivatableView {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
public void initialize() {
|
||||
navigationListener = navigationItems -> {
|
||||
if (navigationItems != null && navigationItems.length == 3
|
||||
&& navigationItems[1] == Navigation.Item.SETTINGS)
|
||||
|
@ -78,8 +74,6 @@ public class SettingsView extends ActivatableView {
|
|||
navigation.navigationTo(Navigation.Item.MAIN, Navigation.Item.SETTINGS,
|
||||
Navigation.Item.NETWORK_SETTINGS);
|
||||
};
|
||||
|
||||
super.initialize(url, rb);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,11 +17,7 @@
|
|||
|
||||
package io.bitsquare.gui.main.settings.application;
|
||||
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
@ -34,7 +30,7 @@ import org.slf4j.LoggerFactory;
|
|||
/**
|
||||
* This UI is not cached as it is normally only needed once.
|
||||
*/
|
||||
public class PreferencesView extends ActivatableView<PreferencesViewModel> {
|
||||
public class PreferencesView extends ViewWithActivatableModel<PreferencesViewModel> {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PreferencesView.class);
|
||||
|
||||
|
@ -56,11 +52,6 @@ public class PreferencesView extends ActivatableView<PreferencesViewModel> {
|
|||
// Lifecycle
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
super.initialize(url, rb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doActivate() {
|
||||
btcDenominationComboBox.setItems(model.getBtcDenominationItems());
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
|
||||
package io.bitsquare.gui.main.trade;
|
||||
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.ViewLoader;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.components.InputTextField;
|
||||
import io.bitsquare.gui.main.trade.createoffer.CreateOfferView;
|
||||
import io.bitsquare.gui.main.trade.offerbook.OfferBookView;
|
||||
|
@ -30,10 +30,7 @@ import io.bitsquare.offer.Offer;
|
|||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.utils.Fiat;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javafx.application.Platform;
|
||||
import javafx.collections.ListChangeListener;
|
||||
|
@ -44,7 +41,7 @@ import javafx.scene.control.*;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TradeView extends ActivatableView implements TradeNavigator {
|
||||
public class TradeView extends ViewWithActivatableModel implements TradeNavigator {
|
||||
private static final Logger log = LoggerFactory.getLogger(TradeView.class);
|
||||
|
||||
private OfferBookView offerBookViewCB;
|
||||
|
@ -78,7 +75,7 @@ public class TradeView extends ActivatableView implements TradeNavigator {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
protected void initialize() {
|
||||
direction = (this instanceof BuyView) ? Direction.BUY : Direction.SELL;
|
||||
navigationItem = (direction == Direction.BUY) ? Navigation.Item.BUY : Navigation.Item.SELL;
|
||||
|
||||
|
@ -87,12 +84,10 @@ public class TradeView extends ActivatableView implements TradeNavigator {
|
|||
loadView(navigationItems[2]);
|
||||
}
|
||||
};
|
||||
|
||||
super.initialize(url, rb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doActivate() {
|
||||
protected void doActivate() {
|
||||
// We need to remove open validation error popups
|
||||
// Platform.runLater needed as focus-out event is called after selectedIndexProperty changed
|
||||
// TODO Find a way to do that in the InputTextField directly, but a tab change does not trigger any event...
|
||||
|
@ -118,7 +113,7 @@ public class TradeView extends ActivatableView implements TradeNavigator {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void doDeactivate() {
|
||||
protected void doDeactivate() {
|
||||
navigation.removeListener(listener);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
|
||||
package io.bitsquare.gui.main.trade.createoffer;
|
||||
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.OverlayManager;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.components.AddressTextField;
|
||||
import io.bitsquare.gui.components.BalanceTextField;
|
||||
import io.bitsquare.gui.components.InfoDisplay;
|
||||
|
@ -35,11 +35,8 @@ import io.bitsquare.offer.Direction;
|
|||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.utils.Fiat;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
@ -72,7 +69,7 @@ import static javafx.beans.binding.Bindings.createStringBinding;
|
|||
// TODO Implement other positioning method in InoutTextField to display it over the field instead of right side
|
||||
// priceAmountHBox is too large after redesign as to be used as layoutReference.
|
||||
|
||||
public class CreateOfferView extends ActivatableView<CreateOfferViewModel> {
|
||||
public class CreateOfferView extends ViewWithActivatableModel<CreateOfferViewModel> {
|
||||
private static final Logger log = LoggerFactory.getLogger(CreateOfferView.class);
|
||||
|
||||
|
||||
|
@ -128,9 +125,7 @@ public class CreateOfferView extends ActivatableView<CreateOfferViewModel> {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
super.initialize(url, rb);
|
||||
|
||||
protected void initialize() {
|
||||
setupListeners();
|
||||
setupBindings();
|
||||
balanceTextField.setup(model.getWalletService(), model.address.get(),
|
||||
|
@ -139,7 +134,7 @@ public class CreateOfferView extends ActivatableView<CreateOfferViewModel> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void doDeactivate() {
|
||||
protected void doDeactivate() {
|
||||
tabIsClosable.unbind();
|
||||
}
|
||||
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
|
||||
package io.bitsquare.gui.main.trade.offerbook;
|
||||
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.OverlayManager;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.components.InputTextField;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.gui.main.trade.TradeNavigator;
|
||||
|
@ -31,11 +31,8 @@ import io.bitsquare.locale.Country;
|
|||
import io.bitsquare.offer.Direction;
|
||||
import io.bitsquare.offer.Offer;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
@ -62,7 +59,7 @@ import static javafx.beans.binding.Bindings.createStringBinding;
|
|||
* TODO: The advanced filters are not impl. yet
|
||||
* The restrictions handling is open from the concept and is only implemented for countries yet.
|
||||
*/
|
||||
public class OfferBookView extends ActivatableView<OfferBookViewModel> {
|
||||
public class OfferBookView extends ViewWithActivatableModel<OfferBookViewModel> {
|
||||
private static final Logger log = LoggerFactory.getLogger(OfferBookView.class);
|
||||
|
||||
private final Navigation navigation;
|
||||
|
@ -109,7 +106,7 @@ public class OfferBookView extends ActivatableView<OfferBookViewModel> {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
public void initialize() {
|
||||
// init table
|
||||
setAmountColumnCellFactory();
|
||||
setPriceColumnCellFactory();
|
||||
|
@ -135,8 +132,6 @@ public class OfferBookView extends ActivatableView<OfferBookViewModel> {
|
|||
// for irc demo
|
||||
showAdvancedSettingsButton.setVisible(false);
|
||||
showAdvancedSettingsButton.setManaged(false);
|
||||
|
||||
super.initialize(url, rb);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
package io.bitsquare.gui.main.trade.takeoffer;
|
||||
|
||||
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.OverlayManager;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.components.AddressTextField;
|
||||
import io.bitsquare.gui.components.BalanceTextField;
|
||||
import io.bitsquare.gui.components.InfoDisplay;
|
||||
|
@ -36,11 +36,8 @@ import io.bitsquare.offer.Offer;
|
|||
|
||||
import org.bitcoinj.core.Coin;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
@ -68,7 +65,7 @@ import org.controlsfx.dialog.Dialog;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TakeOfferView extends ActivatableView<TakeOfferViewModel> {
|
||||
public class TakeOfferView extends ViewWithActivatableModel<TakeOfferViewModel> {
|
||||
private static final Logger log = LoggerFactory.getLogger(TakeOfferView.class);
|
||||
|
||||
private final Navigation navigation;
|
||||
|
@ -124,9 +121,7 @@ public class TakeOfferView extends ActivatableView<TakeOfferViewModel> {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
super.initialize(url, rb);
|
||||
|
||||
public void initialize() {
|
||||
setupListeners();
|
||||
setupBindings();
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
<logger name="io.bitsquare.gui.ActivatableWithDelegate" level="WARN"/>
|
||||
<logger name="io.bitsquare.gui.ViewController" level="WARN"/>
|
||||
<logger name="io.bitsquare.gui.View" level="WARN"/>
|
||||
<logger name="io.bitsquare.gui.ActivatableView" level="WARN"/>
|
||||
<logger name="io.bitsquare.gui.ViewWithActivatableModel" level="WARN"/>
|
||||
<logger name="io.bitsquare.gui.util.Profiler" level="WARN"/>
|
||||
<logger name="io.bitsquare.persistence.Persistence" level="WARN"/>
|
||||
<logger name="io.bitsquare.locale.BSResources" level="OFF"/>
|
||||
|
|
Loading…
Add table
Reference in a new issue