mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-09-25 19:11:04 -04:00
Refine View hierarchy
This commit is contained in:
parent
7435e1890a
commit
00552399d7
35 changed files with 169 additions and 149 deletions
47
src/main/java/io/bitsquare/gui/ActivatableView.java
Normal file
47
src/main/java/io/bitsquare/gui/ActivatableView.java
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui;
|
||||
|
||||
public abstract class ActivatableView<M> extends InitializableView<M> {
|
||||
|
||||
public ActivatableView(M model) {
|
||||
super(model);
|
||||
}
|
||||
|
||||
public ActivatableView() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void prepareInitialize() {
|
||||
if (root != null) {
|
||||
root.sceneProperty().addListener((ov, oldValue, newValue) -> {
|
||||
if (oldValue == null && newValue != null)
|
||||
activate();
|
||||
else if (oldValue != null && newValue == null)
|
||||
deactivate();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected void activate() {
|
||||
}
|
||||
|
||||
protected void deactivate() {
|
||||
}
|
||||
}
|
|
@ -17,30 +17,19 @@
|
|||
|
||||
package io.bitsquare.gui;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
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 ViewWithActivatableModel<M extends Activatable> extends View<M> {
|
||||
private static final Logger log = LoggerFactory.getLogger(ViewWithActivatableModel.class);
|
||||
public abstract class ActivatableViewAndModel<M extends Activatable> extends ActivatableView<M> {
|
||||
|
||||
public ViewWithActivatableModel(M model) {
|
||||
public ActivatableViewAndModel(M model) {
|
||||
super(checkNotNull(model, "Model must not be null"));
|
||||
}
|
||||
|
||||
public ViewWithActivatableModel() {
|
||||
public ActivatableViewAndModel() {
|
||||
this((M) Activatable.NOOP_INSTANCE);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Used to activate resources (adding listeners, starting timers or animations,...)
|
||||
*/
|
||||
@Override
|
||||
public final void activate() {
|
||||
model.activate();
|
||||
|
@ -50,9 +39,6 @@ public abstract class ViewWithActivatableModel<M extends Activatable> extends Vi
|
|||
protected void doActivate() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for deactivating resources (removing listeners, stopping timers or animations,...)
|
||||
*/
|
||||
@Override
|
||||
public final void deactivate() {
|
||||
model.deactivate();
|
47
src/main/java/io/bitsquare/gui/InitializableView.java
Normal file
47
src/main/java/io/bitsquare/gui/InitializableView.java
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javafx.fxml.Initializable;
|
||||
|
||||
public class InitializableView<M> extends View<M> implements Initializable {
|
||||
|
||||
public InitializableView(M model) {
|
||||
super(model);
|
||||
}
|
||||
|
||||
public InitializableView() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void initialize(URL location, ResourceBundle resources) {
|
||||
prepareInitialize();
|
||||
initialize();
|
||||
}
|
||||
|
||||
protected void prepareInitialize() {
|
||||
}
|
||||
|
||||
protected void initialize() {
|
||||
}
|
||||
}
|
|
@ -17,10 +17,6 @@
|
|||
|
||||
package io.bitsquare.gui;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.*;
|
||||
|
@ -28,21 +24,18 @@ import javafx.scene.*;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Non caching version for code behind classes using the ViewModel pattern
|
||||
*/
|
||||
public abstract class View<M> implements Initializable {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(View.class);
|
||||
public class View<M> {
|
||||
|
||||
public static final String TITLE_KEY = "view.title";
|
||||
|
||||
protected final Logger log = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
protected final M model;
|
||||
protected @FXML Parent root;
|
||||
|
||||
protected Initializable childController;
|
||||
protected Initializable parent;
|
||||
|
||||
protected final M model;
|
||||
|
||||
@FXML protected Parent root;
|
||||
|
||||
public View(M model) {
|
||||
this.model = model;
|
||||
|
@ -52,56 +45,10 @@ public abstract class View<M> implements Initializable {
|
|||
this(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get called form GUI framework when the UI is ready.
|
||||
*
|
||||
* @param url
|
||||
* @param rb
|
||||
*/
|
||||
@Override
|
||||
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)
|
||||
activate();
|
||||
else if (oldValue != null && newValue == null)
|
||||
deactivate();
|
||||
});
|
||||
}
|
||||
|
||||
initialize();
|
||||
}
|
||||
|
||||
protected void initialize() {
|
||||
}
|
||||
|
||||
protected void activate() {
|
||||
}
|
||||
|
||||
protected void deactivate() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param parent Controller who has created this.getClass().getSimpleName() instance (via
|
||||
* navigateToView/FXMLLoader).
|
||||
*/
|
||||
public void setParent(Initializable parent) {
|
||||
log.trace("Lifecycle: setParentController " + this.getClass().getSimpleName() + " / parent = " +
|
||||
parent);
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param navigationItem NavigationItem to be loaded.
|
||||
* @return The ViewController of the loaded view.
|
||||
*/
|
||||
protected Initializable loadView(Navigation.Item navigationItem) {
|
||||
log.trace("Lifecycle: loadViewAndGetChildController " + this.getClass().getSimpleName() + " / navigationItem " +
|
||||
"= " + navigationItem);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ package io.bitsquare.gui.main;
|
|||
|
||||
import io.bitsquare.BitsquareException;
|
||||
import io.bitsquare.bank.BankAccount;
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.OverlayManager;
|
||||
import io.bitsquare.gui.View;
|
||||
|
@ -44,7 +45,7 @@ import javafx.scene.text.*;
|
|||
import static io.bitsquare.gui.Navigation.Item.*;
|
||||
import static javafx.scene.layout.AnchorPane.*;
|
||||
|
||||
public class MainView extends View<MainViewModel> {
|
||||
public class MainView extends ActivatableView<MainViewModel> {
|
||||
|
||||
private final ToggleGroup navButtons = new ToggleGroup();
|
||||
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
|
||||
package io.bitsquare.gui.main.account;
|
||||
|
||||
import io.bitsquare.gui.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.View;
|
||||
import io.bitsquare.gui.ViewLoader;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
@ -32,7 +32,7 @@ import javafx.scene.control.*;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class AccountView extends ViewWithActivatableModel {
|
||||
public class AccountView extends ActivatableViewAndModel {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(AccountView.class);
|
||||
|
||||
|
@ -116,8 +116,6 @@ public class AccountView extends ViewWithActivatableModel {
|
|||
|
||||
@Override
|
||||
protected Initializable loadView(Navigation.Item navigationItem) {
|
||||
super.loadView(navigationItem);
|
||||
|
||||
ViewLoader.Item loaded = viewLoader.load(navigationItem.getFxmlUrl());
|
||||
final Tab tab;
|
||||
switch (navigationItem) {
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
package io.bitsquare.gui.main.account.arbitrator;
|
||||
|
||||
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.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 ViewWithActivatableModel {
|
||||
public class ArbitratorSettingsView extends View {
|
||||
|
||||
private final ViewLoader viewLoader;
|
||||
private final Navigation navigation;
|
||||
|
|
|
@ -19,6 +19,7 @@ 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;
|
||||
|
@ -40,7 +41,7 @@ import javafx.scene.layout.*;
|
|||
import javafx.stage.Stage;
|
||||
|
||||
// TODO Arbitration is very basic yet
|
||||
public class ArbitratorBrowserView extends View implements ArbitratorListener {
|
||||
public class ArbitratorBrowserView extends ActivatableView implements ArbitratorListener {
|
||||
|
||||
private final ViewLoader viewLoader;
|
||||
private final AccountSettings accountSettings;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
package io.bitsquare.gui.main.account.arbitrator.profile;
|
||||
|
||||
import io.bitsquare.arbitrator.Arbitrator;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.View;
|
||||
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 ViewWithActivatableModel {
|
||||
public class ArbitratorProfileView extends View {
|
||||
|
||||
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.View;
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
import io.bitsquare.locale.BSResources;
|
||||
|
@ -58,7 +58,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
// TODO Arbitration is very basic yet
|
||||
public class ArbitratorRegistrationView extends View {
|
||||
public class ArbitratorRegistrationView extends ActivatableView {
|
||||
private static final Logger log = LoggerFactory.getLogger(ArbitratorRegistrationView.class);
|
||||
|
||||
private final Persistence persistence;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package io.bitsquare.gui.main.account.content.changepassword;
|
||||
|
||||
import io.bitsquare.gui.View;
|
||||
import io.bitsquare.gui.InitializableView;
|
||||
import io.bitsquare.gui.main.account.MultiStepNavigation;
|
||||
import io.bitsquare.gui.main.account.content.ContextAware;
|
||||
import io.bitsquare.gui.main.help.Help;
|
||||
|
@ -32,7 +32,7 @@ import javafx.scene.layout.*;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class ChangePasswordView extends View<ChangePasswordViewModel> implements ContextAware {
|
||||
public class ChangePasswordView extends InitializableView<ChangePasswordViewModel> implements ContextAware {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ChangePasswordView.class);
|
||||
|
||||
|
|
|
@ -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.ActivatableViewAndModel;
|
||||
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;
|
||||
|
@ -53,7 +53,7 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
import static javafx.beans.binding.Bindings.createBooleanBinding;
|
||||
|
||||
public class FiatAccountView extends ViewWithActivatableModel<FiatAccountViewModel> implements ContextAware {
|
||||
public class FiatAccountView extends ActivatableViewAndModel<FiatAccountViewModel> implements ContextAware {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(FiatAccountView.class);
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
package io.bitsquare.gui.main.account.content.irc;
|
||||
|
||||
import io.bitsquare.bank.BankAccountType;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.components.InputTextField;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.gui.main.account.MultiStepNavigation;
|
||||
|
@ -44,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 ViewWithActivatableModel<IrcAccountViewModel> implements ContextAware {
|
||||
public class IrcAccountView extends ActivatableViewAndModel<IrcAccountViewModel> implements ContextAware {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(IrcAccountView.class);
|
||||
|
||||
|
|
|
@ -17,16 +17,12 @@
|
|||
|
||||
package io.bitsquare.gui.main.account.content.password;
|
||||
|
||||
import io.bitsquare.gui.View;
|
||||
import io.bitsquare.gui.InitializableView;
|
||||
import io.bitsquare.gui.main.account.MultiStepNavigation;
|
||||
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;
|
||||
|
@ -36,7 +32,7 @@ import javafx.scene.layout.*;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class PasswordView extends View<PasswordViewModel> implements ContextAware {
|
||||
public class PasswordView extends InitializableView<PasswordViewModel> implements ContextAware {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PasswordView.class);
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
package io.bitsquare.gui.main.account.content.registration;
|
||||
|
||||
import io.bitsquare.gui.InitializableView;
|
||||
import io.bitsquare.gui.OverlayManager;
|
||||
import io.bitsquare.gui.View;
|
||||
import io.bitsquare.gui.components.AddressTextField;
|
||||
import io.bitsquare.gui.components.BalanceTextField;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
|
@ -45,7 +45,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
public class RegistrationView extends View<RegistrationViewModel> implements ContextAware {
|
||||
public class RegistrationView extends InitializableView<RegistrationViewModel> implements ContextAware {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(RegistrationView.class);
|
||||
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
package io.bitsquare.gui.main.account.content.restrictions;
|
||||
|
||||
import io.bitsquare.arbitrator.Arbitrator;
|
||||
import io.bitsquare.gui.ActivatableViewAndModel;
|
||||
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;
|
||||
|
@ -47,7 +47,7 @@ import javafx.util.StringConverter;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class RestrictionsView extends ViewWithActivatableModel<RestrictionsViewModel> implements ContextAware {
|
||||
public class RestrictionsView extends ActivatableViewAndModel<RestrictionsViewModel> implements ContextAware {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(RestrictionsView.class);
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package io.bitsquare.gui.main.account.content.seedwords;
|
||||
|
||||
import io.bitsquare.gui.View;
|
||||
import io.bitsquare.gui.InitializableView;
|
||||
import io.bitsquare.gui.main.account.MultiStepNavigation;
|
||||
import io.bitsquare.gui.main.account.content.ContextAware;
|
||||
import io.bitsquare.gui.main.help.Help;
|
||||
|
@ -32,7 +32,7 @@ import javafx.scene.layout.*;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class SeedWordsView extends View<SeedWordsViewModel> implements ContextAware {
|
||||
public class SeedWordsView extends InitializableView<SeedWordsViewModel> implements ContextAware {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(SeedWordsView.class);
|
||||
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
|
||||
package io.bitsquare.gui.main.account.settings;
|
||||
|
||||
import io.bitsquare.gui.ActivatableViewAndModel;
|
||||
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;
|
||||
|
||||
|
@ -39,7 +39,7 @@ import de.jensd.fx.fontawesome.AwesomeIcon;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class AccountSettingsView extends ViewWithActivatableModel {
|
||||
public class AccountSettingsView extends ActivatableViewAndModel {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(AccountSettingsView.class);
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
package io.bitsquare.gui.main.account.setup;
|
||||
|
||||
import io.bitsquare.gui.ActivatableView;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.View;
|
||||
import io.bitsquare.gui.ViewLoader;
|
||||
|
@ -43,7 +44,7 @@ import org.slf4j.LoggerFactory;
|
|||
/**
|
||||
* This UI is not cached as it is normally only needed once.
|
||||
*/
|
||||
public class AccountSetupView extends View implements MultiStepNavigation {
|
||||
public class AccountSetupView extends ActivatableView implements MultiStepNavigation {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(AccountSetupView.class);
|
||||
|
||||
|
@ -195,7 +196,7 @@ public class AccountSetupView extends View implements MultiStepNavigation {
|
|||
class WizardItem extends HBox {
|
||||
private static final Logger log = LoggerFactory.getLogger(WizardItem.class);
|
||||
|
||||
private View childController;
|
||||
private Initializable childController;
|
||||
|
||||
private final ImageView imageView;
|
||||
private final Label titleLabel;
|
||||
|
@ -242,7 +243,7 @@ class WizardItem extends HBox {
|
|||
getChildren().addAll(imageView, vBox);
|
||||
}
|
||||
|
||||
View show() {
|
||||
Initializable show() {
|
||||
host.loadView(navigationItem);
|
||||
/* navigation.navigationTo(Navigation.Item.MAIN, Navigation.Item.ACCOUNT, Navigation
|
||||
.Item.ACCOUNT_SETUP,
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
|
||||
package io.bitsquare.gui.main.funds;
|
||||
|
||||
import io.bitsquare.gui.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.View;
|
||||
import io.bitsquare.gui.ViewLoader;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
@ -29,7 +29,7 @@ import javafx.fxml.FXML;
|
|||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.*;
|
||||
|
||||
public class FundsView extends ViewWithActivatableModel {
|
||||
public class FundsView extends ActivatableViewAndModel {
|
||||
|
||||
private Navigation.Listener navigationListener;
|
||||
private ChangeListener<Tab> tabChangeListener;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
package io.bitsquare.gui.main.funds.transactions;
|
||||
|
||||
import io.bitsquare.btc.WalletService;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
|
||||
|
@ -39,7 +39,7 @@ import javafx.util.Callback;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TransactionsView extends ViewWithActivatableModel {
|
||||
public class TransactionsView extends ActivatableViewAndModel {
|
||||
private static final Logger log = LoggerFactory.getLogger(TransactionsView.class);
|
||||
|
||||
private final WalletService walletService;
|
||||
|
|
|
@ -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.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
import io.bitsquare.util.Utilities;
|
||||
|
@ -56,7 +56,7 @@ import org.jetbrains.annotations.NotNull;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class WithdrawalView extends ViewWithActivatableModel {
|
||||
public class WithdrawalView extends ActivatableViewAndModel {
|
||||
private static final Logger log = LoggerFactory.getLogger(WithdrawalView.class);
|
||||
|
||||
|
||||
|
|
|
@ -17,16 +17,12 @@
|
|||
|
||||
package io.bitsquare.gui.main.home;
|
||||
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.View;
|
||||
|
||||
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 ViewWithActivatableModel {
|
||||
private static final Logger log = LoggerFactory.getLogger(HomeView.class);
|
||||
|
||||
|
||||
public class HomeView extends View {
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
package io.bitsquare.gui.main.msg;
|
||||
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.View;
|
||||
|
||||
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 ViewWithActivatableModel {
|
||||
public class MsgView extends View {
|
||||
private static final Logger log = LoggerFactory.getLogger(MsgView.class);
|
||||
|
||||
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
|
||||
package io.bitsquare.gui.main.portfolio;
|
||||
|
||||
import io.bitsquare.gui.ActivatableViewAndModel;
|
||||
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 javax.inject.Inject;
|
||||
|
@ -30,7 +30,7 @@ import javafx.fxml.FXML;
|
|||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.*;
|
||||
|
||||
public class PortfolioView extends ViewWithActivatableModel {
|
||||
public class PortfolioView extends ActivatableViewAndModel {
|
||||
|
||||
private Tab currentTab;
|
||||
private Navigation.Listener navigationListener;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package io.bitsquare.gui.main.portfolio.closed;
|
||||
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
@ -30,7 +30,7 @@ import javafx.util.Callback;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class ClosedTradesView extends ViewWithActivatableModel<ClosedTradesViewModel> {
|
||||
public class ClosedTradesView extends ActivatableViewAndModel<ClosedTradesViewModel> {
|
||||
private static final Logger log = LoggerFactory.getLogger(ClosedTradesView.class);
|
||||
|
||||
@FXML TableColumn<ClosedTradesListItem, ClosedTradesListItem> priceColumn, amountColumn, volumeColumn,
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package io.bitsquare.gui.main.portfolio.offer;
|
||||
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.ActivatableViewAndModel;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.util.Utilities;
|
||||
|
||||
|
@ -32,7 +32,7 @@ import javafx.util.Callback;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class OffersView extends ViewWithActivatableModel<OffersViewModel> {
|
||||
public class OffersView extends ActivatableViewAndModel<OffersViewModel> {
|
||||
private static final Logger log = LoggerFactory.getLogger(OffersView.class);
|
||||
|
||||
@FXML TableColumn<OfferListItem, OfferListItem> priceColumn, amountColumn, volumeColumn,
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
package io.bitsquare.gui.main.portfolio.pending;
|
||||
|
||||
import io.bitsquare.gui.ActivatableViewAndModel;
|
||||
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;
|
||||
|
@ -55,7 +55,7 @@ import javafx.util.StringConverter;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class PendingTradesView extends ViewWithActivatableModel<PendingTradesViewModel> {
|
||||
public class PendingTradesView extends ActivatableViewAndModel<PendingTradesViewModel> {
|
||||
private static final Logger log = LoggerFactory.getLogger(PendingTradesView.class);
|
||||
|
||||
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
|
||||
package io.bitsquare.gui.main.settings;
|
||||
|
||||
import io.bitsquare.gui.ActivatableViewAndModel;
|
||||
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 javax.inject.Inject;
|
||||
|
@ -30,7 +30,7 @@ import javafx.fxml.FXML;
|
|||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.*;
|
||||
|
||||
public class SettingsView extends ViewWithActivatableModel {
|
||||
public class SettingsView extends ActivatableViewAndModel {
|
||||
|
||||
private final ViewLoader viewLoader;
|
||||
private final Navigation navigation;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package io.bitsquare.gui.main.settings.application;
|
||||
|
||||
import io.bitsquare.gui.ViewWithActivatableModel;
|
||||
import io.bitsquare.gui.ActivatableViewAndModel;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
@ -30,7 +30,7 @@ import org.slf4j.LoggerFactory;
|
|||
/**
|
||||
* This UI is not cached as it is normally only needed once.
|
||||
*/
|
||||
public class PreferencesView extends ViewWithActivatableModel<PreferencesViewModel> {
|
||||
public class PreferencesView extends ActivatableViewAndModel<PreferencesViewModel> {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PreferencesView.class);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
@ -41,7 +41,7 @@ import javafx.scene.control.*;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TradeView extends ViewWithActivatableModel implements TradeNavigator {
|
||||
public class TradeView extends ActivatableView implements TradeNavigator {
|
||||
private static final Logger log = LoggerFactory.getLogger(TradeView.class);
|
||||
|
||||
private OfferBookView offerBookViewCB;
|
||||
|
@ -87,7 +87,7 @@ public class TradeView extends ViewWithActivatableModel implements TradeNavigato
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void doActivate() {
|
||||
protected void activate() {
|
||||
// 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...
|
||||
|
@ -113,7 +113,7 @@ public class TradeView extends ViewWithActivatableModel implements TradeNavigato
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void doDeactivate() {
|
||||
protected void deactivate() {
|
||||
navigation.removeListener(listener);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
|
||||
package io.bitsquare.gui.main.trade.createoffer;
|
||||
|
||||
import io.bitsquare.gui.ActivatableViewAndModel;
|
||||
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;
|
||||
|
@ -69,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 ViewWithActivatableModel<CreateOfferViewModel> {
|
||||
public class CreateOfferView extends ActivatableViewAndModel<CreateOfferViewModel> {
|
||||
private static final Logger log = LoggerFactory.getLogger(CreateOfferView.class);
|
||||
|
||||
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
|
||||
package io.bitsquare.gui.main.trade.offerbook;
|
||||
|
||||
import io.bitsquare.gui.ActivatableViewAndModel;
|
||||
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;
|
||||
|
@ -59,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 ViewWithActivatableModel<OfferBookViewModel> {
|
||||
public class OfferBookView extends ActivatableViewAndModel<OfferBookViewModel> {
|
||||
private static final Logger log = LoggerFactory.getLogger(OfferBookView.class);
|
||||
|
||||
private final Navigation navigation;
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
package io.bitsquare.gui.main.trade.takeoffer;
|
||||
|
||||
|
||||
import io.bitsquare.gui.ActivatableViewAndModel;
|
||||
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;
|
||||
|
@ -65,7 +65,7 @@ import org.controlsfx.dialog.Dialog;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TakeOfferView extends ViewWithActivatableModel<TakeOfferViewModel> {
|
||||
public class TakeOfferView extends ActivatableViewAndModel<TakeOfferViewModel> {
|
||||
private static final Logger log = LoggerFactory.getLogger(TakeOfferView.class);
|
||||
|
||||
private final Navigation navigation;
|
||||
|
|
|
@ -41,8 +41,8 @@
|
|||
<logger name="io.bitsquare.gui.DataModel" level="WARN"/>
|
||||
<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.ViewWithActivatableModel" level="WARN"/>
|
||||
<logger name="io.bitsquare.gui.ActivatableView" level="WARN"/>
|
||||
<logger name="io.bitsquare.gui.ActivatableViewAndModel" 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
Add a link
Reference in a new issue