Make access package local

This commit is contained in:
Manfred Karrer 2014-09-17 20:15:14 +02:00
parent c668d3578d
commit e04ed033e0
34 changed files with 138 additions and 123 deletions

View file

@ -327,7 +327,7 @@ public class MainViewCB extends ViewCB<MainPM> {
addBankAccountComboBox(rightNavPane); addBankAccountComboBox(rightNavPane);
settingsButton = addNavButton(rightNavPane, "Settings", Navigation.Item.SETTINGS); settingsButton = addNavButton(rightNavPane, "Preferences", Navigation.Item.SETTINGS);
accountButton = addNavButton(rightNavPane, "Account", Navigation.Item.ACCOUNT); accountButton = addNavButton(rightNavPane, "Account", Navigation.Item.ACCOUNT);
onMainNavigationAdded(); onMainNavigationAdded();

View file

@ -25,7 +25,7 @@ import com.google.inject.Inject;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class AccountModel extends UIModel { class AccountModel extends UIModel {
private static final Logger log = LoggerFactory.getLogger(AccountModel.class); private static final Logger log = LoggerFactory.getLogger(AccountModel.class);
private final User user; private final User user;
@ -73,7 +73,7 @@ public class AccountModel extends UIModel {
// Getters // Getters
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
public boolean getNeedRegistration() { boolean getNeedRegistration() {
return user.getAccountId() == null; return user.getAccountId() == null;
} }

View file

@ -24,7 +24,7 @@ import com.google.inject.Inject;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class AccountPM extends PresentationModel<AccountModel> { class AccountPM extends PresentationModel<AccountModel> {
private static final Logger log = LoggerFactory.getLogger(AccountPM.class); private static final Logger log = LoggerFactory.getLogger(AccountPM.class);
@ -70,7 +70,7 @@ public class AccountPM extends PresentationModel<AccountModel> {
// Getters // Getters
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
public boolean getNeedRegistration() { boolean getNeedRegistration() {
return model.getNeedRegistration(); return model.getNeedRegistration();
} }

View file

@ -37,11 +37,11 @@ import javafx.scene.layout.*;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class AccountViewCB extends CachedViewCB<AccountPM> { class AccountViewCB extends CachedViewCB<AccountPM> {
private static final Logger log = LoggerFactory.getLogger(AccountViewCB.class); private static final Logger log = LoggerFactory.getLogger(AccountViewCB.class);
public Tab tab; Tab tab;
private Navigation navigation; private Navigation navigation;
private Navigation.Listener listener; private Navigation.Listener listener;
@ -62,7 +62,6 @@ public class AccountViewCB extends CachedViewCB<AccountPM> {
// Lifecycle // Lifecycle
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@SuppressWarnings("EmptyMethod")
@Override @Override
public void initialize(URL url, ResourceBundle rb) { public void initialize(URL url, ResourceBundle rb) {
listener = navigationItems -> { listener = navigationItems -> {

View file

@ -24,7 +24,7 @@ import com.google.inject.Inject;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class ChangePasswordModel extends UIModel { class ChangePasswordModel extends UIModel {
private static final Logger log = LoggerFactory.getLogger(ChangePasswordModel.class); private static final Logger log = LoggerFactory.getLogger(ChangePasswordModel.class);
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@ -69,7 +69,7 @@ public class ChangePasswordModel extends UIModel {
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@SuppressWarnings("EmptyMethod") @SuppressWarnings("EmptyMethod")
public void savePassword(String password) { void savePassword(String password) {
//TODO Implement password encryption for wallet //TODO Implement password encryption for wallet
} }

View file

@ -31,16 +31,16 @@ import javafx.beans.property.StringProperty;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class ChangePasswordPM extends PresentationModel<ChangePasswordModel> { class ChangePasswordPM extends PresentationModel<ChangePasswordModel> {
private static final Logger log = LoggerFactory.getLogger(ChangePasswordPM.class); private static final Logger log = LoggerFactory.getLogger(ChangePasswordPM.class);
private final PasswordValidator passwordValidator; private final PasswordValidator passwordValidator;
private String errorMessage; private String errorMessage;
public final StringProperty passwordField = new SimpleStringProperty(); final StringProperty passwordField = new SimpleStringProperty();
public final StringProperty repeatedPasswordField = new SimpleStringProperty(); final StringProperty repeatedPasswordField = new SimpleStringProperty();
public final BooleanProperty saveButtonDisabled = new SimpleBooleanProperty(true); final BooleanProperty saveButtonDisabled = new SimpleBooleanProperty(true);
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@ -89,7 +89,7 @@ public class ChangePasswordPM extends PresentationModel<ChangePasswordModel> {
// Public // Public
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
public boolean requestSavePassword() { boolean requestSavePassword() {
if (validate()) { if (validate()) {
model.savePassword(passwordField.get()); model.savePassword(passwordField.get());
return true; return true;
@ -97,7 +97,7 @@ public class ChangePasswordPM extends PresentationModel<ChangePasswordModel> {
return false; return false;
} }
public String getErrorMessage() { String getErrorMessage() {
return errorMessage; return errorMessage;
} }

View file

@ -36,7 +36,7 @@ import javafx.scene.layout.*;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class ChangePasswordViewCB extends CachedViewCB<ChangePasswordPM> implements ContextAware { class ChangePasswordViewCB extends CachedViewCB<ChangePasswordPM> implements ContextAware {
private static final Logger log = LoggerFactory.getLogger(ChangePasswordViewCB.class); private static final Logger log = LoggerFactory.getLogger(ChangePasswordViewCB.class);
@ -89,7 +89,7 @@ public class ChangePasswordViewCB extends CachedViewCB<ChangePasswordPM> impleme
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
// Override // ContextAware implementation
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@Override @Override

View file

@ -44,7 +44,7 @@ import javafx.collections.ObservableList;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class FiatAccountModel extends UIModel { class FiatAccountModel extends UIModel {
private static final Logger log = LoggerFactory.getLogger(FiatAccountModel.class); private static final Logger log = LoggerFactory.getLogger(FiatAccountModel.class);
private final User user; private final User user;

View file

@ -43,7 +43,7 @@ import javafx.util.StringConverter;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class FiatAccountPm extends PresentationModel<FiatAccountModel> { class FiatAccountPm extends PresentationModel<FiatAccountModel> {
private static final Logger log = LoggerFactory.getLogger(FiatAccountPm.class); private static final Logger log = LoggerFactory.getLogger(FiatAccountPm.class);
private final BankAccountNumberValidator bankAccountNumberValidator; private final BankAccountNumberValidator bankAccountNumberValidator;

View file

@ -123,7 +123,7 @@ public class FiatAccountViewCB extends CachedViewCB<FiatAccountPm> implements Co
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
// Override // ContextAware implementation
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@Override @Override

View file

@ -24,7 +24,7 @@ import com.google.inject.Inject;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class PasswordModel extends UIModel { class PasswordModel extends UIModel {
private static final Logger log = LoggerFactory.getLogger(PasswordModel.class); private static final Logger log = LoggerFactory.getLogger(PasswordModel.class);
@ -70,7 +70,7 @@ public class PasswordModel extends UIModel {
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@SuppressWarnings("EmptyMethod") @SuppressWarnings("EmptyMethod")
public void savePassword(String password) { void savePassword(String password) {
//TODO Implement password encryption for wallet //TODO Implement password encryption for wallet
} }

View file

@ -31,16 +31,16 @@ import javafx.beans.property.StringProperty;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class PasswordPM extends PresentationModel<PasswordModel> { class PasswordPM extends PresentationModel<PasswordModel> {
private static final Logger log = LoggerFactory.getLogger(PasswordPM.class); private static final Logger log = LoggerFactory.getLogger(PasswordPM.class);
private final PasswordValidator passwordValidator; private final PasswordValidator passwordValidator;
private String errorMessage; private String errorMessage;
public final StringProperty passwordField = new SimpleStringProperty(); final StringProperty passwordField = new SimpleStringProperty();
public final StringProperty repeatedPasswordField = new SimpleStringProperty(); final StringProperty repeatedPasswordField = new SimpleStringProperty();
public final BooleanProperty saveButtonDisabled = new SimpleBooleanProperty(true); final BooleanProperty saveButtonDisabled = new SimpleBooleanProperty(true);
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@ -89,7 +89,7 @@ public class PasswordPM extends PresentationModel<PasswordModel> {
// Public // Public
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
public boolean requestSavePassword() { boolean requestSavePassword() {
if (validate()) { if (validate()) {
model.savePassword(passwordField.get()); model.savePassword(passwordField.get());
return true; return true;
@ -97,7 +97,7 @@ public class PasswordPM extends PresentationModel<PasswordModel> {
return false; return false;
} }
public String getErrorMessage() { String getErrorMessage() {
return errorMessage; return errorMessage;
} }

View file

@ -89,7 +89,7 @@ public class PasswordViewCB extends CachedViewCB<PasswordPM> implements ContextA
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
// Override // ContextAware implementation
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@Override @Override

View file

@ -45,7 +45,7 @@ import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class RegistrationModel extends UIModel { class RegistrationModel extends UIModel {
private static final Logger log = LoggerFactory.getLogger(RegistrationModel.class); private static final Logger log = LoggerFactory.getLogger(RegistrationModel.class);
private final WalletFacade walletFacade; private final WalletFacade walletFacade;
@ -55,9 +55,9 @@ public class RegistrationModel extends UIModel {
private String transactionId; private String transactionId;
private AddressEntry addressEntry; private AddressEntry addressEntry;
public final BooleanProperty isWalletFunded = new SimpleBooleanProperty(); final BooleanProperty isWalletFunded = new SimpleBooleanProperty();
public final BooleanProperty payFeeSuccess = new SimpleBooleanProperty(); final BooleanProperty payFeeSuccess = new SimpleBooleanProperty();
public final StringProperty payFeeErrorMessage = new SimpleStringProperty(); final StringProperty payFeeErrorMessage = new SimpleStringProperty();
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@ -116,7 +116,7 @@ public class RegistrationModel extends UIModel {
// Methods // Methods
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
public void payFee() { void payFee() {
FutureCallback<Transaction> callback = new FutureCallback<Transaction>() { FutureCallback<Transaction> callback = new FutureCallback<Transaction>() {
@Override @Override
public void onSuccess(@Nullable Transaction transaction) { public void onSuccess(@Nullable Transaction transaction) {
@ -151,19 +151,19 @@ public class RegistrationModel extends UIModel {
// Getters // Getters
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
public WalletFacade getWalletFacade() { WalletFacade getWalletFacade() {
return walletFacade; return walletFacade;
} }
public Coin getFeeAsCoin() { Coin getFeeAsCoin() {
return FeePolicy.REGISTRATION_FEE; return FeePolicy.REGISTRATION_FEE;
} }
public String getTransactionId() { String getTransactionId() {
return transactionId; return transactionId;
} }
public AddressEntry getAddressEntry() { AddressEntry getAddressEntry() {
return addressEntry; return addressEntry;
} }

View file

@ -38,15 +38,15 @@ import org.slf4j.LoggerFactory;
import static io.bitsquare.gui.util.BSFormatter.formatCoinWithCode; import static io.bitsquare.gui.util.BSFormatter.formatCoinWithCode;
public class RegistrationPM extends PresentationModel<RegistrationModel> { class RegistrationPM extends PresentationModel<RegistrationModel> {
private static final Logger log = LoggerFactory.getLogger(RegistrationPM.class); private static final Logger log = LoggerFactory.getLogger(RegistrationPM.class);
public final BooleanProperty isPayButtonDisabled = new SimpleBooleanProperty(true); final BooleanProperty isPayButtonDisabled = new SimpleBooleanProperty(true);
public final StringProperty requestPlaceOfferErrorMessage = new SimpleStringProperty(); final StringProperty requestPlaceOfferErrorMessage = new SimpleStringProperty();
public final BooleanProperty showTransactionPublishedScreen = new SimpleBooleanProperty(); final BooleanProperty showTransactionPublishedScreen = new SimpleBooleanProperty();
// That is needed for the addressTextField // That is needed for the addressTextField
public final ObjectProperty<Address> address = new SimpleObjectProperty<>(); final ObjectProperty<Address> address = new SimpleObjectProperty<>();
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@ -106,7 +106,7 @@ public class RegistrationPM extends PresentationModel<RegistrationModel> {
// UI actions // UI actions
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
public void payFee() { void payFee() {
model.payFeeErrorMessage.set(null); model.payFeeErrorMessage.set(null);
model.payFeeSuccess.set(false); model.payFeeSuccess.set(false);
@ -120,27 +120,27 @@ public class RegistrationPM extends PresentationModel<RegistrationModel> {
// Getters // Getters
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
public WalletFacade getWalletFacade() { WalletFacade getWalletFacade() {
return model.getWalletFacade(); return model.getWalletFacade();
} }
public Coin getFeeAsCoin() { Coin getFeeAsCoin() {
return model.getFeeAsCoin(); return model.getFeeAsCoin();
} }
public String getAddressAsString() { String getAddressAsString() {
return model.getAddressEntry() != null ? model.getAddressEntry().getAddress().toString() : ""; return model.getAddressEntry() != null ? model.getAddressEntry().getAddress().toString() : "";
} }
public String getPaymentLabel() { String getPaymentLabel() {
return BSResources.get("Bitsquare account registration fee"); return BSResources.get("Bitsquare account registration fee");
} }
public String getFeeAsString() { String getFeeAsString() {
return formatCoinWithCode(model.getFeeAsCoin()); return formatCoinWithCode(model.getFeeAsCoin());
} }
public String getTransactionId() { String getTransactionId() {
return model.getTransactionId(); return model.getTransactionId();
} }

View file

@ -48,6 +48,7 @@ import org.controlsfx.dialog.Dialog;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class RegistrationViewCB extends CachedViewCB<RegistrationPM> implements ContextAware { public class RegistrationViewCB extends CachedViewCB<RegistrationPM> implements ContextAware {
private static final Logger log = LoggerFactory.getLogger(RegistrationViewCB.class); private static final Logger log = LoggerFactory.getLogger(RegistrationViewCB.class);
@ -140,7 +141,6 @@ public class RegistrationViewCB extends CachedViewCB<RegistrationPM> implements
@Override @Override
public void activate() { public void activate() {
super.activate(); super.activate();
} }
@SuppressWarnings("EmptyMethod") @SuppressWarnings("EmptyMethod")
@ -157,7 +157,7 @@ public class RegistrationViewCB extends CachedViewCB<RegistrationPM> implements
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
// Override // ContextAware implementation
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@Override @Override

View file

@ -45,7 +45,7 @@ import javafx.collections.ObservableList;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class RestrictionsModel extends UIModel { class RestrictionsModel extends UIModel {
private static final Logger log = LoggerFactory.getLogger(RestrictionsModel.class); private static final Logger log = LoggerFactory.getLogger(RestrictionsModel.class);
private final User user; private final User user;
@ -53,12 +53,12 @@ public class RestrictionsModel extends UIModel {
private final Persistence persistence; private final Persistence persistence;
private final MessageFacade messageFacade; private final MessageFacade messageFacade;
public final ObservableList<Locale> languageList = FXCollections.observableArrayList(); final ObservableList<Locale> languageList = FXCollections.observableArrayList();
public final ObservableList<Country> countryList = FXCollections.observableArrayList(); final ObservableList<Country> countryList = FXCollections.observableArrayList();
public final ObservableList<Arbitrator> arbitratorList = FXCollections.observableArrayList(); final ObservableList<Arbitrator> arbitratorList = FXCollections.observableArrayList();
public final ObservableList<Locale> allLanguages = FXCollections.observableArrayList(LanguageUtil final ObservableList<Locale> allLanguages = FXCollections.observableArrayList(LanguageUtil
.getAllLanguageLocales()); .getAllLanguageLocales());
public final ObservableList<Region> allRegions = FXCollections.observableArrayList(CountryUtil.getAllRegions()); final ObservableList<Region> allRegions = FXCollections.observableArrayList(CountryUtil.getAllRegions());
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@ -125,28 +125,28 @@ public class RestrictionsModel extends UIModel {
// Public // Public
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
public ObservableList<Country> getAllCountriesFor(Region selectedRegion) { ObservableList<Country> getAllCountriesFor(Region selectedRegion) {
return FXCollections.observableArrayList(CountryUtil.getAllCountriesFor(selectedRegion)); return FXCollections.observableArrayList(CountryUtil.getAllCountriesFor(selectedRegion));
} }
public void updateArbitratorList() { void updateArbitratorList() {
arbitratorList.setAll(settings.getAcceptedArbitrators()); arbitratorList.setAll(settings.getAcceptedArbitrators());
} }
public void addLanguage(Locale locale) { void addLanguage(Locale locale) {
if (locale != null && !languageList.contains(locale)) { if (locale != null && !languageList.contains(locale)) {
languageList.add(locale); languageList.add(locale);
settings.addAcceptedLanguageLocale(locale); settings.addAcceptedLanguageLocale(locale);
} }
} }
public void removeLanguage(Locale locale) { void removeLanguage(Locale locale) {
languageList.remove(locale); languageList.remove(locale);
settings.removeAcceptedLanguageLocale(locale); settings.removeAcceptedLanguageLocale(locale);
saveSettings(); saveSettings();
} }
public void addCountry(Country country) { void addCountry(Country country) {
if (!countryList.contains(country) && country != null) { if (!countryList.contains(country) && country != null) {
countryList.add(country); countryList.add(country);
settings.addAcceptedCountry(country); settings.addAcceptedCountry(country);
@ -154,7 +154,7 @@ public class RestrictionsModel extends UIModel {
} }
} }
public ObservableList<Country> getListWithAllEuroCountries() { ObservableList<Country> getListWithAllEuroCountries() {
// TODO use Set instead of List // TODO use Set instead of List
// In addAcceptedCountry there is a check to no add duplicates, so it works correctly for now // In addAcceptedCountry there is a check to no add duplicates, so it works correctly for now
CountryUtil.getAllEuroCountries().stream().forEach(settings::addAcceptedCountry); CountryUtil.getAllEuroCountries().stream().forEach(settings::addAcceptedCountry);
@ -163,13 +163,13 @@ public class RestrictionsModel extends UIModel {
return countryList; return countryList;
} }
public void removeCountry(Country country) { void removeCountry(Country country) {
countryList.remove(country); countryList.remove(country);
settings.removeAcceptedCountry(country); settings.removeAcceptedCountry(country);
saveSettings(); saveSettings();
} }
public void removeArbitrator(Arbitrator arbitrator) { void removeArbitrator(Arbitrator arbitrator) {
arbitratorList.remove(arbitrator); arbitratorList.remove(arbitrator);
settings.removeAcceptedArbitrator(arbitrator); settings.removeAcceptedArbitrator(arbitrator);
saveSettings(); saveSettings();

View file

@ -33,10 +33,10 @@ import javafx.collections.ObservableList;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class RestrictionsPM extends PresentationModel<RestrictionsModel> { class RestrictionsPM extends PresentationModel<RestrictionsModel> {
private static final Logger log = LoggerFactory.getLogger(RestrictionsPM.class); private static final Logger log = LoggerFactory.getLogger(RestrictionsPM.class);
public final BooleanProperty doneButtonDisable = new SimpleBooleanProperty(true); final BooleanProperty doneButtonDisable = new SimpleBooleanProperty(true);
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@ -78,32 +78,32 @@ public class RestrictionsPM extends PresentationModel<RestrictionsModel> {
// Public // Public
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
public void addLanguage(Locale locale) { void addLanguage(Locale locale) {
model.addLanguage(locale); model.addLanguage(locale);
updateDoneButtonDisableState(); updateDoneButtonDisableState();
} }
public void removeLanguage(Locale locale) { void removeLanguage(Locale locale) {
model.removeLanguage(locale); model.removeLanguage(locale);
updateDoneButtonDisableState(); updateDoneButtonDisableState();
} }
public void addCountry(Country country) { void addCountry(Country country) {
model.addCountry(country); model.addCountry(country);
updateDoneButtonDisableState(); updateDoneButtonDisableState();
} }
public void removeCountry(Country country) { void removeCountry(Country country) {
model.removeCountry(country); model.removeCountry(country);
updateDoneButtonDisableState(); updateDoneButtonDisableState();
} }
public void removeArbitrator(Arbitrator arbitrator) { void removeArbitrator(Arbitrator arbitrator) {
model.removeArbitrator(arbitrator); model.removeArbitrator(arbitrator);
updateDoneButtonDisableState(); updateDoneButtonDisableState();
} }
public void updateArbitratorList() { void updateArbitratorList() {
model.updateArbitratorList(); model.updateArbitratorList();
updateDoneButtonDisableState(); updateDoneButtonDisableState();
} }
@ -113,31 +113,31 @@ public class RestrictionsPM extends PresentationModel<RestrictionsModel> {
// Getters // Getters
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
public ObservableList<Country> getListWithAllEuroCountries() { ObservableList<Country> getListWithAllEuroCountries() {
return model.getListWithAllEuroCountries(); return model.getListWithAllEuroCountries();
} }
public ObservableList<Country> getAllCountriesFor(Region selectedRegion) { ObservableList<Country> getAllCountriesFor(Region selectedRegion) {
return model.getAllCountriesFor(selectedRegion); return model.getAllCountriesFor(selectedRegion);
} }
public ObservableList<Locale> getLanguageList() { ObservableList<Locale> getLanguageList() {
return model.languageList; return model.languageList;
} }
public ObservableList<Region> getAllRegions() { ObservableList<Region> getAllRegions() {
return model.allRegions; return model.allRegions;
} }
public ObservableList<Locale> getAllLanguages() { ObservableList<Locale> getAllLanguages() {
return model.allLanguages; return model.allLanguages;
} }
public ObservableList<Country> getCountryList() { ObservableList<Country> getCountryList() {
return model.countryList; return model.countryList;
} }
public ObservableList<Arbitrator> getArbitratorList() { ObservableList<Arbitrator> getArbitratorList() {
return model.arbitratorList; return model.arbitratorList;
} }

View file

@ -112,7 +112,7 @@ public class RestrictionsViewCB extends CachedViewCB<RestrictionsPM> implements
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
// Override // ContextAware implementation
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@Override @Override

View file

@ -27,7 +27,7 @@ import java.util.List;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class SeedWordsModel extends UIModel { class SeedWordsModel extends UIModel {
private static final Logger log = LoggerFactory.getLogger(SeedWordsModel.class); private static final Logger log = LoggerFactory.getLogger(SeedWordsModel.class);
private List<String> mnemonicCode; private List<String> mnemonicCode;
@ -76,7 +76,7 @@ public class SeedWordsModel extends UIModel {
// Getter // Getter
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
public List<String> getMnemonicCode() { List<String> getMnemonicCode() {
return mnemonicCode; return mnemonicCode;
} }
} }

View file

@ -28,10 +28,10 @@ import javafx.beans.property.StringProperty;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class SeedWordsPM extends PresentationModel<SeedWordsModel> { class SeedWordsPM extends PresentationModel<SeedWordsModel> {
private static final Logger log = LoggerFactory.getLogger(SeedWordsPM.class); private static final Logger log = LoggerFactory.getLogger(SeedWordsPM.class);
public final StringProperty seedWords = new SimpleStringProperty(); final StringProperty seedWords = new SimpleStringProperty();
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////

View file

@ -85,7 +85,7 @@ public class SeedWordsViewCB extends CachedViewCB<SeedWordsPM> implements Contex
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
// Override // ContextAware implementation
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@Override @Override

View file

@ -24,7 +24,7 @@ import com.google.inject.Inject;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class AccountSettingsModel extends UIModel { class AccountSettingsModel extends UIModel {
private static final Logger log = LoggerFactory.getLogger(AccountSettingsModel.class); private static final Logger log = LoggerFactory.getLogger(AccountSettingsModel.class);

View file

@ -24,7 +24,7 @@ import com.google.inject.Inject;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class AccountSettingsPM extends PresentationModel<AccountSettingsModel> { class AccountSettingsPM extends PresentationModel<AccountSettingsModel> {
private static final Logger log = LoggerFactory.getLogger(AccountSettingsPM.class); private static final Logger log = LoggerFactory.getLogger(AccountSettingsPM.class);

View file

@ -45,7 +45,7 @@ import de.jensd.fx.fontawesome.AwesomeIcon;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class AccountSettingsViewCB extends CachedViewCB<AccountSettingsPM> { class AccountSettingsViewCB extends CachedViewCB<AccountSettingsPM> {
private static final Logger log = LoggerFactory.getLogger(AccountSettingsViewCB.class); private static final Logger log = LoggerFactory.getLogger(AccountSettingsViewCB.class);

View file

@ -24,7 +24,7 @@ import com.google.inject.Inject;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class AccountSetupModel extends UIModel { class AccountSetupModel extends UIModel {
private static final Logger log = LoggerFactory.getLogger(AccountSetupModel.class); private static final Logger log = LoggerFactory.getLogger(AccountSetupModel.class);

View file

@ -24,7 +24,7 @@ import com.google.inject.Inject;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class AccountSetupPM extends PresentationModel<AccountSetupModel> { class AccountSetupPM extends PresentationModel<AccountSetupModel> {
private static final Logger log = LoggerFactory.getLogger(AccountSetupPM.class); private static final Logger log = LoggerFactory.getLogger(AccountSetupPM.class);

View file

@ -48,7 +48,7 @@ import javafx.scene.layout.*;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class AccountSetupViewCB extends CachedViewCB<AccountSetupPM> implements MultiStepNavigation { class AccountSetupViewCB extends CachedViewCB<AccountSetupPM> implements MultiStepNavigation {
private static final Logger log = LoggerFactory.getLogger(AccountSetupViewCB.class); private static final Logger log = LoggerFactory.getLogger(AccountSetupViewCB.class);
@ -130,9 +130,10 @@ public class AccountSetupViewCB extends CachedViewCB<AccountSetupPM> implements
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
// UI handlers // MultiStepNavigation implementation
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@Override
public void nextStep(ViewCB<? extends PresentationModel> childView) { public void nextStep(ViewCB<? extends PresentationModel> childView) {
if (childView instanceof SeedWordsViewCB) { if (childView instanceof SeedWordsViewCB) {
seedWords.onCompleted(); seedWords.onCompleted();

View file

@ -18,7 +18,7 @@
package io.bitsquare.gui.main.home; package io.bitsquare.gui.main.home;
import io.bitsquare.BitSquare; import io.bitsquare.BitSquare;
import io.bitsquare.gui.CachedViewController; import io.bitsquare.gui.CachedViewCB;
import io.bitsquare.gui.Navigation; import io.bitsquare.gui.Navigation;
import io.bitsquare.gui.main.arbitrators.registration.ArbitratorRegistrationController; import io.bitsquare.gui.main.arbitrators.registration.ArbitratorRegistrationController;
import io.bitsquare.util.ViewLoader; import io.bitsquare.util.ViewLoader;
@ -36,29 +36,33 @@ import javafx.stage.Modality;
import javafx.stage.Stage; import javafx.stage.Stage;
// home is just hosting the arbiters buttons yet, but that's just for dev, not clear yet what will be in home, // 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, new, charts,... -> low prio // probably overview, event history, news, charts,... -> low prio
public class HomeController extends CachedViewController { public class HomeController extends CachedViewCB {
private ArbitratorRegistrationController arbitratorRegistrationController; private ArbitratorRegistrationController arbitratorRegistrationController;
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
// Lifecycle // Lifecycle
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@SuppressWarnings("EmptyMethod")
@Override @Override
public void initialize(URL url, ResourceBundle rb) { public void initialize(URL url, ResourceBundle rb) {
super.initialize(url, rb); super.initialize(url, rb);
} }
@SuppressWarnings("EmptyMethod")
@Override @Override
public void terminate() { public void terminate() {
super.terminate(); super.terminate();
} }
@SuppressWarnings("EmptyMethod")
@Override @Override
public void deactivate() { public void deactivate() {
super.deactivate(); super.deactivate();
} }
@SuppressWarnings("EmptyMethod")
@Override @Override
public void activate() { public void activate() {
super.activate(); super.activate();
@ -70,9 +74,9 @@ public class HomeController extends CachedViewController {
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@Override @Override
public Initializable loadViewAndGetChildController(Navigation.Item item) { protected Initializable loadView(Navigation.Item navigationItem) {
// don't use caching here, cause exc. -> need to investigate and is rarely called so no caching is better // don't use caching here, cause exc. -> need to investigate and is rarely called so no caching is better
final ViewLoader loader = new ViewLoader(getClass().getResource(item.getFxmlUrl()), false); final ViewLoader loader = new ViewLoader(getClass().getResource(navigationItem.getFxmlUrl()), false);
try { try {
final Parent view = loader.load(); final Parent view = loader.load();
arbitratorRegistrationController = loader.getController(); arbitratorRegistrationController = loader.getController();
@ -107,12 +111,12 @@ public class HomeController extends CachedViewController {
@FXML @FXML
public void onArbitratorRegistration() { public void onArbitratorRegistration() {
loadViewAndGetChildController(Navigation.Item.ARBITRATOR_REGISTRATION); loadView(Navigation.Item.ARBITRATOR_REGISTRATION);
} }
@FXML @FXML
public void onArbitratorEdit() { public void onArbitratorEdit() {
loadViewAndGetChildController(Navigation.Item.ARBITRATOR_REGISTRATION); loadView(Navigation.Item.ARBITRATOR_REGISTRATION);
arbitratorRegistrationController.setEditMode(true); arbitratorRegistrationController.setEditMode(true);
} }

View file

@ -17,20 +17,20 @@
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>. ~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
--> -->
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<TabPane fx:id="root" fx:controller="io.bitsquare.gui.main.home.HomeController" <TabPane fx:id="root" fx:controller="io.bitsquare.gui.main.home.HomeController"
AnchorPane.bottomAnchor="0" AnchorPane.leftAnchor="0" AnchorPane.bottomAnchor="0" AnchorPane.leftAnchor="0"
AnchorPane.rightAnchor="0" AnchorPane.topAnchor="0" AnchorPane.rightAnchor="0" AnchorPane.topAnchor="0"
xmlns:fx="http://javafx.com/fxml"> xmlns:fx="http://javafx.com/fxml">
<Tab text="Overview" closable="false">
<Tab text="TODO" closable="false"> <VBox spacing="20">
<padding>
<VBox spacing="20" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" <Insets left="10" top="10" right="10"/>
AnchorPane.topAnchor="0.0"> </padding>
<Label id="headline-label" text="Overview"/> <Label
<Label text="TODO"/> text="TODO: Overview section. The buttons here are just temporary for accessing the arbitration management system."/>
<Button text="Register yourself as an arbitrator" onAction="#onArbitratorRegistration"/> <Button text="Register yourself as an arbitrator" onAction="#onArbitratorRegistration"/>
<Button text="Edit my arbitrator details" onAction="#onArbitratorEdit"/> <Button text="Edit my arbitrator details" onAction="#onArbitratorEdit"/>
</VBox> </VBox>

View file

@ -17,7 +17,7 @@
package io.bitsquare.gui.main.msg; package io.bitsquare.gui.main.msg;
import io.bitsquare.gui.CachedViewController; import io.bitsquare.gui.CachedViewCB;
import io.bitsquare.gui.Navigation; import io.bitsquare.gui.Navigation;
import java.net.URL; import java.net.URL;
@ -33,7 +33,7 @@ import org.slf4j.LoggerFactory;
// will be probably only used for arbitration communication, will be renamed and the icon changed // will be probably only used for arbitration communication, will be renamed and the icon changed
public class MsgController extends CachedViewController { public class MsgController extends CachedViewCB {
private static final Logger log = LoggerFactory.getLogger(MsgController.class); private static final Logger log = LoggerFactory.getLogger(MsgController.class);
@ -76,8 +76,8 @@ public class MsgController extends CachedViewController {
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@Override @Override
public Initializable loadViewAndGetChildController(Navigation.Item item) { protected Initializable loadView(Navigation.Item navigationItem) {
return null; return super.loadView(navigationItem);
} }

View file

@ -17,6 +17,7 @@
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>. ~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
--> -->
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<TabPane fx:id="root" fx:controller="io.bitsquare.gui.main.msg.MsgController" <TabPane fx:id="root" fx:controller="io.bitsquare.gui.main.msg.MsgController"
@ -24,8 +25,12 @@
AnchorPane.rightAnchor="0" AnchorPane.topAnchor="0" AnchorPane.rightAnchor="0" AnchorPane.topAnchor="0"
xmlns:fx="http://javafx.com/fxml"> xmlns:fx="http://javafx.com/fxml">
<Tab text="TODO" closable="false"> <Tab text="Message" closable="false">
<VBox spacing="20">
<padding>
<Insets left="10" top="10" right="10"/>
</padding>
<Label text="TODO: Communication tools with arbitrators..."/>
</VBox>
</Tab> </Tab>
</TabPane> </TabPane>

View file

@ -17,7 +17,7 @@
package io.bitsquare.gui.main.settings; package io.bitsquare.gui.main.settings;
import io.bitsquare.gui.CachedViewController; import io.bitsquare.gui.CachedViewCB;
import io.bitsquare.gui.Navigation; import io.bitsquare.gui.Navigation;
import java.net.URL; import java.net.URL;
@ -31,7 +31,7 @@ import javafx.fxml.Initializable;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class SettingsController extends CachedViewController { public class SettingsController extends CachedViewCB {
private static final Logger log = LoggerFactory.getLogger(SettingsController.class); private static final Logger log = LoggerFactory.getLogger(SettingsController.class);
@ -68,8 +68,8 @@ public class SettingsController extends CachedViewController {
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@Override @Override
public Initializable loadViewAndGetChildController(Navigation.Item item) { protected Initializable loadView(Navigation.Item navigationItem) {
return super.loadViewAndGetChildController(item); return super.loadView(navigationItem);
} }

View file

@ -17,6 +17,7 @@
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>. ~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
--> -->
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<TabPane fx:id="root" fx:controller="io.bitsquare.gui.main.settings.SettingsController" <TabPane fx:id="root" fx:controller="io.bitsquare.gui.main.settings.SettingsController"
@ -24,8 +25,13 @@
AnchorPane.rightAnchor="0" AnchorPane.topAnchor="0" AnchorPane.rightAnchor="0" AnchorPane.topAnchor="0"
xmlns:fx="http://javafx.com/fxml"> xmlns:fx="http://javafx.com/fxml">
<Tab text="TODO" closable="false"> <Tab text="Preferences" closable="false">
<VBox spacing="20">
<padding>
<Insets left="10" top="10" right="10"/>
</padding>
<Label text="TODO: Application preferences"/>
</VBox>
</Tab> </Tab>
</TabPane> </TabPane>