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);
settingsButton = addNavButton(rightNavPane, "Settings", Navigation.Item.SETTINGS);
settingsButton = addNavButton(rightNavPane, "Preferences", Navigation.Item.SETTINGS);
accountButton = addNavButton(rightNavPane, "Account", Navigation.Item.ACCOUNT);
onMainNavigationAdded();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -36,7 +36,7 @@ import javafx.scene.layout.*;
import org.slf4j.Logger;
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);
@ -89,7 +89,7 @@ public class ChangePasswordViewCB extends CachedViewCB<ChangePasswordPM> impleme
///////////////////////////////////////////////////////////////////////////////////////////
// Override
// ContextAware implementation
///////////////////////////////////////////////////////////////////////////////////////////
@Override

View File

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

View File

@ -43,7 +43,7 @@ import javafx.util.StringConverter;
import org.slf4j.Logger;
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 final BankAccountNumberValidator bankAccountNumberValidator;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -38,15 +38,15 @@ import org.slf4j.LoggerFactory;
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);
public final BooleanProperty isPayButtonDisabled = new SimpleBooleanProperty(true);
public final StringProperty requestPlaceOfferErrorMessage = new SimpleStringProperty();
public final BooleanProperty showTransactionPublishedScreen = new SimpleBooleanProperty();
final BooleanProperty isPayButtonDisabled = new SimpleBooleanProperty(true);
final StringProperty requestPlaceOfferErrorMessage = new SimpleStringProperty();
final BooleanProperty showTransactionPublishedScreen = new SimpleBooleanProperty();
// 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
///////////////////////////////////////////////////////////////////////////////////////////
public void payFee() {
void payFee() {
model.payFeeErrorMessage.set(null);
model.payFeeSuccess.set(false);
@ -120,27 +120,27 @@ public class RegistrationPM extends PresentationModel<RegistrationModel> {
// Getters
///////////////////////////////////////////////////////////////////////////////////////////
public WalletFacade getWalletFacade() {
WalletFacade getWalletFacade() {
return model.getWalletFacade();
}
public Coin getFeeAsCoin() {
Coin getFeeAsCoin() {
return model.getFeeAsCoin();
}
public String getAddressAsString() {
String getAddressAsString() {
return model.getAddressEntry() != null ? model.getAddressEntry().getAddress().toString() : "";
}
public String getPaymentLabel() {
String getPaymentLabel() {
return BSResources.get("Bitsquare account registration fee");
}
public String getFeeAsString() {
String getFeeAsString() {
return formatCoinWithCode(model.getFeeAsCoin());
}
public String getTransactionId() {
String getTransactionId() {
return model.getTransactionId();
}

View File

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

View File

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

View File

@ -33,10 +33,10 @@ import javafx.collections.ObservableList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class RestrictionsPM extends PresentationModel<RestrictionsModel> {
class RestrictionsPM extends PresentationModel<RestrictionsModel> {
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 void addLanguage(Locale locale) {
void addLanguage(Locale locale) {
model.addLanguage(locale);
updateDoneButtonDisableState();
}
public void removeLanguage(Locale locale) {
void removeLanguage(Locale locale) {
model.removeLanguage(locale);
updateDoneButtonDisableState();
}
public void addCountry(Country country) {
void addCountry(Country country) {
model.addCountry(country);
updateDoneButtonDisableState();
}
public void removeCountry(Country country) {
void removeCountry(Country country) {
model.removeCountry(country);
updateDoneButtonDisableState();
}
public void removeArbitrator(Arbitrator arbitrator) {
void removeArbitrator(Arbitrator arbitrator) {
model.removeArbitrator(arbitrator);
updateDoneButtonDisableState();
}
public void updateArbitratorList() {
void updateArbitratorList() {
model.updateArbitratorList();
updateDoneButtonDisableState();
}
@ -113,31 +113,31 @@ public class RestrictionsPM extends PresentationModel<RestrictionsModel> {
// Getters
///////////////////////////////////////////////////////////////////////////////////////////
public ObservableList<Country> getListWithAllEuroCountries() {
ObservableList<Country> getListWithAllEuroCountries() {
return model.getListWithAllEuroCountries();
}
public ObservableList<Country> getAllCountriesFor(Region selectedRegion) {
ObservableList<Country> getAllCountriesFor(Region selectedRegion) {
return model.getAllCountriesFor(selectedRegion);
}
public ObservableList<Locale> getLanguageList() {
ObservableList<Locale> getLanguageList() {
return model.languageList;
}
public ObservableList<Region> getAllRegions() {
ObservableList<Region> getAllRegions() {
return model.allRegions;
}
public ObservableList<Locale> getAllLanguages() {
ObservableList<Locale> getAllLanguages() {
return model.allLanguages;
}
public ObservableList<Country> getCountryList() {
ObservableList<Country> getCountryList() {
return model.countryList;
}
public ObservableList<Arbitrator> getArbitratorList() {
ObservableList<Arbitrator> getArbitratorList() {
return model.arbitratorList;
}

View File

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

View File

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

View File

@ -28,10 +28,10 @@ import javafx.beans.property.StringProperty;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SeedWordsPM extends PresentationModel<SeedWordsModel> {
class SeedWordsPM extends PresentationModel<SeedWordsModel> {
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

View File

@ -24,7 +24,7 @@ import com.google.inject.Inject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class AccountSettingsModel extends UIModel {
class AccountSettingsModel extends UIModel {
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.LoggerFactory;
public class AccountSettingsPM extends PresentationModel<AccountSettingsModel> {
class AccountSettingsPM extends PresentationModel<AccountSettingsModel> {
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.LoggerFactory;
public class AccountSettingsViewCB extends CachedViewCB<AccountSettingsPM> {
class AccountSettingsViewCB extends CachedViewCB<AccountSettingsPM> {
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.LoggerFactory;
public class AccountSetupModel extends UIModel {
class AccountSetupModel extends UIModel {
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.LoggerFactory;
public class AccountSetupPM extends PresentationModel<AccountSetupModel> {
class AccountSetupPM extends PresentationModel<AccountSetupModel> {
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.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);
@ -130,9 +130,10 @@ public class AccountSetupViewCB extends CachedViewCB<AccountSetupPM> implements
///////////////////////////////////////////////////////////////////////////////////////////
// UI handlers
// MultiStepNavigation implementation
///////////////////////////////////////////////////////////////////////////////////////////
@Override
public void nextStep(ViewCB<? extends PresentationModel> childView) {
if (childView instanceof SeedWordsViewCB) {
seedWords.onCompleted();

View File

@ -18,7 +18,7 @@
package io.bitsquare.gui.main.home;
import io.bitsquare.BitSquare;
import io.bitsquare.gui.CachedViewController;
import io.bitsquare.gui.CachedViewCB;
import io.bitsquare.gui.Navigation;
import io.bitsquare.gui.main.arbitrators.registration.ArbitratorRegistrationController;
import io.bitsquare.util.ViewLoader;
@ -36,29 +36,33 @@ import javafx.stage.Modality;
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,
// probably overview, event history, new, charts,... -> low prio
public class HomeController extends CachedViewController {
// probably overview, event history, news, charts,... -> low prio
public class HomeController extends CachedViewCB {
private ArbitratorRegistrationController arbitratorRegistrationController;
///////////////////////////////////////////////////////////////////////////////////////////
// Lifecycle
///////////////////////////////////////////////////////////////////////////////////////////
@SuppressWarnings("EmptyMethod")
@Override
public void initialize(URL url, ResourceBundle rb) {
super.initialize(url, rb);
}
@SuppressWarnings("EmptyMethod")
@Override
public void terminate() {
super.terminate();
}
@SuppressWarnings("EmptyMethod")
@Override
public void deactivate() {
super.deactivate();
}
@SuppressWarnings("EmptyMethod")
@Override
public void activate() {
super.activate();
@ -70,9 +74,9 @@ public class HomeController extends CachedViewController {
///////////////////////////////////////////////////////////////////////////////////////////
@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
final ViewLoader loader = new ViewLoader(getClass().getResource(item.getFxmlUrl()), false);
final ViewLoader loader = new ViewLoader(getClass().getResource(navigationItem.getFxmlUrl()), false);
try {
final Parent view = loader.load();
arbitratorRegistrationController = loader.getController();
@ -107,12 +111,12 @@ public class HomeController extends CachedViewController {
@FXML
public void onArbitratorRegistration() {
loadViewAndGetChildController(Navigation.Item.ARBITRATOR_REGISTRATION);
loadView(Navigation.Item.ARBITRATOR_REGISTRATION);
}
@FXML
public void onArbitratorEdit() {
loadViewAndGetChildController(Navigation.Item.ARBITRATOR_REGISTRATION);
loadView(Navigation.Item.ARBITRATOR_REGISTRATION);
arbitratorRegistrationController.setEditMode(true);
}

View File

@ -17,20 +17,20 @@
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
-->
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<TabPane fx:id="root" fx:controller="io.bitsquare.gui.main.home.HomeController"
AnchorPane.bottomAnchor="0" AnchorPane.leftAnchor="0"
AnchorPane.rightAnchor="0" AnchorPane.topAnchor="0"
xmlns:fx="http://javafx.com/fxml">
<Tab text="TODO" closable="false">
<VBox spacing="20" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
AnchorPane.topAnchor="0.0">
<Label id="headline-label" text="Overview"/>
<Label text="TODO"/>
<Tab text="Overview" closable="false">
<VBox spacing="20">
<padding>
<Insets left="10" top="10" right="10"/>
</padding>
<Label
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="Edit my arbitrator details" onAction="#onArbitratorEdit"/>
</VBox>

View File

@ -17,7 +17,7 @@
package io.bitsquare.gui.main.msg;
import io.bitsquare.gui.CachedViewController;
import io.bitsquare.gui.CachedViewCB;
import io.bitsquare.gui.Navigation;
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
public class MsgController extends CachedViewController {
public class MsgController extends CachedViewCB {
private static final Logger log = LoggerFactory.getLogger(MsgController.class);
@ -76,8 +76,8 @@ public class MsgController extends CachedViewController {
///////////////////////////////////////////////////////////////////////////////////////////
@Override
public Initializable loadViewAndGetChildController(Navigation.Item item) {
return null;
protected Initializable loadView(Navigation.Item navigationItem) {
return super.loadView(navigationItem);
}

View File

@ -17,6 +17,7 @@
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
-->
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<TabPane fx:id="root" fx:controller="io.bitsquare.gui.main.msg.MsgController"
@ -24,8 +25,12 @@
AnchorPane.rightAnchor="0" AnchorPane.topAnchor="0"
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>
</TabPane>

View File

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

View File

@ -17,6 +17,7 @@
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
-->
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<TabPane fx:id="root" fx:controller="io.bitsquare.gui.main.settings.SettingsController"
@ -24,8 +25,13 @@
AnchorPane.rightAnchor="0" AnchorPane.topAnchor="0"
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>
</TabPane>