Rename BSResources to Res

This commit is contained in:
Manfred Karrer 2017-03-04 19:00:58 -05:00
parent a9fa5420ca
commit aae59466d4
44 changed files with 213 additions and 212 deletions

View file

@ -10,7 +10,7 @@ import io.bitsquare.common.UserThread;
import io.bitsquare.common.handlers.FaultHandler;
import io.bitsquare.common.util.Tuple2;
import io.bitsquare.http.HttpClient;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
import javafx.beans.property.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -37,9 +37,9 @@ public class PriceFeedService {
///////////////////////////////////////////////////////////////////////////////////////////
public enum Type {
ASK(BSResources.get("marketPrice.ask")),
BID(BSResources.get("marketPrice.bid")),
LAST(BSResources.get("marketPrice.last"));
ASK(Res.get("marketPrice.ask")),
BID(Res.get("marketPrice.bid")),
LAST(Res.get("marketPrice.last"));
public final String name;

View file

@ -32,8 +32,8 @@ import java.util.MissingResourceException;
import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;
public class BSResources {
private static final Logger log = LoggerFactory.getLogger(BSResources.class);
public class Res {
private static final Logger log = LoggerFactory.getLogger(Res.class);
public static ResourceBundle getResourceBundle() {
return ResourceBundle.getBundle("i18n.displayStrings", new UTF8Control());
@ -44,7 +44,7 @@ public class BSResources {
return "";
try {
return BSResources.getResourceBundle().getString(key);
return Res.getResourceBundle().getString(key);
} catch (MissingResourceException e) {
log.trace("Missing resource for key: " + key);
return key;
@ -52,7 +52,7 @@ public class BSResources {
}
public static String get(String key, Object... arguments) {
return MessageFormat.format(BSResources.get(key), arguments);
return MessageFormat.format(Res.get(key), arguments);
}
}

View file

@ -16,7 +16,7 @@
<logger name="io.bitsquare.btc.AddressBasedCoinSelector" level="OFF"/>
<logger name="io.bitsquare.gui.util.Profiler" level="ERROR"/>
<logger name="io.bitsquare.locale.BSResources" level="ERROR"/>
<logger name="io.bitsquare.locale.Res" level="ERROR"/>
<logger name="io.bitsquare.temp.storage.RemoteStorage" level="WARN"/>
<logger name="io.bitsquare.storage.FileManager" level="WARN"/>

View file

@ -43,7 +43,7 @@ import io.bitsquare.gui.main.debug.DebugView;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.main.overlays.windows.*;
import io.bitsquare.gui.util.ImageUtil;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
import io.bitsquare.p2p.P2PService;
import io.bitsquare.storage.Storage;
import io.bitsquare.trade.TradeManager;
@ -218,14 +218,14 @@ public class BitsquareApp extends Application {
if (walletsManager.areWalletsAvailable())
new ShowWalletDataWindow(walletsManager).show();
else
new Popup<>().warning(BSResources.get("popup.warning.walletNotInitialized")).show();
new Popup<>().warning(Res.get("popup.warning.walletNotInitialized")).show();
} else if (new KeyCodeCombination(KeyCode.G, KeyCombination.ALT_DOWN).match(keyEvent)) {
TradeWalletService tradeWalletService = injector.getInstance(TradeWalletService.class);
BtcWalletService walletService = injector.getInstance(BtcWalletService.class);
if (walletService.isWalletReady())
new SpendFromDepositTxWindow(tradeWalletService).show();
else
new Popup<>().warning(BSResources.get("popup.warning.walletNotInitialized")).show();
new Popup<>().warning(Res.get("popup.warning.walletNotInitialized")).show();
} else if (DevFlags.DEV_MODE && new KeyCodeCombination(KeyCode.D, KeyCombination.SHORTCUT_DOWN).match(keyEvent)) {
showDebugWindow();
}
@ -257,7 +257,7 @@ public class BitsquareApp extends Application {
String osArchitecture = Utilities.getOSArchitecture();
// We don't force a shutdown as the osArchitecture might in strange cases return a wrong value.
// Needs at least more testing on different machines...
new Popup<>().warning(BSResources.get("popup.warning.wrongVersion"))
new Popup<>().warning(Res.get("popup.warning.wrongVersion"))
.show();
}
@ -327,9 +327,9 @@ public class BitsquareApp extends Application {
//TODO check if Dialogs is still wanted?
Dialogs.create()
.owner(primaryStage)
.title(BSResources.get("popup.error.title"))
.title(Res.get("popup.error.title"))
.message(throwable.toString())
.masthead(BSResources.get("popup.error.fatalStartupException"))
.masthead(Res.get("popup.error.fatalStartupException"))
.showError();
if (doShutDown)
stop();
@ -382,8 +382,8 @@ public class BitsquareApp extends Application {
@Override
public void stop() {
if (!shutDownRequested) {
new Popup().headLine(BSResources.get("popup.shutDownInProgress.headline"))
.backgroundInfo(BSResources.get("popup.shutDownInProgress.message"))
new Popup().headLine(Res.get("popup.shutDownInProgress.headline"))
.backgroundInfo(Res.get("popup.shutDownInProgress.message"))
.hideCloseButton()
.useAnimation(false)
.show();

View file

@ -32,7 +32,7 @@ import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.BsqFormatter;
import io.bitsquare.gui.util.Transitions;
import io.bitsquare.gui.util.validation.*;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
import javafx.stage.Stage;
import org.springframework.core.env.Environment;
@ -52,7 +52,7 @@ public class GuiModule extends AppModule {
bind(InjectorViewFactory.class).in(Singleton.class);
bind(ViewFactory.class).to(InjectorViewFactory.class);
bind(ResourceBundle.class).toInstance(BSResources.getResourceBundle());
bind(ResourceBundle.class).toInstance(Res.getResourceBundle());
bind(ViewLoader.class).to(FxmlViewLoader.class).in(Singleton.class);
bind(CachingViewLoader.class).in(Singleton.class);

View file

@ -20,7 +20,7 @@ package io.bitsquare.gui.components;
import de.jensd.fx.fontawesome.AwesomeDude;
import de.jensd.fx.fontawesome.AwesomeIcon;
import io.bitsquare.common.UserThread;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
import javafx.beans.property.*;
import javafx.beans.value.ChangeListener;
import javafx.event.ActionEvent;
@ -74,7 +74,7 @@ public class InfoDisplay extends Parent {
// width is set a frame later so we hide it first
label.setVisible(false);
link = new Hyperlink(BSResources.get("shared.readMore"));
link = new Hyperlink(Res.get("shared.readMore"));
link.setPadding(new Insets(0, 0, 0, -2));
// We need that to know if we have a wrapping or not.
@ -88,7 +88,7 @@ public class InfoDisplay extends Parent {
testLabel.widthProperty().addListener((ov, o, n) -> {
useReadMore = (double) n > textFlow.getWidth();
link.setText(BSResources.get(useReadMore ? "shared.readMore" : "shared.openHelp"));
link.setText(Res.get(useReadMore ? "shared.readMore" : "shared.openHelp"));
UserThread.execute(() -> textFlow.getChildren().setAll(label, link));
});
@ -107,7 +107,7 @@ public class InfoDisplay extends Parent {
if (useReadMore) {
label.setWrapText(true);
link.setText(BSResources.get("shared.openHelp"));
link.setText(Res.get("shared.openHelp"));
getScene().getWindow().widthProperty().removeListener(listener);
if (label.prefWidthProperty().isBound())
label.prefWidthProperty().unbind();

View file

@ -22,7 +22,7 @@ import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.gui.util.validation.AliPayValidator;
import io.bitsquare.gui.util.validation.InputValidator;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
import io.bitsquare.payment.AliPayAccount;
import io.bitsquare.payment.AliPayAccountContractData;
import io.bitsquare.payment.PaymentAccount;
@ -74,7 +74,7 @@ public class AliPayForm extends PaymentMethodForm {
if (useCustomAccountNameCheckBox != null && !useCustomAccountNameCheckBox.isSelected()) {
String accountNr = accountNrInputTextField.getText();
accountNr = StringUtils.abbreviate(accountNr, 9);
String method = BSResources.get(paymentAccount.getPaymentMethod().getId());
String method = Res.get(paymentAccount.getPaymentMethod().getId());
accountNameTextField.setText(method.concat(": ").concat(accountNr));
}
}
@ -83,7 +83,7 @@ public class AliPayForm extends PaymentMethodForm {
public void addFormForDisplayAccount() {
gridRowFrom = gridRow;
addLabelTextField(gridPane, gridRow, "Account name:", aliPayAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
addLabelTextField(gridPane, ++gridRow, "Payment method:", BSResources.get(aliPayAccount.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++gridRow, "Payment method:", Res.get(aliPayAccount.getPaymentMethod().getId()));
TextField field = addLabelTextField(gridPane, ++gridRow, "Account no.:", aliPayAccount.getAccountNr()).second;
field.setMouseTransparent(false);
addLabelTextField(gridPane, ++gridRow, "Currency:", aliPayAccount.getSingleTradeCurrency().getNameAndCode());

View file

@ -203,7 +203,7 @@ abstract class BankForm extends PaymentMethodForm {
String countryCode = bankAccountContractData.getCountryCode();
addLabelTextField(gridPane, gridRow, "Account name:", paymentAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
addLabelTextField(gridPane, ++gridRow, "Payment method:", BSResources.get(paymentAccount.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++gridRow, "Payment method:", Res.get(paymentAccount.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++gridRow, "Country:", getCountryBasedPaymentAccount().getCountry() != null ? getCountryBasedPaymentAccount().getCountry().name : "");
addLabelTextField(gridPane, ++gridRow, "Currency:", paymentAccount.getSingleTradeCurrency().getNameAndCode());
addAcceptedBanksForDisplayAccount();
@ -530,7 +530,7 @@ abstract class BankForm extends PaymentMethodForm {
if (accountNr.length() > 9)
accountNr = StringUtils.abbreviate(accountNr, 9);
String method = BSResources.get(paymentAccount.getPaymentMethod().getId());
String method = Res.get(paymentAccount.getPaymentMethod().getId());
if (bankId != null && !bankId.isEmpty())
accountNameTextField.setText(method.concat(": ").concat(bankId).concat(", ").concat(accountNr));
else

View file

@ -215,7 +215,7 @@ public class CashDepositForm extends PaymentMethodForm {
String countryCode = cashDepositAccountContractData.getCountryCode();
addLabelTextField(gridPane, gridRow, "Account name:", paymentAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
addLabelTextField(gridPane, ++gridRow, "Payment method:", BSResources.get(paymentAccount.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++gridRow, "Payment method:", Res.get(paymentAccount.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++gridRow, "Country:", getCountryBasedPaymentAccount().getCountry() != null ? getCountryBasedPaymentAccount().getCountry().name : "");
addLabelTextField(gridPane, ++gridRow, "Currency:", paymentAccount.getSingleTradeCurrency().getNameAndCode());
addAcceptedBanksForDisplayAccount();
@ -563,7 +563,7 @@ public class CashDepositForm extends PaymentMethodForm {
if (accountNr.length() > 9)
accountNr = StringUtils.abbreviate(accountNr, 9);
String method = BSResources.get(paymentAccount.getPaymentMethod().getId());
String method = Res.get(paymentAccount.getPaymentMethod().getId());
if (bankId != null && !bankId.isEmpty())
accountNameTextField.setText(method.concat(": ").concat(bankId).concat(", ").concat(accountNr));
else

View file

@ -22,7 +22,7 @@ import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.gui.util.validation.ChaseQuickPayValidator;
import io.bitsquare.gui.util.validation.InputValidator;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
import io.bitsquare.payment.ChaseQuickPayAccount;
import io.bitsquare.payment.ChaseQuickPayAccountContractData;
import io.bitsquare.payment.PaymentAccount;
@ -83,7 +83,7 @@ public class ChaseQuickPayForm extends PaymentMethodForm {
if (useCustomAccountNameCheckBox != null && !useCustomAccountNameCheckBox.isSelected()) {
String mobileNr = mobileNrInputTextField.getText();
mobileNr = StringUtils.abbreviate(mobileNr, 9);
String method = BSResources.get(paymentAccount.getPaymentMethod().getId());
String method = Res.get(paymentAccount.getPaymentMethod().getId());
accountNameTextField.setText(method.concat(": ").concat(mobileNr));
}
}
@ -92,7 +92,7 @@ public class ChaseQuickPayForm extends PaymentMethodForm {
public void addFormForDisplayAccount() {
gridRowFrom = gridRow;
addLabelTextField(gridPane, gridRow, "Account name:", chaseQuickPayAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
addLabelTextField(gridPane, ++gridRow, "Payment method:", BSResources.get(chaseQuickPayAccount.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++gridRow, "Payment method:", Res.get(chaseQuickPayAccount.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++gridRow, "Account holder name:", chaseQuickPayAccount.getHolderName());
TextField field = addLabelTextField(gridPane, ++gridRow, "Email:", chaseQuickPayAccount.getEmail()).second;
field.setMouseTransparent(false);

View file

@ -22,7 +22,7 @@ import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.gui.util.validation.ClearXchangeValidator;
import io.bitsquare.gui.util.validation.InputValidator;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
import io.bitsquare.payment.ClearXchangeAccount;
import io.bitsquare.payment.ClearXchangeAccountContractData;
import io.bitsquare.payment.PaymentAccount;
@ -82,7 +82,7 @@ public class ClearXchangeForm extends PaymentMethodForm {
if (useCustomAccountNameCheckBox != null && !useCustomAccountNameCheckBox.isSelected()) {
String mobileNr = mobileNrInputTextField.getText();
mobileNr = StringUtils.abbreviate(mobileNr, 9);
String method = BSResources.get(paymentAccount.getPaymentMethod().getId());
String method = Res.get(paymentAccount.getPaymentMethod().getId());
accountNameTextField.setText(method.concat(": ").concat(mobileNr));
}
}
@ -91,7 +91,7 @@ public class ClearXchangeForm extends PaymentMethodForm {
public void addFormForDisplayAccount() {
gridRowFrom = gridRow;
addLabelTextField(gridPane, gridRow, "Account name:", clearXchangeAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
addLabelTextField(gridPane, ++gridRow, "Payment method:", BSResources.get(clearXchangeAccount.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++gridRow, "Payment method:", Res.get(clearXchangeAccount.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++gridRow, "Account holder name:", clearXchangeAccount.getHolderName());
TextField field = addLabelTextField(gridPane, ++gridRow, "Email or mobile no.:", clearXchangeAccount.getEmailOrMobileNr()).second;
field.setMouseTransparent(false);

View file

@ -23,8 +23,8 @@ import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.gui.util.validation.AltCoinAddressValidator;
import io.bitsquare.gui.util.validation.InputValidator;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.CurrencyUtil;
import io.bitsquare.locale.Res;
import io.bitsquare.locale.TradeCurrency;
import io.bitsquare.payment.CryptoCurrencyAccount;
import io.bitsquare.payment.CryptoCurrencyAccountContractData;
@ -109,7 +109,7 @@ public class CryptoCurrencyForm extends PaymentMethodForm {
public void addFormForDisplayAccount() {
gridRowFrom = gridRow;
addLabelTextField(gridPane, gridRow, "Account name:", cryptoCurrencyAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
addLabelTextField(gridPane, ++gridRow, "Payment method:", BSResources.get(cryptoCurrencyAccount.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++gridRow, "Payment method:", Res.get(cryptoCurrencyAccount.getPaymentMethod().getId()));
Tuple2<Label, TextField> tuple2 = addLabelTextField(gridPane, ++gridRow, "Altcoin address:", cryptoCurrencyAccount.getAddress());
addressLabel = tuple2.first;
TextField field = tuple2.second;

View file

@ -23,7 +23,7 @@ import io.bitsquare.gui.util.Layout;
import io.bitsquare.gui.util.validation.AccountNrValidator;
import io.bitsquare.gui.util.validation.BranchIdValidator;
import io.bitsquare.gui.util.validation.InputValidator;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
import io.bitsquare.payment.FasterPaymentsAccount;
import io.bitsquare.payment.FasterPaymentsAccountContractData;
import io.bitsquare.payment.PaymentAccount;
@ -85,7 +85,7 @@ public class FasterPaymentsForm extends PaymentMethodForm {
if (useCustomAccountNameCheckBox != null && !useCustomAccountNameCheckBox.isSelected()) {
String accountNr = accountNrInputTextField.getText();
accountNr = StringUtils.abbreviate(accountNr, 9);
String method = BSResources.get(paymentAccount.getPaymentMethod().getId());
String method = Res.get(paymentAccount.getPaymentMethod().getId());
accountNameTextField.setText(method.concat(": ").concat(accountNr));
}
}
@ -94,7 +94,7 @@ public class FasterPaymentsForm extends PaymentMethodForm {
public void addFormForDisplayAccount() {
gridRowFrom = gridRow;
addLabelTextField(gridPane, gridRow, "Account name:", fasterPaymentsAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
addLabelTextField(gridPane, ++gridRow, "Payment method:", BSResources.get(fasterPaymentsAccount.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++gridRow, "Payment method:", Res.get(fasterPaymentsAccount.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++gridRow, "UK Sort code:", fasterPaymentsAccount.getSortCode());
TextField field = addLabelTextField(gridPane, ++gridRow, "Account number:", fasterPaymentsAccount.getAccountNr()).second;
field.setMouseTransparent(false);

View file

@ -22,7 +22,7 @@ import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.gui.util.validation.InputValidator;
import io.bitsquare.gui.util.validation.InteracETransferValidator;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
import io.bitsquare.payment.InteracETransferAccount;
import io.bitsquare.payment.InteracETransferAccountContractData;
import io.bitsquare.payment.PaymentAccount;
@ -100,7 +100,7 @@ public class InteracETransferForm extends PaymentMethodForm {
if (useCustomAccountNameCheckBox != null && !useCustomAccountNameCheckBox.isSelected()) {
String mobileNr = mobileNrInputTextField.getText();
mobileNr = StringUtils.abbreviate(mobileNr, 9);
String method = BSResources.get(paymentAccount.getPaymentMethod().getId());
String method = Res.get(paymentAccount.getPaymentMethod().getId());
accountNameTextField.setText(method.concat(": ").concat(mobileNr));
}
}
@ -109,7 +109,7 @@ public class InteracETransferForm extends PaymentMethodForm {
public void addFormForDisplayAccount() {
gridRowFrom = gridRow;
addLabelTextField(gridPane, gridRow, "Account name:", interacETransferAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
addLabelTextField(gridPane, ++gridRow, "Payment method:", BSResources.get(interacETransferAccount.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++gridRow, "Payment method:", Res.get(interacETransferAccount.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++gridRow, "Account holder name:", interacETransferAccount.getHolderName());
addLabelTextField(gridPane, ++gridRow, "Email:", interacETransferAccount.getEmail()).second.setMouseTransparent(false);
addLabelTextField(gridPane, ++gridRow, "Secret question:", interacETransferAccount.getQuestion()).second.setMouseTransparent(false);

View file

@ -22,8 +22,8 @@ import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.gui.util.validation.InputValidator;
import io.bitsquare.gui.util.validation.OKPayValidator;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.CurrencyUtil;
import io.bitsquare.locale.Res;
import io.bitsquare.payment.OKPayAccount;
import io.bitsquare.payment.OKPayAccountContractData;
import io.bitsquare.payment.PaymentAccount;
@ -118,7 +118,7 @@ public class OKPayForm extends PaymentMethodForm {
if (useCustomAccountNameCheckBox != null && !useCustomAccountNameCheckBox.isSelected()) {
String accountNr = accountNrInputTextField.getText();
accountNr = StringUtils.abbreviate(accountNr, 9);
String method = BSResources.get(paymentAccount.getPaymentMethod().getId());
String method = Res.get(paymentAccount.getPaymentMethod().getId());
accountNameTextField.setText(method.concat(": ").concat(accountNr));
}
}
@ -127,7 +127,7 @@ public class OKPayForm extends PaymentMethodForm {
public void addFormForDisplayAccount() {
gridRowFrom = gridRow;
addLabelTextField(gridPane, gridRow, "Account name:", okPayAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
addLabelTextField(gridPane, ++gridRow, "Payment method:", BSResources.get(okPayAccount.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++gridRow, "Payment method:", Res.get(okPayAccount.getPaymentMethod().getId()));
TextField field = addLabelTextField(gridPane, ++gridRow, "Wallet ID:", okPayAccount.getAccountNr()).second;
field.setMouseTransparent(false);
addAllowedPeriod();

View file

@ -22,8 +22,8 @@ import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.gui.util.validation.InputValidator;
import io.bitsquare.gui.util.validation.PerfectMoneyValidator;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.FiatCurrency;
import io.bitsquare.locale.Res;
import io.bitsquare.payment.PaymentAccount;
import io.bitsquare.payment.PaymentAccountContractData;
import io.bitsquare.payment.PerfectMoneyAccount;
@ -80,7 +80,7 @@ public class PerfectMoneyForm extends PaymentMethodForm {
if (useCustomAccountNameCheckBox != null && !useCustomAccountNameCheckBox.isSelected()) {
String accountNr = accountNrInputTextField.getText();
accountNr = StringUtils.abbreviate(accountNr, 9);
String method = BSResources.get(paymentAccount.getPaymentMethod().getId());
String method = Res.get(paymentAccount.getPaymentMethod().getId());
accountNameTextField.setText(method.concat(": ").concat(accountNr));
}
}
@ -89,7 +89,7 @@ public class PerfectMoneyForm extends PaymentMethodForm {
public void addFormForDisplayAccount() {
gridRowFrom = gridRow;
addLabelTextField(gridPane, gridRow, "Account name:", perfectMoneyAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
addLabelTextField(gridPane, ++gridRow, "Payment method:", BSResources.get(perfectMoneyAccount.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++gridRow, "Payment method:", Res.get(perfectMoneyAccount.getPaymentMethod().getId()));
TextField field = addLabelTextField(gridPane, ++gridRow, "Account no.:", perfectMoneyAccount.getAccountNr()).second;
field.setMouseTransparent(false);

View file

@ -285,7 +285,7 @@ public class SepaForm extends PaymentMethodForm {
String iban = ibanInputTextField.getText();
if (iban.length() > 9)
iban = StringUtils.abbreviate(iban, 9);
String method = BSResources.get(paymentAccount.getPaymentMethod().getId());
String method = Res.get(paymentAccount.getPaymentMethod().getId());
CountryBasedPaymentAccount countryBasedPaymentAccount = (CountryBasedPaymentAccount) this.paymentAccount;
String country = countryBasedPaymentAccount.getCountry() != null ? countryBasedPaymentAccount.getCountry().code : null;
if (country != null)
@ -309,7 +309,7 @@ public class SepaForm extends PaymentMethodForm {
public void addFormForDisplayAccount() {
gridRowFrom = gridRow;
addLabelTextField(gridPane, gridRow, "Account name:", sepaAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
addLabelTextField(gridPane, ++gridRow, "Payment method:", BSResources.get(sepaAccount.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++gridRow, "Payment method:", Res.get(sepaAccount.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++gridRow, "Account holder name:", sepaAccount.getHolderName());
addLabelTextField(gridPane, ++gridRow, "IBAN:", sepaAccount.getIban()).second.setMouseTransparent(false);
addLabelTextField(gridPane, ++gridRow, "BIC:", sepaAccount.getBic()).second.setMouseTransparent(false);

View file

@ -22,7 +22,7 @@ import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.gui.util.validation.InputValidator;
import io.bitsquare.gui.util.validation.SwishValidator;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
import io.bitsquare.payment.PaymentAccount;
import io.bitsquare.payment.PaymentAccountContractData;
import io.bitsquare.payment.SwishAccount;
@ -83,7 +83,7 @@ public class SwishForm extends PaymentMethodForm {
if (useCustomAccountNameCheckBox != null && !useCustomAccountNameCheckBox.isSelected()) {
String mobileNr = mobileNrInputTextField.getText();
mobileNr = StringUtils.abbreviate(mobileNr, 9);
String method = BSResources.get(paymentAccount.getPaymentMethod().getId());
String method = Res.get(paymentAccount.getPaymentMethod().getId());
accountNameTextField.setText(method.concat(": ").concat(mobileNr));
}
}
@ -92,7 +92,7 @@ public class SwishForm extends PaymentMethodForm {
public void addFormForDisplayAccount() {
gridRowFrom = gridRow;
addLabelTextField(gridPane, gridRow, "Account name:", swishAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
addLabelTextField(gridPane, ++gridRow, "Payment method:", BSResources.get(swishAccount.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++gridRow, "Payment method:", Res.get(swishAccount.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++gridRow, "Account holder name:", swishAccount.getHolderName());
TextField field = addLabelTextField(gridPane, ++gridRow, "Mobile no.:", swishAccount.getMobileNr()).second;
field.setMouseTransparent(false);

View file

@ -22,7 +22,7 @@ import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.gui.util.validation.InputValidator;
import io.bitsquare.gui.util.validation.USPostalMoneyOrderValidator;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
import io.bitsquare.payment.PaymentAccount;
import io.bitsquare.payment.PaymentAccountContractData;
import io.bitsquare.payment.USPostalMoneyOrderAccount;
@ -88,7 +88,7 @@ public class USPostalMoneyOrderForm extends PaymentMethodForm {
if (useCustomAccountNameCheckBox != null && !useCustomAccountNameCheckBox.isSelected()) {
String postalAddress = postalAddressTextArea.getText();
postalAddress = StringUtils.abbreviate(postalAddress, 9);
String method = BSResources.get(paymentAccount.getPaymentMethod().getId());
String method = Res.get(paymentAccount.getPaymentMethod().getId());
accountNameTextField.setText(method.concat(": ").concat(postalAddress));
}
}
@ -97,7 +97,7 @@ public class USPostalMoneyOrderForm extends PaymentMethodForm {
public void addFormForDisplayAccount() {
gridRowFrom = gridRow;
addLabelTextField(gridPane, gridRow, "Account name:", usPostalMoneyOrderAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
addLabelTextField(gridPane, ++gridRow, "Payment method:", BSResources.get(usPostalMoneyOrderAccount.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++gridRow, "Payment method:", Res.get(usPostalMoneyOrderAccount.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++gridRow, "Account holder name:", usPostalMoneyOrderAccount.getHolderName());
TextArea textArea = addLabelTextArea(gridPane, ++gridRow, "Postal address:", "").second;
textArea.setText(usPostalMoneyOrderAccount.getPostalAddress());

View file

@ -40,7 +40,7 @@ import io.bitsquare.gui.main.settings.SettingsView;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.GUIUtil;
import io.bitsquare.gui.util.Transitions;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
import javafx.beans.value.ChangeListener;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
@ -127,15 +127,15 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
protected void initialize() {
MainView.rootContainer = this.root;
ToggleButton marketButton = new NavButton(MarketView.class, BSResources.get("mainView.menu.market"));
ToggleButton buyButton = new NavButton(BuyOfferView.class, BSResources.get("mainView.menu.buyBtc"));
ToggleButton sellButton = new NavButton(SellOfferView.class, BSResources.get("mainView.menu.sellBtc"));
ToggleButton portfolioButton = new NavButton(PortfolioView.class, BSResources.get("mainView.menu.portfolio"));
ToggleButton fundsButton = new NavButton(FundsView.class, BSResources.get("mainView.menu.funds"));
ToggleButton disputesButton = new NavButton(DisputesView.class, BSResources.get("mainView.menu.support"));
ToggleButton settingsButton = new NavButton(SettingsView.class, BSResources.get("mainView.menu.settings"));
ToggleButton accountButton = new NavButton(AccountView.class, BSResources.get("mainView.menu.account"));
ToggleButton daoButton = new NavButton(DaoView.class, BSResources.get("mainView.menu.dao"));
ToggleButton marketButton = new NavButton(MarketView.class, Res.get("mainView.menu.market"));
ToggleButton buyButton = new NavButton(BuyOfferView.class, Res.get("mainView.menu.buyBtc"));
ToggleButton sellButton = new NavButton(SellOfferView.class, Res.get("mainView.menu.sellBtc"));
ToggleButton portfolioButton = new NavButton(PortfolioView.class, Res.get("mainView.menu.portfolio"));
ToggleButton fundsButton = new NavButton(FundsView.class, Res.get("mainView.menu.funds"));
ToggleButton disputesButton = new NavButton(DisputesView.class, Res.get("mainView.menu.support"));
ToggleButton settingsButton = new NavButton(SettingsView.class, Res.get("mainView.menu.settings"));
ToggleButton accountButton = new NavButton(AccountView.class, Res.get("mainView.menu.account"));
ToggleButton daoButton = new NavButton(DaoView.class, Res.get("mainView.menu.dao"));
Pane portfolioButtonHolder = new Pane(portfolioButton);
Pane disputesButtonHolder = new Pane(disputesButton);
@ -162,19 +162,19 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
marketPriceBox.second.textProperty().bind(createStringBinding(
() -> {
PriceFeedService.Type type = model.typeProperty.get();
return type != null ? BSResources.get("mainView.marketPrice", type.name) : "";
return type != null ? Res.get("mainView.marketPrice", type.name) : "";
},
model.marketPriceCurrencyCode, model.typeProperty));
HBox.setMargin(marketPriceBox.third, new Insets(0, 0, 0, 0));
Tuple2<TextField, VBox> availableBalanceBox = getBalanceBox(BSResources.get("mainView.balance.available"));
Tuple2<TextField, VBox> availableBalanceBox = getBalanceBox(Res.get("mainView.balance.available"));
availableBalanceBox.first.textProperty().bind(model.availableBalance);
Tuple2<TextField, VBox> reservedBalanceBox = getBalanceBox(BSResources.get("mainView.balance.reserved"));
Tuple2<TextField, VBox> reservedBalanceBox = getBalanceBox(Res.get("mainView.balance.reserved"));
reservedBalanceBox.first.textProperty().bind(model.reservedBalance);
Tuple2<TextField, VBox> lockedBalanceBox = getBalanceBox(BSResources.get("mainView.balance.locked"));
Tuple2<TextField, VBox> lockedBalanceBox = getBalanceBox(Res.get("mainView.balance.locked"));
lockedBalanceBox.first.textProperty().bind(model.lockedBalance);
HBox rightNavPane = new HBox(marketPriceBox.third, availableBalanceBox.second, reservedBalanceBox.second, lockedBalanceBox.second,
@ -248,7 +248,7 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
"Please check if you have the latest version of Bitsquare installed.\n" +
"You can download it at:\nhttps://github.com/bitsquare/bitsquare/releases\n\n" +
"Please restart the application.")
.closeButtonText(BSResources.get("shared.shutDown"))
.closeButtonText(Res.get("shared.shutDown"))
.onClose(BitsquareApp.shutDownHandler::run)
.show();
} else {

View file

@ -30,7 +30,7 @@ import io.bitsquare.gui.util.FormBuilder;
import io.bitsquare.gui.util.ImageUtil;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.gui.util.validation.*;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
import io.bitsquare.payment.PaymentAccount;
import io.bitsquare.payment.PaymentAccountFactory;
import io.bitsquare.payment.PaymentMethod;
@ -244,7 +244,7 @@ public class FiatAccountsView extends ActivatableViewAndModel<GridPane, FiatAcco
paymentMethodComboBox.setConverter(new StringConverter<PaymentMethod>() {
@Override
public String toString(PaymentMethod paymentMethod) {
return paymentMethod != null ? BSResources.get(paymentMethod.getId()) : "";
return paymentMethod != null ? Res.get(paymentMethod.getId()) : "";
}
@Override

View file

@ -26,11 +26,9 @@ import io.bitsquare.gui.main.market.trades.charts.volume.VolumeChart;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.CurrencyListItem;
import io.bitsquare.gui.util.GUIUtil;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.CurrencyUtil;
import io.bitsquare.locale.Res;
import io.bitsquare.trade.statistics.TradeStatistics;
import java.util.Date;
import java.util.concurrent.TimeUnit;
import javafx.beans.property.ReadOnlyObjectWrapper;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
@ -49,7 +47,6 @@ import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
import javafx.util.Callback;
import javafx.util.StringConverter;
import javax.inject.Inject;
import org.bitcoinj.core.Coin;
import org.bitcoinj.utils.Fiat;
import org.fxmisc.easybind.EasyBind;
@ -59,6 +56,10 @@ import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.inject.Inject;
import java.util.Date;
import java.util.concurrent.TimeUnit;
@FxmlView
public class TradesChartsView extends ActivatableViewAndModel<VBox, TradesChartsViewModel> {
private static final Logger log = LoggerFactory.getLogger(TradesChartsView.class);
@ -623,6 +624,6 @@ public class TradesChartsView extends ActivatableViewAndModel<VBox, TradesCharts
@NotNull
private String getPaymentMethodLabel(TradeStatistics item) {
return BSResources.get(item.paymentMethod);
return Res.get(item.paymentMethod);
}
}

View file

@ -44,7 +44,7 @@ import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.FormBuilder;
import io.bitsquare.gui.util.GUIUtil;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
import io.bitsquare.locale.TradeCurrency;
import io.bitsquare.payment.PaymentAccount;
import io.bitsquare.trade.offer.Offer;
@ -173,7 +173,7 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
@Override
public String toString(PaymentAccount paymentAccount) {
return paymentAccount.getAccountName() + " (" + paymentAccount.getSingleTradeCurrency().getCode() + ", " +
BSResources.get(paymentAccount.getPaymentMethod().getId()) + ")";
Res.get(paymentAccount.getPaymentMethod().getId()) + ")";
}
@Override
@ -264,7 +264,7 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
} else {
imageView.setId("image-sell-large");
// only needed for sell
totalToPayTextField.setPromptText(BSResources.get("createOffer.fundsBox.totalsNeeded.prompt"));
totalToPayTextField.setPromptText(Res.get("createOffer.fundsBox.totalsNeeded.prompt"));
placeOfferButton.setId("sell-button-big");
placeOfferButton.setText("Review: Place offer to sell bitcoin");
@ -599,7 +599,7 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
};
errorMessageListener = (o, oldValue, newValue) -> {
if (newValue != null)
UserThread.runAfter(() -> new Popup().error(BSResources.get("createOffer.amountPriceBox.error.message", model.errorMessage.get()) +
UserThread.runAfter(() -> new Popup().error(Res.get("createOffer.amountPriceBox.error.message", model.errorMessage.get()) +
"\n\nNo funds have left your wallet yet.\n" +
"Please try to restart you application and check your network connection to see if you can resolve the issue.")
.show(), 100, TimeUnit.MILLISECONDS);
@ -644,8 +644,8 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
// We need a bit of delay to avoid issues with fade out/fade in of 2 popups
String key = "createOfferSuccessInfo";
if (preferences.showAgain(key)) {
UserThread.runAfter(() -> new Popup().headLine(BSResources.get("createOffer.success.headline"))
.feedback(BSResources.get("createOffer.success.info"))
UserThread.runAfter(() -> new Popup().headLine(Res.get("createOffer.success.headline"))
.feedback(Res.get("createOffer.success.info"))
.dontShowAgainId(key, preferences)
.actionButtonText("Go to \"My open offers\"")
.onAction(() -> {
@ -823,7 +823,7 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
addThirdRow();
Tuple2<Button, Button> tuple = add2ButtonsAfterGroup(gridPane, ++gridRow,
BSResources.get("createOffer.amountPriceBox.next"), BSResources.get("shared.cancel"));
Res.get("createOffer.amountPriceBox.next"), Res.get("shared.cancel"));
nextButton = tuple.first;
editOfferElements.add(nextButton);
nextButton.disableProperty().bind(model.isNextButtonDisabled);
@ -846,11 +846,11 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
private void addFundingGroup() {
// don't increase gridRow as we removed button when this gets visible
payFundsPane = addTitledGroupBg(gridPane, gridRow, 3, BSResources.get("createOffer.fundsBox.title"), Layout.GROUP_DISTANCE);
payFundsPane = addTitledGroupBg(gridPane, gridRow, 3, Res.get("createOffer.fundsBox.title"), Layout.GROUP_DISTANCE);
GridPane.setColumnSpan(payFundsPane, 3);
payFundsPane.setVisible(false);
totalToPayLabel = new Label(BSResources.get("createOffer.fundsBox.totalsNeeded"));
totalToPayLabel = new Label(Res.get("createOffer.fundsBox.totalsNeeded"));
totalToPayLabel.setVisible(false);
totalToPayInfoIconLabel = new Label();
totalToPayInfoIconLabel.setVisible(false);
@ -885,13 +885,13 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
GridPane.setMargin(qrCodeImageView, new Insets(Layout.FIRST_ROW_AND_GROUP_DISTANCE - 9, 0, 0, 5));
gridPane.getChildren().add(qrCodeImageView);
Tuple2<Label, AddressTextField> addressTuple = addLabelAddressTextField(gridPane, ++gridRow, BSResources.get("createOffer.fundsBox.address"));
Tuple2<Label, AddressTextField> addressTuple = addLabelAddressTextField(gridPane, ++gridRow, Res.get("createOffer.fundsBox.address"));
addressLabel = addressTuple.first;
addressLabel.setVisible(false);
addressTextField = addressTuple.second;
addressTextField.setVisible(false);
Tuple2<Label, BalanceTextField> balanceTuple = addLabelBalanceTextField(gridPane, ++gridRow, BSResources.get("createOffer.fundsBox.balance"));
Tuple2<Label, BalanceTextField> balanceTuple = addLabelBalanceTextField(gridPane, ++gridRow, Res.get("createOffer.fundsBox.balance"));
balanceLabel = balanceTuple.first;
balanceLabel.setVisible(false);
balanceTextField = balanceTuple.second;
@ -926,7 +926,7 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
placeOfferButton.setMinHeight(40);
placeOfferButton.setPadding(new Insets(0, 20, 0, 20));
cancelButton2 = addButton(gridPane, ++gridRow, BSResources.get("shared.cancel"));
cancelButton2 = addButton(gridPane, ++gridRow, Res.get("shared.cancel"));
cancelButton2.setOnAction(e -> {
if (model.dataModel.isWalletFunded.get()) {
new Popup().warning("You have already funded that offer.\n" +
@ -967,7 +967,7 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
private void addAmountPriceFields() {
// amountBox
Tuple3<HBox, InputTextField, Label> amountValueCurrencyBoxTuple = FormBuilder.getValueCurrencyBox(BSResources.get("createOffer.amount.prompt"));
Tuple3<HBox, InputTextField, Label> amountValueCurrencyBoxTuple = FormBuilder.getValueCurrencyBox(Res.get("createOffer.amount.prompt"));
HBox amountValueCurrencyBox = amountValueCurrencyBoxTuple.first;
amountTextField = amountValueCurrencyBoxTuple.second;
editOfferElements.add(amountTextField);
@ -986,7 +986,7 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
xLabel.setMaxWidth(14);
// price as percent
Tuple3<HBox, InputTextField, Label> priceAsPercentageTuple = FormBuilder.getValueCurrencyBox(BSResources.get("createOffer.price.prompt"));
Tuple3<HBox, InputTextField, Label> priceAsPercentageTuple = FormBuilder.getValueCurrencyBox(Res.get("createOffer.price.prompt"));
HBox priceAsPercentageValueCurrencyBox = priceAsPercentageTuple.first;
marketBasedPriceTextField = priceAsPercentageTuple.second;
editOfferElements.add(marketBasedPriceTextField);
@ -1024,7 +1024,7 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
resultLabel.setPadding(new Insets(14, 2, 0, 2));
// volume
Tuple3<HBox, InputTextField, Label> volumeValueCurrencyBoxTuple = FormBuilder.getValueCurrencyBox(BSResources.get("createOffer.volume.prompt"));
Tuple3<HBox, InputTextField, Label> volumeValueCurrencyBoxTuple = FormBuilder.getValueCurrencyBox(Res.get("createOffer.volume.prompt"));
HBox volumeValueCurrencyBox = volumeValueCurrencyBoxTuple.first;
volumeTextField = volumeValueCurrencyBoxTuple.second;
editOfferElements.add(volumeTextField);
@ -1089,7 +1089,7 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
private void addSecondRow() {
// price as fiat
Tuple3<HBox, InputTextField, Label> priceValueCurrencyBoxTuple = FormBuilder.getValueCurrencyBox(BSResources.get("createOffer.price.prompt"));
Tuple3<HBox, InputTextField, Label> priceValueCurrencyBoxTuple = FormBuilder.getValueCurrencyBox(Res.get("createOffer.price.prompt"));
HBox priceValueCurrencyBox = priceValueCurrencyBoxTuple.first;
fixedPriceTextField = priceValueCurrencyBoxTuple.second;
editOfferElements.add(fixedPriceTextField);
@ -1104,14 +1104,14 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
marketBasedPriceLabel.setText("%");
marketBasedPriceLabel.setStyle("-fx-alignment: center;");
Tuple3<HBox, InputTextField, Label> amountValueCurrencyBoxTuple = getValueCurrencyBox(BSResources.get("createOffer.amount.prompt"));
Tuple3<HBox, InputTextField, Label> amountValueCurrencyBoxTuple = getValueCurrencyBox(Res.get("createOffer.amount.prompt"));
HBox amountValueCurrencyBox = amountValueCurrencyBoxTuple.first;
minAmountTextField = amountValueCurrencyBoxTuple.second;
editOfferElements.add(minAmountTextField);
minAmountBtcLabel = amountValueCurrencyBoxTuple.third;
editOfferElements.add(minAmountBtcLabel);
Tuple2<Label, VBox> amountInputBoxTuple = getTradeInputBox(amountValueCurrencyBox, BSResources.get("createOffer.amountPriceBox" +
Tuple2<Label, VBox> amountInputBoxTuple = getTradeInputBox(amountValueCurrencyBox, Res.get("createOffer.amountPriceBox" +
".minAmountDescription"));
Label xLabel = new Label("x");
@ -1133,14 +1133,14 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
private void addThirdRow() {
// security deposit
Tuple3<HBox, InputTextField, Label> securityDepositTuple = FormBuilder.getValueCurrencyBox(
BSResources.get("createOffer.securityDeposit.prompt"));
Res.get("createOffer.securityDeposit.prompt"));
HBox securityDepositValueCurrencyBox = securityDepositTuple.first;
securityDepositTextField = securityDepositTuple.second;
editOfferElements.add(securityDepositTextField);
securityDepositBtcLabel = securityDepositTuple.third;
editOfferElements.add(securityDepositBtcLabel);
Tuple2<Label, VBox> securityDepositInputBoxTuple = getTradeInputBox(securityDepositValueCurrencyBox,
BSResources.get("createOffer.securityDepositBox.description"));
Res.get("createOffer.securityDepositBox.description"));
securityDepositDescriptionLabel = securityDepositInputBoxTuple.first;
editOfferElements.add(securityDepositDescriptionLabel);
VBox securityDepositBox = securityDepositInputBoxTuple.second;
@ -1181,17 +1181,17 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
int i = 0;
if (model.isSellOffer())
addPayInfoEntry(infoGridPane, i++, BSResources.get("createOffer.fundsBox.tradeAmount"), model.tradeAmount.get());
addPayInfoEntry(infoGridPane, i++, Res.get("createOffer.fundsBox.tradeAmount"), model.tradeAmount.get());
addPayInfoEntry(infoGridPane, i++, BSResources.get("createOffer.fundsBox.securityDeposit"), model.getSecurityDepositInfo());
addPayInfoEntry(infoGridPane, i++, BSResources.get("createOffer.fundsBox.offerFee"), model.getCreateOfferFee());
addPayInfoEntry(infoGridPane, i++, BSResources.get("createOffer.fundsBox.networkFee"), model.getTxFee());
addPayInfoEntry(infoGridPane, i++, Res.get("createOffer.fundsBox.securityDeposit"), model.getSecurityDepositInfo());
addPayInfoEntry(infoGridPane, i++, Res.get("createOffer.fundsBox.offerFee"), model.getCreateOfferFee());
addPayInfoEntry(infoGridPane, i++, Res.get("createOffer.fundsBox.networkFee"), model.getTxFee());
Separator separator = new Separator();
separator.setOrientation(Orientation.HORIZONTAL);
separator.setStyle("-fx-background: #666;");
GridPane.setConstraints(separator, 1, i++);
infoGridPane.getChildren().add(separator);
addPayInfoEntry(infoGridPane, i, BSResources.get("createOffer.fundsBox.total"), model.totalToPay.get());
addPayInfoEntry(infoGridPane, i, Res.get("createOffer.fundsBox.total"), model.totalToPay.get());
totalToPayInfoPopover = new PopOver(infoGridPane);
if (totalToPayInfoIconLabel.getScene() != null) {
totalToPayInfoPopover.setDetachable(false);

View file

@ -42,8 +42,8 @@ import io.bitsquare.gui.util.validation.BtcValidator;
import io.bitsquare.gui.util.validation.FiatValidator;
import io.bitsquare.gui.util.validation.InputValidator;
import io.bitsquare.gui.util.validation.SecurityDepositValidator;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.CurrencyUtil;
import io.bitsquare.locale.Res;
import io.bitsquare.locale.TradeCurrency;
import io.bitsquare.p2p.P2PService;
import io.bitsquare.payment.PaymentAccount;
@ -161,7 +161,7 @@ class CreateOfferViewModel extends ActivatableWithDataModel<CreateOfferDataModel
this.navigation = navigation;
this.formatter = formatter;
paymentLabel = BSResources.get("createOffer.fundsBox.paymentLabel", dataModel.shortOfferId);
paymentLabel = Res.get("createOffer.fundsBox.paymentLabel", dataModel.shortOfferId);
if (dataModel.getAddressEntry() != null) {
addressAsString = dataModel.getAddressEntry().getAddressString();
@ -198,11 +198,11 @@ class CreateOfferViewModel extends ActivatableWithDataModel<CreateOfferDataModel
updateButtonDisableState();
if (dataModel.getDirection() == Offer.Direction.BUY) {
directionLabel = BSResources.get("shared.buyBitcoin");
amountDescription = BSResources.get("createOffer.amountPriceBox.amountDescription", BSResources.get("shared.buy"));
directionLabel = Res.get("shared.buyBitcoin");
amountDescription = Res.get("createOffer.amountPriceBox.amountDescription", Res.get("shared.buy"));
} else {
directionLabel = BSResources.get("shared.sellBitcoin");
amountDescription = BSResources.get("createOffer.amountPriceBox.amountDescription", BSResources.get("shared.sell"));
directionLabel = Res.get("shared.sellBitcoin");
amountDescription = Res.get("createOffer.amountPriceBox.amountDescription", Res.get("shared.sell"));
}
securityDeposit.set(formatter.formatCoin(dataModel.securityDeposit.get()));
@ -220,15 +220,15 @@ class CreateOfferViewModel extends ActivatableWithDataModel<CreateOfferDataModel
private void addBindings() {
if (dataModel.getDirection() == Offer.Direction.BUY) {
volumeDescriptionLabel.bind(createStringBinding(
() -> BSResources.get("createOffer.amountPriceBox.buy.volumeDescription", dataModel.tradeCurrencyCode.get()),
() -> Res.get("createOffer.amountPriceBox.buy.volumeDescription", dataModel.tradeCurrencyCode.get()),
dataModel.tradeCurrencyCode));
} else {
volumeDescriptionLabel.bind(createStringBinding(
() -> BSResources.get("createOffer.amountPriceBox.sell.volumeDescription", dataModel.tradeCurrencyCode.get()),
() -> Res.get("createOffer.amountPriceBox.sell.volumeDescription", dataModel.tradeCurrencyCode.get()),
dataModel.tradeCurrencyCode));
}
volumePromptLabel.bind(createStringBinding(
() -> BSResources.get("createOffer.volume.prompt", dataModel.tradeCurrencyCode.get()),
() -> Res.get("createOffer.volume.prompt", dataModel.tradeCurrencyCode.get()),
dataModel.tradeCurrencyCode));
totalToPay.bind(createStringBinding(() -> formatter.formatCoinWithCode(dataModel.totalToPayAsCoin.get()),

View file

@ -37,8 +37,8 @@ import io.bitsquare.gui.main.overlays.windows.OfferDetailsWindow;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.GUIUtil;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.FiatCurrency;
import io.bitsquare.locale.Res;
import io.bitsquare.locale.TradeCurrency;
import io.bitsquare.payment.PaymentMethod;
import io.bitsquare.trade.offer.Offer;
@ -123,9 +123,9 @@ public class OfferBookView extends ActivatableViewAndModel<GridPane, OfferBookVi
if (id.equals(GUIUtil.SHOW_ALL_FLAG))
return "▶ Show all";
else if (paymentMethod.equals(PaymentMethod.BLOCK_CHAINS))
return "" + BSResources.get(id);
return "" + Res.get(id);
else
return "" + BSResources.get(id);
return "" + Res.get(id);
}
@Override

View file

@ -298,7 +298,7 @@ class OfferBookViewModel extends ActivatableViewModel {
String result = "";
if (item != null) {
Offer offer = item.getOffer();
String method = BSResources.get(offer.getPaymentMethod().getId() + "_SHORT");
String method = Res.get(offer.getPaymentMethod().getId() + "_SHORT");
String methodCountryCode = offer.getCountryCode();
if (methodCountryCode != null)
@ -313,7 +313,7 @@ class OfferBookViewModel extends ActivatableViewModel {
String result = "";
if (item != null) {
Offer offer = item.getOffer();
result = "Payment method: " + BSResources.get(offer.getPaymentMethod().getId());
result = "Payment method: " + Res.get(offer.getPaymentMethod().getId());
result += "\nCurrency: " + CurrencyUtil.getNameAndCode(offer.getCurrencyCode());
String methodCountryCode = offer.getCountryCode();

View file

@ -44,7 +44,7 @@ import io.bitsquare.gui.main.portfolio.pendingtrades.PendingTradesView;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.GUIUtil;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
import io.bitsquare.payment.PaymentAccount;
import io.bitsquare.trade.offer.Offer;
import io.bitsquare.user.Preferences;
@ -182,7 +182,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
volumeCurrencyLabel.setText(model.dataModel.getCurrencyCode());
String currencyCode = model.dataModel.getCurrencyCode();
priceDescriptionLabel.setText(BSResources.get("createOffer.amountPriceBox.priceDescriptionFiat", currencyCode));
priceDescriptionLabel.setText(Res.get("createOffer.amountPriceBox.priceDescriptionFiat", currencyCode));
/* priceDescriptionLabel.setText(CurrencyUtil.isCryptoCurrency(currencyCode) ?
BSResources.get("createOffer.amountPriceBox.priceDescriptionAltcoin", currencyCode) :
BSResources.get("createOffer.amountPriceBox.priceDescriptionFiat", currencyCode));*/
@ -247,7 +247,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
paymentMethodLabel.setVisible(!showComboBox);
paymentMethodLabel.setManaged(!showComboBox);
if (!showComboBox)
paymentMethodTextField.setText(BSResources.get(model.getPaymentMethod().getId()));
paymentMethodTextField.setText(Res.get(model.getPaymentMethod().getId()));
currencyTextField.setText(model.dataModel.getCurrencyNameAndCode());
directionLabel.setText(model.getDirectionLabel());
amountDescriptionLabel.setText(model.getAmountDescription());
@ -491,7 +491,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
errorMessageSubscription = EasyBind.subscribe(model.errorMessage, newValue -> {
if (newValue != null) {
new Popup().error(BSResources.get("takeOffer.error.message", model.errorMessage.get()) +
new Popup().error(Res.get("takeOffer.error.message", model.errorMessage.get()) +
"Please try to restart you application and check your network connection to see if you can resolve the issue.")
.onClose(() -> {
errorPopupDisplayed.set(true);
@ -518,7 +518,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
showWarningInvalidBtcDecimalPlacesSubscription = EasyBind.subscribe(model.showWarningInvalidBtcDecimalPlaces, newValue -> {
if (newValue) {
new Popup().warning(BSResources.get("takeOffer.amountPriceBox.warning.invalidBtcDecimalPlaces")).show();
new Popup().warning(Res.get("takeOffer.amountPriceBox.warning.invalidBtcDecimalPlaces")).show();
model.showWarningInvalidBtcDecimalPlaces.set(false);
}
});
@ -529,8 +529,8 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
} else if (newValue && model.getTrade() != null && model.getTrade().errorMessageProperty().get() == null) {
String key = "takeOfferSuccessInfo";
if (preferences.showAgain(key)) {
UserThread.runAfter(() -> new Popup().headLine(BSResources.get("takeOffer.success.headline"))
.feedback(BSResources.get("takeOffer.success.info"))
UserThread.runAfter(() -> new Popup().headLine(Res.get("takeOffer.success.headline"))
.feedback(Res.get("takeOffer.success.info"))
.actionButtonText("Go to \"Open trades\"")
.dontShowAgainId(key, preferences)
.onAction(() -> {
@ -636,7 +636,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
@Override
public String toString(PaymentAccount paymentAccount) {
return paymentAccount.getAccountName() + " (" + paymentAccount.getSingleTradeCurrency().getCode() + ", " +
BSResources.get(paymentAccount.getPaymentMethod().getId()) + ")";
Res.get(paymentAccount.getPaymentMethod().getId()) + ")";
}
@Override
@ -678,13 +678,13 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
HBox hBox = new HBox();
hBox.setSpacing(10);
nextButton = new Button(BSResources.get("takeOffer.amountPriceBox.next"));
nextButton = new Button(Res.get("takeOffer.amountPriceBox.next"));
nextButton.setDefaultButton(true);
nextButton.setOnAction(e -> onShowPayFundsScreen());
//UserThread.runAfter(() -> nextButton.requestFocus(), 100, TimeUnit.MILLISECONDS);
cancelButton1 = new Button(BSResources.get("shared.cancel"));
cancelButton1 = new Button(Res.get("shared.cancel"));
cancelButton1.setDefaultButton(false);
cancelButton1.setId("cancel-button");
cancelButton1.setOnAction(e -> {
@ -693,7 +693,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
});
offerAvailabilityBusyAnimation = new BusyAnimation();
offerAvailabilityLabel = new Label(BSResources.get("takeOffer.fundsBox.isOfferAvailable"));
offerAvailabilityLabel = new Label(Res.get("takeOffer.fundsBox.isOfferAvailable"));
hBox.setAlignment(Pos.CENTER_LEFT);
hBox.getChildren().addAll(nextButton, cancelButton1, offerAvailabilityBusyAnimation, offerAvailabilityLabel);
@ -706,11 +706,11 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
private void addFundingGroup() {
// don't increase gridRow as we removed button when this gets visible
payFundsPane = addTitledGroupBg(gridPane, gridRow, 3, BSResources.get("takeOffer.fundsBox.title"), Layout.GROUP_DISTANCE);
payFundsPane = addTitledGroupBg(gridPane, gridRow, 3, Res.get("takeOffer.fundsBox.title"), Layout.GROUP_DISTANCE);
GridPane.setColumnSpan(payFundsPane, 3);
payFundsPane.setVisible(false);
totalToPayLabel = new Label(BSResources.get("takeOffer.fundsBox.totalsNeeded"));
totalToPayLabel = new Label(Res.get("takeOffer.fundsBox.totalsNeeded"));
totalToPayLabel.setVisible(false);
totalToPayInfoIconLabel = new Label();
totalToPayInfoIconLabel.setVisible(false);
@ -724,7 +724,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
totalToPayTextField = new TextFieldWithCopyIcon();
totalToPayTextField.setFocusTraversable(false);
totalToPayTextField.setVisible(false);
totalToPayTextField.setPromptText(BSResources.get("createOffer.fundsBox.totalsNeeded.prompt"));
totalToPayTextField.setPromptText(Res.get("createOffer.fundsBox.totalsNeeded.prompt"));
totalToPayTextField.setCopyWithoutCurrencyPostFix(true);
GridPane.setRowIndex(totalToPayTextField, gridRow);
GridPane.setColumnIndex(totalToPayTextField, 1);
@ -746,13 +746,13 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
GridPane.setMargin(qrCodeImageView, new Insets(Layout.FIRST_ROW_AND_GROUP_DISTANCE - 9, 0, 0, 5));
gridPane.getChildren().add(qrCodeImageView);
Tuple2<Label, AddressTextField> addressTuple = addLabelAddressTextField(gridPane, ++gridRow, BSResources.get("takeOffer.fundsBox.address"));
Tuple2<Label, AddressTextField> addressTuple = addLabelAddressTextField(gridPane, ++gridRow, Res.get("takeOffer.fundsBox.address"));
addressLabel = addressTuple.first;
addressLabel.setVisible(false);
addressTextField = addressTuple.second;
addressTextField.setVisible(false);
Tuple2<Label, BalanceTextField> balanceTuple = addLabelBalanceTextField(gridPane, ++gridRow, BSResources.get("takeOffer.fundsBox.balance"));
Tuple2<Label, BalanceTextField> balanceTuple = addLabelBalanceTextField(gridPane, ++gridRow, Res.get("takeOffer.fundsBox.balance"));
balanceLabel = balanceTuple.first;
balanceLabel.setVisible(false);
balanceTextField = balanceTuple.second;
@ -787,7 +787,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
takeOfferButton.setPadding(new Insets(0, 20, 0, 20));
takeOfferButton.setOnAction(e -> onTakeOffer());
cancelButton2 = addButton(gridPane, ++gridRow, BSResources.get("shared.cancel"));
cancelButton2 = addButton(gridPane, ++gridRow, Res.get("shared.cancel"));
cancelButton2.setOnAction(e -> {
if (model.dataModel.isWalletFunded.get()) {
new Popup().warning("You have already funded that offer.\n" +
@ -829,7 +829,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
private void addAmountPriceFields() {
// amountBox
Tuple3<HBox, InputTextField, Label> amountValueCurrencyBoxTuple = getAmountCurrencyBox(BSResources.get("takeOffer.amount.prompt"));
Tuple3<HBox, InputTextField, Label> amountValueCurrencyBoxTuple = getAmountCurrencyBox(Res.get("takeOffer.amount.prompt"));
HBox amountValueCurrencyBox = amountValueCurrencyBoxTuple.first;
amountTextField = amountValueCurrencyBoxTuple.second;
amountBtcLabel = amountValueCurrencyBoxTuple.third;
@ -847,7 +847,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
HBox priceValueCurrencyBox = priceValueCurrencyBoxTuple.first;
priceTextField = priceValueCurrencyBoxTuple.second;
priceCurrencyLabel = priceValueCurrencyBoxTuple.third;
Tuple2<Label, VBox> priceInputBoxTuple = getTradeInputBox(priceValueCurrencyBox, BSResources.get("takeOffer.amountPriceBox.priceDescription"));
Tuple2<Label, VBox> priceInputBoxTuple = getTradeInputBox(priceValueCurrencyBox, Res.get("takeOffer.amountPriceBox.priceDescription"));
priceDescriptionLabel = priceInputBoxTuple.first;
VBox priceBox = priceInputBoxTuple.second;
@ -896,7 +896,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
amountRangeTextField = amountValueCurrencyBoxTuple.second;
amountRangeBtcLabel = amountValueCurrencyBoxTuple.third;
Tuple2<Label, VBox> amountInputBoxTuple = getTradeInputBox(amountValueCurrencyBox, BSResources.get("takeOffer.amountPriceBox.amountRangeDescription"));
Tuple2<Label, VBox> amountInputBoxTuple = getTradeInputBox(amountValueCurrencyBox, Res.get("takeOffer.amountPriceBox.amountRangeDescription"));
Label xLabel = new Label("x");
xLabel.setFont(Font.font("Helvetica-Bold", 20));
@ -909,7 +909,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
securityDepositTextField = securityDepositValueCurrencyBoxTuple.second;
securityDepositBtcLabel = securityDepositValueCurrencyBoxTuple.third;
Tuple2<Label, VBox> securityDepositInputBoxTuple = getTradeInputBox(securityDepositValueCurrencyBox,
BSResources.get("takeOffer.securityDepositBox.description"));
Res.get("takeOffer.securityDepositBox.description"));
Label resultLabel = new Label("=");
resultLabel.setFont(Font.font("Helvetica-Bold", 20));
@ -996,17 +996,17 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
int i = 0;
if (model.isSeller())
addPayInfoEntry(infoGridPane, i++, BSResources.get("takeOffer.fundsBox.tradeAmount"), model.getTradeAmount());
addPayInfoEntry(infoGridPane, i++, Res.get("takeOffer.fundsBox.tradeAmount"), model.getTradeAmount());
addPayInfoEntry(infoGridPane, i++, BSResources.get("takeOffer.fundsBox.securityDeposit"), model.getSecurityDepositInfo());
addPayInfoEntry(infoGridPane, i++, BSResources.get("takeOffer.fundsBox.offerFee"), model.getTakerFee());
addPayInfoEntry(infoGridPane, i++, BSResources.get("takeOffer.fundsBox.networkFee"), model.getTxFee());
addPayInfoEntry(infoGridPane, i++, Res.get("takeOffer.fundsBox.securityDeposit"), model.getSecurityDepositInfo());
addPayInfoEntry(infoGridPane, i++, Res.get("takeOffer.fundsBox.offerFee"), model.getTakerFee());
addPayInfoEntry(infoGridPane, i++, Res.get("takeOffer.fundsBox.networkFee"), model.getTxFee());
Separator separator = new Separator();
separator.setOrientation(Orientation.HORIZONTAL);
separator.setStyle("-fx-background: #666;");
GridPane.setConstraints(separator, 1, i++);
infoGridPane.getChildren().add(separator);
addPayInfoEntry(infoGridPane, i, BSResources.get("takeOffer.fundsBox.total"),
addPayInfoEntry(infoGridPane, i, Res.get("takeOffer.fundsBox.total"),
model.totalToPay.get());
totalToPayInfoPopover = new PopOver(infoGridPane);
if (totalToPayInfoIconLabel.getScene() != null) {

View file

@ -30,7 +30,7 @@ import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.GUIUtil;
import io.bitsquare.gui.util.validation.BtcValidator;
import io.bitsquare.gui.util.validation.InputValidator;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
import io.bitsquare.p2p.P2PService;
import io.bitsquare.p2p.network.CloseConnectionReason;
import io.bitsquare.p2p.network.Connection;
@ -156,17 +156,17 @@ class TakeOfferViewModel extends ActivatableWithDataModel<TakeOfferDataModel> im
this.offer = offer;
if (offer.getDirection() == Offer.Direction.BUY) {
directionLabel = BSResources.get("shared.sellBitcoin");
amountDescription = BSResources.get("takeOffer.amountPriceBox.buy.amountDescription");
directionLabel = Res.get("shared.sellBitcoin");
amountDescription = Res.get("takeOffer.amountPriceBox.buy.amountDescription");
} else {
directionLabel = BSResources.get("shared.buyBitcoin");
amountDescription = BSResources.get("takeOffer.amountPriceBox.sell.amountDescription");
directionLabel = Res.get("shared.buyBitcoin");
amountDescription = Res.get("takeOffer.amountPriceBox.sell.amountDescription");
}
amountRange = formatter.formatCoin(offer.getMinAmount()) + " - " + formatter.formatCoin(offer.getAmount());
price = formatter.formatPrice(dataModel.tradePrice);
marketPriceMargin = formatter.formatPercentagePrice(offer.getMarketPriceMargin());
paymentLabel = BSResources.get("takeOffer.fundsBox.paymentLabel", offer.getShortId());
paymentLabel = Res.get("takeOffer.fundsBox.paymentLabel", offer.getShortId());
checkNotNull(dataModel.getAddressEntry(), "dataModel.getAddressEntry() must not be null");
@ -254,15 +254,15 @@ class TakeOfferViewModel extends ActivatableWithDataModel<TakeOfferDataModel> im
if (!dataModel.isMinAmountLessOrEqualAmount())
amountValidationResult.set(new InputValidator.ValidationResult(false,
BSResources.get("takeOffer.validation.amountSmallerThanMinAmount")));
Res.get("takeOffer.validation.amountSmallerThanMinAmount")));
if (dataModel.isAmountLargerThanOfferAmount())
amountValidationResult.set(new InputValidator.ValidationResult(false,
BSResources.get("takeOffer.validation.amountLargerThanOfferAmount")));
Res.get("takeOffer.validation.amountLargerThanOfferAmount")));
if (dataModel.wouldCreateDustForOfferer())
amountValidationResult.set(new InputValidator.ValidationResult(false,
BSResources.get("takeOffer.validation.amountLargerThanOfferAmountMinusFee")));
Res.get("takeOffer.validation.amountLargerThanOfferAmountMinusFee")));
}
}
}
@ -404,9 +404,9 @@ class TakeOfferViewModel extends ActivatableWithDataModel<TakeOfferDataModel> im
volume.bind(createStringBinding(() -> formatter.formatVolume(dataModel.volumeAsFiat.get()), dataModel.volumeAsFiat));
if (dataModel.getDirection() == Offer.Direction.SELL) {
volumeDescriptionLabel.set(BSResources.get("createOffer.amountPriceBox.buy.volumeDescription", dataModel.getCurrencyCode()));
volumeDescriptionLabel.set(Res.get("createOffer.amountPriceBox.buy.volumeDescription", dataModel.getCurrencyCode()));
} else {
volumeDescriptionLabel.set(BSResources.get("createOffer.amountPriceBox.sell.volumeDescription", dataModel.getCurrencyCode()));
volumeDescriptionLabel.set(Res.get("createOffer.amountPriceBox.sell.volumeDescription", dataModel.getCurrencyCode()));
}
totalToPay.bind(createStringBinding(() -> formatter.formatCoinWithCode(dataModel.totalToPayAsCoin.get()), dataModel.totalToPayAsCoin));
btcCode.bind(dataModel.btcCode);

View file

@ -24,7 +24,7 @@ import io.bitsquare.gui.components.BusyAnimation;
import io.bitsquare.gui.main.MainView;
import io.bitsquare.gui.util.GUIUtil;
import io.bitsquare.gui.util.Transitions;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
import io.bitsquare.user.Preferences;
import javafx.animation.Interpolator;
import javafx.animation.KeyFrame;
@ -624,7 +624,7 @@ public abstract class Overlay<T extends Overlay> {
if (headLine != null) {
++rowIndex;
headLineLabel = new Label(BSResources.get(headLine));
headLineLabel = new Label(Res.get(headLine));
headLineLabel.setMouseTransparent(true);
if (headlineStyle != null)

View file

@ -24,8 +24,8 @@ import io.bitsquare.gui.main.MainView;
import io.bitsquare.gui.main.overlays.Overlay;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.CountryUtil;
import io.bitsquare.locale.Res;
import io.bitsquare.payment.PaymentAccountContractData;
import io.bitsquare.payment.PaymentMethod;
import io.bitsquare.trade.Contract;
@ -131,9 +131,9 @@ public class ContractWindow extends Overlay<ContractWindow> {
addLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, "No. of disputes BTC buyer / BTC seller:", disputeManager.getNrOfDisputes(true, contract) + " / " + disputeManager.getNrOfDisputes(false, contract));
addLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, "BTC buyer payment details:",
BSResources.get(contract.getBuyerPaymentAccountContractData().getPaymentDetails())).second.setMouseTransparent(false);
Res.get(contract.getBuyerPaymentAccountContractData().getPaymentDetails())).second.setMouseTransparent(false);
addLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, "BTC seller payment details:",
BSResources.get(sellerPaymentAccountContractData.getPaymentDetails())).second.setMouseTransparent(false);
Res.get(sellerPaymentAccountContractData.getPaymentDetails())).second.setMouseTransparent(false);
addLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, "Selected arbitrator:", contract.arbitratorNodeAddress.getFullAddress());

View file

@ -30,9 +30,9 @@ import io.bitsquare.gui.main.overlays.Overlay;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.BankUtil;
import io.bitsquare.locale.CountryUtil;
import io.bitsquare.locale.Res;
import io.bitsquare.payment.PaymentAccount;
import io.bitsquare.payment.PaymentMethod;
import io.bitsquare.trade.offer.Offer;
@ -209,7 +209,7 @@ public class OfferDetailsWindow extends Overlay<OfferDetailsWindow> {
if (offer.isMyOffer(keyRing) && offererPaymentAccountId != null && paymentAccount != null) {
addLabelTextField(gridPane, ++rowIndex, "My trading account:", paymentAccount.getAccountName());
} else {
final String method = BSResources.get(paymentMethod.getId());
final String method = Res.get(paymentMethod.getId());
if (isNationalBanks || isSpecificBanks || isSepa) {
if (BankUtil.isBankIdRequired(offer.getCountryCode()))
addLabelTextField(gridPane, ++rowIndex, "Payment method (offerer's bank ID):", method + bankId);
@ -315,7 +315,7 @@ public class OfferDetailsWindow extends Overlay<OfferDetailsWindow> {
busyAnimation = placeOfferTuple.second;
Label spinnerInfoLabel = placeOfferTuple.third;
Button cancelButton = addButton(gridPane, ++rowIndex, BSResources.get("shared.cancel"));
Button cancelButton = addButton(gridPane, ++rowIndex, Res.get("shared.cancel"));
cancelButton.setDefaultButton(false);
cancelButton.setId("cancel-button");
cancelButton.setOnAction(e -> {
@ -329,10 +329,10 @@ public class OfferDetailsWindow extends Overlay<OfferDetailsWindow> {
cancelButton.setDisable(true);
busyAnimation.play();
if (isPlaceOffer) {
spinnerInfoLabel.setText(BSResources.get("createOffer.fundsBox.placeOfferSpinnerInfo"));
spinnerInfoLabel.setText(Res.get("createOffer.fundsBox.placeOfferSpinnerInfo"));
placeOfferHandlerOptional.get().run();
} else {
spinnerInfoLabel.setText(BSResources.get("takeOffer.fundsBox.takeOfferSpinnerInfo"));
spinnerInfoLabel.setText(Res.get("takeOffer.fundsBox.takeOfferSpinnerInfo"));
takeOfferHandlerOptional.get().run();
}
} else {

View file

@ -23,7 +23,7 @@ import io.bitsquare.gui.main.MainView;
import io.bitsquare.gui.main.overlays.Overlay;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
import io.bitsquare.payment.PaymentAccountContractData;
import io.bitsquare.trade.Contract;
import io.bitsquare.trade.Trade;
@ -127,7 +127,7 @@ public class TradeDetailsWindow extends Overlay<TradeDetailsWindow> {
addLabelTextField(gridPane, ++rowIndex, "Bitcoin amount" + btcDirectionInfo, formatter.formatCoinWithCode(trade.getTradeAmount()));
addLabelTextField(gridPane, ++rowIndex, formatter.formatVolumeLabel(offer.getCurrencyCode()) + fiatDirectionInfo, formatter.formatVolumeWithCode(trade.getTradeVolume()));
addLabelTextField(gridPane, ++rowIndex, "Trade price:", formatter.formatPrice(trade.getTradePrice()));
addLabelTextField(gridPane, ++rowIndex, "Payment method:", BSResources.get(offer.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++rowIndex, "Payment method:", Res.get(offer.getPaymentMethod().getId()));
// second group
rows = 6;
@ -180,15 +180,15 @@ public class TradeDetailsWindow extends Overlay<TradeDetailsWindow> {
if (contract != null) {
if (buyerPaymentAccountContractData != null) {
TextFieldWithCopyIcon tf = addLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, "BTC buyer payment details:", BSResources.get(buyerPaymentAccountContractData.getPaymentDetails())).second;
TextFieldWithCopyIcon tf = addLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, "BTC buyer payment details:", Res.get(buyerPaymentAccountContractData.getPaymentDetails())).second;
tf.setTooltip(new Tooltip(tf.getText()));
}
if (sellerPaymentAccountContractData != null) {
TextFieldWithCopyIcon tf = addLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, "BTC seller payment details:", BSResources.get(sellerPaymentAccountContractData.getPaymentDetails())).second;
TextFieldWithCopyIcon tf = addLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, "BTC seller payment details:", Res.get(sellerPaymentAccountContractData.getPaymentDetails())).second;
tf.setTooltip(new Tooltip(tf.getText()));
}
if (buyerPaymentAccountContractData == null && sellerPaymentAccountContractData == null)
addLabelTextField(gridPane, ++rowIndex, "Payment method:", BSResources.get(contract.getPaymentMethodName()));
addLabelTextField(gridPane, ++rowIndex, "Payment method:", Res.get(contract.getPaymentMethodName()));
}
addLabelTxIdTextField(gridPane, ++rowIndex, "Offer fee transaction ID:", offer.getOfferFeePaymentTxID());

View file

@ -29,7 +29,7 @@ import io.bitsquare.gui.main.overlays.Overlay;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.util.Transitions;
import io.bitsquare.gui.util.validation.PasswordValidator;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.value.ChangeListener;
@ -252,7 +252,7 @@ public class WalletPasswordWindow extends Overlay<WalletPasswordWindow> {
}
private void showRestoreScreen() {
Label headLine2Label = new Label(BSResources.get("Restore wallet from seed words"));
Label headLine2Label = new Label(Res.get("Restore wallet from seed words"));
headLine2Label.setId("popup-headline");
headLine2Label.setMouseTransparent(true);
GridPane.setHalignment(headLine2Label, HPos.LEFT);

View file

@ -24,7 +24,7 @@ import io.bitsquare.gui.common.model.ActivatableWithDataModel;
import io.bitsquare.gui.common.model.ViewModel;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.validation.BtcAddressValidator;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
import io.bitsquare.p2p.P2PService;
import io.bitsquare.payment.PaymentMethod;
import io.bitsquare.trade.Contract;
@ -223,7 +223,7 @@ public class PendingTradesViewModel extends ActivatableWithDataModel<PendingTrad
String result = "";
if (item != null) {
Offer offer = item.getTrade().getOffer();
String method = BSResources.get(offer.getPaymentMethod().getId() + "_SHORT");
String method = Res.get(offer.getPaymentMethod().getId() + "_SHORT");
String methodCountryCode = offer.getCountryCode();
if (methodCountryCode != null)
@ -248,7 +248,7 @@ public class PendingTradesViewModel extends ActivatableWithDataModel<PendingTrad
public String getPaymentMethod() {
if (dataModel.getTrade() != null && dataModel.getTrade().getContract() != null)
return BSResources.get(dataModel.getTrade().getContract().getPaymentMethodName());
return Res.get(dataModel.getTrade().getContract().getPaymentMethodName());
else
return "";
}

View file

@ -27,8 +27,8 @@ import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.main.portfolio.pendingtrades.PendingTradesViewModel;
import io.bitsquare.gui.main.portfolio.pendingtrades.steps.TradeStepView;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.CurrencyUtil;
import io.bitsquare.locale.Res;
import io.bitsquare.payment.*;
import io.bitsquare.trade.Trade;
import javafx.scene.control.Button;
@ -155,7 +155,7 @@ public class BuyerStep2View extends TradeStepView {
PaymentAccountContractData paymentAccountContractData = model.dataModel.getSellersPaymentAccountContractData();
String paymentMethodName = paymentAccountContractData != null ? paymentAccountContractData.getPaymentMethodName() : "";
TitledGroupBg accountTitledGroupBg = addTitledGroupBg(gridPane, ++gridRow, 1,
"Start payment using " + BSResources.get(paymentMethodName),
"Start payment using " + Res.get(paymentMethodName),
Layout.GROUP_DISTANCE);
TextFieldWithCopyIcon field = addLabelTextFieldWithCopyIcon(gridPane, gridRow, "Amount to transfer:",
model.getFiatVolume(),

View file

@ -18,8 +18,8 @@
package io.bitsquare.gui.util.validation;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.BankUtil;
import io.bitsquare.locale.Res;
import org.apache.commons.lang3.StringUtils;
public final class AccountNrValidator extends BankValidator {
@ -37,17 +37,17 @@ public final class AccountNrValidator extends BankValidator {
if (isNumberWithFixedLength(input, length))
return super.validate(input);
else
return new ValidationResult(false, BSResources.get("validation.accountNr", length));
return new ValidationResult(false, Res.get("validation.accountNr", length));
case "US":
if (isNumberInRange(input, 4, 17))
return super.validate(input);
else
return new ValidationResult(false, BSResources.get("validation.accountNr", "4 - 17"));
return new ValidationResult(false, Res.get("validation.accountNr", "4 - 17"));
case "BR":
if (isStringInRange(input, 1, 20))
return super.validate(input);
else
return new ValidationResult(false, BSResources.get("validation.accountNrChars", "1 - 20"));
return new ValidationResult(false, Res.get("validation.accountNrChars", "1 - 20"));
case "NZ":
input2 = input != null ? input.replaceAll("-", "") : null;
if (isNumberInRange(input2, 15, 16))
@ -58,18 +58,18 @@ public final class AccountNrValidator extends BankValidator {
if (isNumberInRange(input, 4, 10))
return super.validate(input);
else
return new ValidationResult(false, BSResources.get("validation.accountNr", "4 - 10"));
return new ValidationResult(false, Res.get("validation.accountNr", "4 - 10"));
case "CA":
if (isNumberInRange(input, 7, 12))
return super.validate(input);
else
return new ValidationResult(false, BSResources.get("validation.accountNr", "7 - 12"));
return new ValidationResult(false, Res.get("validation.accountNr", "7 - 12"));
case "MX":
length = 18;
if (isNumberWithFixedLength(input, length))
return super.validate(input);
else
return new ValidationResult(false, BSResources.get("validation.sortCodeNumber", getLabel(), length));
return new ValidationResult(false, Res.get("validation.sortCodeNumber", getLabel(), length));
case "HK":
input2 = input != null ? input.replaceAll("-", "") : null;
if (isNumberInRange(input2, 9, 12))
@ -93,7 +93,7 @@ public final class AccountNrValidator extends BankValidator {
input2 = StringUtils.remove(input2, ".");
// 11 digits, numbers only
if (input2.length() != length || !StringUtils.isNumeric(input2))
return new ValidationResult(false, BSResources.get("validation.sortCodeNumber", getLabel(), length));
return new ValidationResult(false, Res.get("validation.sortCodeNumber", getLabel(), length));
int lastDigit = Character.getNumericValue(input2.charAt(input2.length() - 1));
if (getMod11ControlDigit(input2) != lastDigit)
return new ValidationResult(false, "Kontonummer har feil sjekksum");

View file

@ -18,8 +18,8 @@
package io.bitsquare.gui.util.validation;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.BankUtil;
import io.bitsquare.locale.Res;
public final class BankIdValidator extends BankValidator {
public BankIdValidator(String countryCode) {
@ -36,13 +36,13 @@ public final class BankIdValidator extends BankValidator {
if (isNumberWithFixedLength(input, length))
return super.validate(input);
else
return new ValidationResult(false, BSResources.get("validation.bankIdNumber", getLabel(), length));
return new ValidationResult(false, Res.get("validation.bankIdNumber", getLabel(), length));
case "HK":
length = 3;
if (isNumberWithFixedLength(input, length))
return super.validate(input);
else
return new ValidationResult(false, BSResources.get("validation.bankIdNumber", getLabel(), length));
return new ValidationResult(false, Res.get("validation.bankIdNumber", getLabel(), length));
default:
return super.validate(input);
}

View file

@ -18,8 +18,8 @@
package io.bitsquare.gui.util.validation;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.BankUtil;
import io.bitsquare.locale.Res;
public final class BranchIdValidator extends BankValidator {
@ -37,30 +37,30 @@ public final class BranchIdValidator extends BankValidator {
if (isNumberWithFixedLength(input, length))
return super.validate(input);
else
return new ValidationResult(false, BSResources.get("validation.sortCodeNumber", getLabel(), length));
return new ValidationResult(false, Res.get("validation.sortCodeNumber", getLabel(), length));
case "US":
length = 9;
if (isNumberWithFixedLength(input, length))
return super.validate(input);
else
return new ValidationResult(false, BSResources.get("validation.sortCodeNumber", getLabel(), length));
return new ValidationResult(false, Res.get("validation.sortCodeNumber", getLabel(), length));
case "BR":
if (isStringInRange(input, 2, 6))
return super.validate(input);
else
return new ValidationResult(false, BSResources.get("validation.sortCodeChars", getLabel(), "2 - 6"));
return new ValidationResult(false, Res.get("validation.sortCodeChars", getLabel(), "2 - 6"));
case "AU":
length = 6;
if (isNumberWithFixedLength(input, length))
return super.validate(input);
else
return new ValidationResult(false, BSResources.get("validation.sortCodeChars", getLabel(), length));
return new ValidationResult(false, Res.get("validation.sortCodeChars", getLabel(), length));
case "CA":
length = 5;
if (isNumberWithFixedLength(input, length))
return super.validate(input);
else
return new ValidationResult(false, BSResources.get("validation.sortCodeNumber", getLabel(), length));
return new ValidationResult(false, Res.get("validation.sortCodeNumber", getLabel(), length));
default:
return super.validate(input);
}

View file

@ -18,7 +18,7 @@
package io.bitsquare.gui.util.validation;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
import org.bitcoinj.core.Coin;
import javax.annotation.Nullable;
@ -64,7 +64,7 @@ public class BtcValidator extends NumberValidator {
BigDecimal bd = new BigDecimal(input);
final BigDecimal satoshis = bd.movePointRight(8);
if (satoshis.scale() > 0)
return new ValidationResult(false, BSResources.get("validation.btc.toSmall"));
return new ValidationResult(false, Res.get("validation.btc.toSmall"));
else
return new ValidationResult(true);
}
@ -73,7 +73,7 @@ public class BtcValidator extends NumberValidator {
try {
final Coin coin = Coin.parseCoin(input);
if (maxValueInBitcoin != null && coin.compareTo(maxValueInBitcoin) > 0)
return new ValidationResult(false, BSResources.get("validation.btc.toLarge", formatter.formatCoinWithCode(maxValueInBitcoin)));
return new ValidationResult(false, Res.get("validation.btc.toLarge", formatter.formatCoinWithCode(maxValueInBitcoin)));
else
return new ValidationResult(true);
} catch (Throwable t) {

View file

@ -17,7 +17,7 @@
package io.bitsquare.gui.util.validation;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
import javax.inject.Inject;
@ -57,7 +57,7 @@ public class FiatValidator extends NumberValidator {
protected ValidationResult validateIfNotExceedsMinFiatValue(String input) {
double d = Double.parseDouble(input);
if (d < minValue)
return new ValidationResult(false, BSResources.get("validation.fiat.toSmall"));
return new ValidationResult(false, Res.get("validation.fiat.toSmall"));
else
return new ValidationResult(true);
}
@ -65,7 +65,7 @@ public class FiatValidator extends NumberValidator {
protected ValidationResult validateIfNotExceedsMaxFiatValue(String input) {
double d = Double.parseDouble(input);
if (d > maxValue)
return new ValidationResult(false, BSResources.get("validation.fiat.toLarge"));
return new ValidationResult(false, Res.get("validation.fiat.toLarge"));
else
return new ValidationResult(true);
}

View file

@ -17,7 +17,7 @@
package io.bitsquare.gui.util.validation;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
public class InputValidator {
@ -27,7 +27,7 @@ public class InputValidator {
protected ValidationResult validateIfNotEmpty(String input) {
if (input == null || input.length() == 0)
return new ValidationResult(false, BSResources.get("validation.empty"));
return new ValidationResult(false, Res.get("validation.empty"));
else
return new ValidationResult(true);
}

View file

@ -17,7 +17,7 @@
package io.bitsquare.gui.util.validation;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
/**
* NumberValidator for validating basic number values.
@ -37,20 +37,20 @@ public abstract class NumberValidator extends InputValidator {
Double.parseDouble(input);
return new ValidationResult(true);
} catch (Exception e) {
return new ValidationResult(false, BSResources.get("validation.NaN"));
return new ValidationResult(false, Res.get("validation.NaN"));
}
}
protected ValidationResult validateIfNotZero(String input) {
if (Double.parseDouble(input) == 0)
return new ValidationResult(false, BSResources.get("validation.zero"));
return new ValidationResult(false, Res.get("validation.zero"));
else
return new ValidationResult(true);
}
protected ValidationResult validateIfNotNegative(String input) {
if (Double.parseDouble(input) < 0)
return new ValidationResult(false, BSResources.get("validation.negative"));
return new ValidationResult(false, Res.get("validation.negative"));
else
return new ValidationResult(true);
}

View file

@ -17,7 +17,7 @@
package io.bitsquare.gui.util.validation;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
public final class PasswordValidator extends InputValidator {
@ -41,9 +41,9 @@ public final class PasswordValidator extends InputValidator {
private ValidationResult validateMinLength(String input) {
if (input.length() < 8)
return new ValidationResult(false, BSResources.get("validation.passwordTooShort"));
return new ValidationResult(false, Res.get("validation.passwordTooShort"));
else if (input.length() > 50)
return new ValidationResult(false, BSResources.get("validation.passwordTooLong"));
return new ValidationResult(false, Res.get("validation.passwordTooLong"));
else
return new ValidationResult(true);
}

View file

@ -19,7 +19,7 @@ package io.bitsquare.gui.util.validation;
import io.bitsquare.btc.Restrictions;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Res;
import org.bitcoinj.core.Coin;
import javax.inject.Inject;
@ -59,7 +59,7 @@ public class SecurityDepositValidator extends BtcValidator {
Coin minSecurityDeposit = Restrictions.MIN_SECURITY_DEPOSIT;
if (coin.compareTo(minSecurityDeposit) < 0)
return new ValidationResult(false,
BSResources.get("validation.securityDeposit.toSmall", formatter.formatCoinWithCode(minSecurityDeposit)));
Res.get("validation.securityDeposit.toSmall", formatter.formatCoinWithCode(minSecurityDeposit)));
else
return new ValidationResult(true);
} catch (Throwable t) {