Apply code inspector suggestions

This commit is contained in:
Manfred Karrer 2014-09-08 21:43:38 +02:00
parent 9644cb3eda
commit d4e52e2acb
14 changed files with 403 additions and 438 deletions

View file

@ -27,7 +27,7 @@ import org.slf4j.LoggerFactory;
public class AccountModel extends UIModel { public class AccountModel extends UIModel {
private static final Logger log = LoggerFactory.getLogger(AccountModel.class); private static final Logger log = LoggerFactory.getLogger(AccountModel.class);
private User user; private final User user;
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
// Constructor // Constructor

View file

@ -24,9 +24,7 @@
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">
<tabs>
<Tab fx:id="tab" closable="false"> <Tab fx:id="tab" closable="false">
</Tab> </Tab>
</tabs>
</TabPane> </TabPane>

View file

@ -25,19 +25,28 @@
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"
xmlns:fx="http://javafx.com/fxml"> xmlns:fx="http://javafx.com/fxml">
<children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="140.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
</rowConstraints>
<Pane id="form-group-background-active" GridPane.columnSpan="2" GridPane.rowSpan="4"> <Pane id="form-group-background-active" GridPane.columnSpan="2" GridPane.rowSpan="4">
<GridPane.margin> <GridPane.margin>
<Insets bottom="-10.0" left="-10.0" right="-10.0" top="-10.0"/> <Insets bottom="-10.0" left="-10.0" right="-10.0" top="-10.0"/>
</GridPane.margin> </GridPane.margin>
<children>
<Label id="form-group-title-active" text="Setup password" layoutX="8" layoutY="-8"> <Label id="form-group-title-active" text="Setup password" layoutX="8" layoutY="-8">
<padding> <padding>
<Insets left="5" right="7"/> <Insets left="5" right="7"/>
</padding> </padding>
</Label> </Label>
</children>
</Pane> </Pane>
<Label text="Enter password:"> <Label text="Enter password:">
@ -65,22 +74,9 @@
</HBox> </HBox>
<InfoDisplay gridPane="$root" onAction="#onOpenHelp" rowIndex="3" <InfoDisplay gridPane="$root" onAction="#onOpenHelp" rowIndex="3"
text="Protect your wallet with a strong password. You need to enter the password any time you withdraw Bitcoins from your trading wallets. You can change the password later in the settings. Open the help menu for more information."/> text="Protect your wallet with a strong password. You need to enter the password any time you withdraw Bitcoin from your trading wallets. You can change the password later in the settings. Open the help menu for more information."/>
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="140.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
</rowConstraints>
</GridPane> </GridPane>

View file

@ -25,19 +25,29 @@
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"
xmlns:fx="http://javafx.com/fxml"> xmlns:fx="http://javafx.com/fxml">
<children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="140.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
</rowConstraints>
<Pane id="form-group-background-active" GridPane.columnSpan="2" GridPane.rowSpan="5"> <Pane id="form-group-background-active" GridPane.columnSpan="2" GridPane.rowSpan="5">
<GridPane.margin> <GridPane.margin>
<Insets bottom="-10.0" left="-10.0" right="-10.0" top="-10.0"/> <Insets bottom="-10.0" left="-10.0" right="-10.0" top="-10.0"/>
</GridPane.margin> </GridPane.margin>
<children>
<Label id="form-group-title-active" text="Change password" layoutX="8" layoutY="-8"> <Label id="form-group-title-active" text="Change password" layoutX="8" layoutY="-8">
<padding> <padding>
<Insets left="5" right="7"/> <Insets left="5" right="7"/>
</padding> </padding>
</Label> </Label>
</children>
</Pane> </Pane>
<Label text="Enter old password:"> <Label text="Enter old password:">
@ -70,23 +80,9 @@
</HBox> </HBox>
<InfoDisplay gridPane="$root" onAction="#onOpenHelp" rowIndex="4" <InfoDisplay gridPane="$root" onAction="#onOpenHelp" rowIndex="4"
text="Protect your wallet with a strong password. You need to enter the password any time you withdraw Bitcoins from your trading wallets. You can change the password later in the settings. Open the help menu for more information."/> text="Protect your wallet with a strong password. You need to enter the password any time you withdraw Bitcoin from your trading wallets. You can change the password later in the settings. Open the help menu for more information."/>
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="140.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
</rowConstraints>
</GridPane> </GridPane>

View file

@ -27,7 +27,26 @@
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"
xmlns:fx="http://javafx.com/fxml"> xmlns:fx="http://javafx.com/fxml">
<children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="200.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
</rowConstraints>
<!-- <!--
Setup Setup
@ -36,13 +55,11 @@
<GridPane.margin> <GridPane.margin>
<Insets bottom="-10.0" left="-10.0" right="-10.0" top="-10.0"/> <Insets bottom="-10.0" left="-10.0" right="-10.0" top="-10.0"/>
</GridPane.margin> </GridPane.margin>
<children>
<Label id="form-group-title-active" text="Setup your payments account" layoutX="8" layoutY="-8"> <Label id="form-group-title-active" text="Setup your payments account" layoutX="8" layoutY="-8">
<padding> <padding>
<Insets left="5" right="7"/> <Insets left="5" right="7"/>
</padding> </padding>
</Label> </Label>
</children>
</Pane> </Pane>
<Label text="Payments method:" GridPane.rowIndex="0"> <Label text="Payments method:" GridPane.rowIndex="0">
@ -76,12 +93,10 @@
<Label text="Country of payments account:" GridPane.rowIndex="6"/> <Label text="Country of payments account:" GridPane.rowIndex="6"/>
<HBox GridPane.columnIndex="1" GridPane.rowIndex="6" spacing="10"> <HBox GridPane.columnIndex="1" GridPane.rowIndex="6" spacing="10">
<children>
<ComboBox fx:id="regionComboBox" promptText="Select region" <ComboBox fx:id="regionComboBox" promptText="Select region"
onAction="#onSelectRegion" prefWidth="150.0"/> onAction="#onSelectRegion" prefWidth="150.0"/>
<ComboBox fx:id="countryComboBox" promptText="Select country" onAction="#onSelectCountry" <ComboBox fx:id="countryComboBox" promptText="Select country" onAction="#onSelectCountry"
visible="false" prefWidth="150.0"/> visible="false" prefWidth="150.0"/>
</children>
</HBox> </HBox>
<InfoDisplay gridPane="$root" onAction="#onOpenSetupHelp" rowIndex="7" <InfoDisplay gridPane="$root" onAction="#onOpenSetupHelp" rowIndex="7"
@ -102,16 +117,14 @@
<GridPane.margin> <GridPane.margin>
<Insets bottom="-10" left="-10" right="-10" top="20"/> <Insets bottom="-10" left="-10" right="-10" top="20"/>
</GridPane.margin> </GridPane.margin>
<children> <padding>
<Insets top="40.0"/>
</padding>
<Label id="form-group-title-active" text="Manage payments accounts" layoutX="8" layoutY="-8"> <Label id="form-group-title-active" text="Manage payments accounts" layoutX="8" layoutY="-8">
<padding> <padding>
<Insets left="5" right="7"/> <Insets left="5" right="7"/>
</padding> </padding>
</Label> </Label>
</children>
<padding>
<Insets top="40.0"/>
</padding>
</Pane> </Pane>
<Label text="Select payments account:" GridPane.rowIndex="9"> <Label text="Select payments account:" GridPane.rowIndex="9">
@ -133,25 +146,4 @@
<InfoDisplay gridPane="$root" onAction="#onOpenManageAccountsHelp" rowIndex="11" <InfoDisplay gridPane="$root" onAction="#onOpenManageAccountsHelp" rowIndex="11"
text="When you change your payments accounts later you need to do the renew the registration and pay the small registration fee."/> text="When you change your payments accounts later you need to do the renew the registration and pay the small registration fee."/>
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="200.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
</rowConstraints>
</GridPane> </GridPane>

View file

@ -156,6 +156,7 @@ public class RegistrationCB extends CachedCodeBehind<RegistrationPM> {
public void setParentController(Initializable parentController) { public void setParentController(Initializable parentController) {
super.setParentController(parentController); super.setParentController(parentController);
if (parentController instanceof AccountSettingsCB) { if (parentController instanceof AccountSettingsCB) {
//TODO
// ((GridPane) root).getChildren().remove(completedButton); // ((GridPane) root).getChildren().remove(completedButton);
} }
} }

View file

@ -48,9 +48,9 @@ import org.slf4j.LoggerFactory;
public class RegistrationModel extends UIModel { public class RegistrationModel extends UIModel {
private static final Logger log = LoggerFactory.getLogger(RegistrationModel.class); private static final Logger log = LoggerFactory.getLogger(RegistrationModel.class);
private WalletFacade walletFacade; private final WalletFacade walletFacade;
private User user; private final User user;
private Persistence persistence; private final Persistence persistence;
AddressEntry addressEntry; AddressEntry addressEntry;
final BooleanProperty isWalletFunded = new SimpleBooleanProperty(); final BooleanProperty isWalletFunded = new SimpleBooleanProperty();
final BooleanProperty payFeeSuccess = new SimpleBooleanProperty(); final BooleanProperty payFeeSuccess = new SimpleBooleanProperty();

View file

@ -27,19 +27,29 @@
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"
xmlns:fx="http://javafx.com/fxml"> xmlns:fx="http://javafx.com/fxml">
<children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="200.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
</rowConstraints>
<Pane id="form-group-background-active" GridPane.columnSpan="2" GridPane.rowSpan="4"> <Pane id="form-group-background-active" GridPane.columnSpan="2" GridPane.rowSpan="4">
<GridPane.margin> <GridPane.margin>
<Insets bottom="-10.0" left="-10.0" right="-10.0" top="-10.0"/> <Insets bottom="-10.0" left="-10.0" right="-10.0" top="-10.0"/>
</GridPane.margin> </GridPane.margin>
<children>
<Label id="form-group-title-active" text="Fund the registration fee" <Label id="form-group-title-active" text="Fund the registration fee"
layoutX="8" layoutY="-8"> layoutX="8" layoutY="-8">
<padding> <padding>
<Insets left="5" right="7"/> <Insets left="5" right="7"/>
</padding> </padding>
</Label> </Label>
</children>
</Pane> </Pane>
<Label text="Registration fee:" GridPane.rowIndex="0"> <Label text="Registration fee:" GridPane.rowIndex="0">
@ -83,18 +93,4 @@
</GridPane.margin> </GridPane.margin>
</Button> </Button>
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="200.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
</rowConstraints>
</GridPane> </GridPane>

View file

@ -160,7 +160,7 @@ public class RestrictionsModel extends UIModel {
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(e -> settings.addAcceptedCountry(e)); CountryUtil.getAllEuroCountries().stream().forEach(settings::addAcceptedCountry);
countryList = FXCollections.observableArrayList(settings.getAcceptedCountries()); countryList = FXCollections.observableArrayList(settings.getAcceptedCountries());
saveSettings(); saveSettings();
return countryList; return countryList;

View file

@ -24,7 +24,28 @@
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"
xmlns:fx="http://javafx.com/fxml"> xmlns:fx="http://javafx.com/fxml">
<children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="140.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints vgrow="SOMETIMES"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="SOMETIMES"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="SOMETIMES"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
</rowConstraints>
<!-- <!--
languages languages
@ -33,13 +54,11 @@
<GridPane.margin> <GridPane.margin>
<Insets bottom="-10.0" left="-10.0" right="-10.0" top="-10.0"/> <Insets bottom="-10.0" left="-10.0" right="-10.0" top="-10.0"/>
</GridPane.margin> </GridPane.margin>
<children>
<Label id="form-group-title-active" text="Add languages" layoutX="8" layoutY="-8"> <Label id="form-group-title-active" text="Add languages" layoutX="8" layoutY="-8">
<padding> <padding>
<Insets left="5" right="7"/> <Insets left="5" right="7"/>
</padding> </padding>
</Label> </Label>
</children>
</Pane> </Pane>
<Label text="Accepted languages:" GridPane.rowIndex="0" GridPane.valignment="TOP"> <Label text="Accepted languages:" GridPane.rowIndex="0" GridPane.valignment="TOP">
@ -63,16 +82,14 @@
<GridPane.margin> <GridPane.margin>
<Insets bottom="-10" left="-10" right="-10" top="30"/> <Insets bottom="-10" left="-10" right="-10" top="30"/>
</GridPane.margin> </GridPane.margin>
<children> <padding>
<Insets top="50.0"/>
</padding>
<Label id="form-group-title-active" text="Add countries" layoutX="8" layoutY="-8"> <Label id="form-group-title-active" text="Add countries" layoutX="8" layoutY="-8">
<padding> <padding>
<Insets left="5" right="7"/> <Insets left="5" right="7"/>
</padding> </padding>
</Label> </Label>
</children>
<padding>
<Insets top="50.0"/>
</padding>
</Pane> </Pane>
<Label text="Accepted countries:" GridPane.rowIndex="3" GridPane.valignment="TOP"> <Label text="Accepted countries:" GridPane.rowIndex="3" GridPane.valignment="TOP">
<GridPane.margin> <GridPane.margin>
@ -87,14 +104,12 @@
</ListView> </ListView>
<HBox GridPane.columnIndex="1" GridPane.rowIndex="4" spacing="10"> <HBox GridPane.columnIndex="1" GridPane.rowIndex="4" spacing="10">
<children>
<ComboBox fx:id="regionComboBox" onAction="#onSelectRegion" promptText="Select region" <ComboBox fx:id="regionComboBox" onAction="#onSelectRegion" promptText="Select region"
prefWidth="150.0"/> prefWidth="150.0"/>
<ComboBox fx:id="countryComboBox" onAction="#onAddCountry" promptText="Add country" visible="false" <ComboBox fx:id="countryComboBox" onAction="#onAddCountry" promptText="Add country" visible="false"
prefWidth="150.0"/> prefWidth="150.0"/>
<Button fx:id="addAllEuroCountriesButton" text="Add Euro countries" onAction="#onAddAllEuroCountries" <Button fx:id="addAllEuroCountriesButton" text="Add Euro countries" onAction="#onAddAllEuroCountries"
prefWidth="150.0" visible="false"/> prefWidth="150.0" visible="false"/>
</children>
</HBox> </HBox>
@ -109,16 +124,14 @@
<GridPane.margin> <GridPane.margin>
<Insets bottom="-10" left="-10" right="-10" top="30"/> <Insets bottom="-10" left="-10" right="-10" top="30"/>
</GridPane.margin> </GridPane.margin>
<children> <padding>
<Insets top="50.0"/>
</padding>
<Label id="form-group-title-active" text="Add arbitrators" layoutX="8" layoutY="-8"> <Label id="form-group-title-active" text="Add arbitrators" layoutX="8" layoutY="-8">
<padding> <padding>
<Insets left="5" right="7"/> <Insets left="5" right="7"/>
</padding> </padding>
</Label> </Label>
</children>
<padding>
<Insets top="50.0"/>
</padding>
</Pane> </Pane>
<Label text="Accepted arbitrators:" GridPane.rowIndex="6" GridPane.valignment="TOP"> <Label text="Accepted arbitrators:" GridPane.rowIndex="6" GridPane.valignment="TOP">
<GridPane.margin> <GridPane.margin>
@ -144,27 +157,4 @@
<Insets top="20.0"/> <Insets top="20.0"/>
</GridPane.margin> </GridPane.margin>
</Button> </Button>
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="140.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints vgrow="SOMETIMES"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="SOMETIMES"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="SOMETIMES"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
</rowConstraints>
</GridPane> </GridPane>

View file

@ -101,7 +101,6 @@ public class SeedWordsCB extends CachedCodeBehind<SeedWordsPM> {
@FXML @FXML
private void onCompleted() { private void onCompleted() {
if (parentController instanceof SetupCB)
if (parentController instanceof SetupCB) if (parentController instanceof SetupCB)
((SetupCB) parentController).onCompleted(this); ((SetupCB) parentController).onCompleted(this);
} }

View file

@ -26,19 +26,28 @@
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"
xmlns:fx="http://javafx.com/fxml"> xmlns:fx="http://javafx.com/fxml">
<children>
<Pane id="form-group-background-active" fx:id="payFundsPane" GridPane.columnSpan="2" GridPane.rowSpan="4"> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="140.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
</rowConstraints>
<Pane id="form-group-background-active" GridPane.columnSpan="2" GridPane.rowSpan="4">
<GridPane.margin> <GridPane.margin>
<Insets bottom="-10.0" left="-10.0" right="-10.0" top="-10.0"/> <Insets bottom="-10.0" left="-10.0" right="-10.0" top="-10.0"/>
</GridPane.margin> </GridPane.margin>
<children>
<Label id="form-group-title-active" text="Backup your wallet seed words" <Label id="form-group-title-active" text="Backup your wallet seed words"
layoutX="8" layoutY="-8"> layoutX="8" layoutY="-8">
<padding> <padding>
<Insets left="5" right="7"/> <Insets left="5" right="7"/>
</padding> </padding>
</Label> </Label>
</children>
</Pane> </Pane>
<Label text="Wallet seed words:" GridPane.columnIndex="0" GridPane.rowIndex="1" GridPane.valignment="TOP"> <Label text="Wallet seed words:" GridPane.columnIndex="0" GridPane.rowIndex="1" GridPane.valignment="TOP">
@ -62,17 +71,4 @@
<InfoDisplay gridPane="$root" onAction="#onOpenHelp" rowIndex="3" <InfoDisplay gridPane="$root" onAction="#onOpenHelp" rowIndex="3"
text="You can recreate your wallet our of these words when you lose your wallet. Backup it on paper to have better protection against online theft. Open the help menu for more information."/> text="You can recreate your wallet our of these words when you lose your wallet. Backup it on paper to have better protection against online theft. Open the help menu for more information."/>
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="140.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
</rowConstraints>
</GridPane> </GridPane>

View file

@ -48,7 +48,6 @@ public class AccountSettingsCB extends CachedCodeBehind<AccountSettingsPM> {
private static final Logger log = LoggerFactory.getLogger(AccountSettingsCB.class); private static final Logger log = LoggerFactory.getLogger(AccountSettingsCB.class);
public VBox leftVBox; public VBox leftVBox;
public AnchorPane content; public AnchorPane content;
private MenuItem seedWords, password, fiatAccount, restrictions, registration;
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
// Constructor // Constructor
@ -69,15 +68,15 @@ public class AccountSettingsCB extends CachedCodeBehind<AccountSettingsPM> {
super.initialize(url, rb); super.initialize(url, rb);
ToggleGroup toggleGroup = new ToggleGroup(); ToggleGroup toggleGroup = new ToggleGroup();
seedWords = new MenuItem(this, content, "Wallet seed", MenuItem seedWords = new MenuItem(this, content, "Wallet seed",
NavigationItem.SEED_WORDS, toggleGroup); NavigationItem.SEED_WORDS, toggleGroup);
password = new MenuItem(this, content, "Wallet password", MenuItem password = new MenuItem(this, content, "Wallet password",
NavigationItem.CHANGE_PASSWORD, toggleGroup); NavigationItem.CHANGE_PASSWORD, toggleGroup);
restrictions = new MenuItem(this, content, "Trading restrictions", MenuItem restrictions = new MenuItem(this, content, "Trading restrictions",
NavigationItem.RESTRICTIONS, toggleGroup); NavigationItem.RESTRICTIONS, toggleGroup);
fiatAccount = new MenuItem(this, content, "Payments account(s)", MenuItem fiatAccount = new MenuItem(this, content, "Payments account(s)",
NavigationItem.FIAT_ACCOUNT, toggleGroup); NavigationItem.FIAT_ACCOUNT, toggleGroup);
registration = new MenuItem(this, content, "Renew your account", MenuItem registration = new MenuItem(this, content, "Renew your account",
NavigationItem.REGISTRATION, toggleGroup); NavigationItem.REGISTRATION, toggleGroup);
registration.setDisable(true); registration.setDisable(true);

View file

@ -88,7 +88,7 @@ public class SetupCB extends CachedCodeBehind<SetupPM> {
leftVBox.getChildren().addAll(seedWords, password, restrictions, fiatAccount, registration); leftVBox.getChildren().addAll(seedWords, password, restrictions, fiatAccount, registration);
childController = seedWords.show(NavigationItem.SEED_WORDS); childController = seedWords.show();
} }
@Override @Override
@ -114,19 +114,19 @@ public class SetupCB extends CachedCodeBehind<SetupPM> {
public void onCompleted(CodeBehind<? extends PresentationModel> childView) { public void onCompleted(CodeBehind<? extends PresentationModel> childView) {
if (childView instanceof SeedWordsCB) { if (childView instanceof SeedWordsCB) {
seedWords.onCompleted(); seedWords.onCompleted();
childController = password.show(NavigationItem.ADD_PASSWORD); childController = password.show();
} }
else if (childView instanceof PasswordCB) { else if (childView instanceof PasswordCB) {
password.onCompleted(); password.onCompleted();
childController = restrictions.show(NavigationItem.RESTRICTIONS); childController = restrictions.show();
} }
else if (childView instanceof RestrictionsCB) { else if (childView instanceof RestrictionsCB) {
restrictions.onCompleted(); restrictions.onCompleted();
childController = fiatAccount.show(NavigationItem.FIAT_ACCOUNT); childController = fiatAccount.show();
} }
else if (childView instanceof FiatAccountCB) { else if (childView instanceof FiatAccountCB) {
fiatAccount.onCompleted(); fiatAccount.onCompleted();
childController = registration.show(NavigationItem.REGISTRATION); childController = registration.show();
} }
else if (childView instanceof RegistrationCB) { else if (childView instanceof RegistrationCB) {
registration.onCompleted(); registration.onCompleted();
@ -161,6 +161,7 @@ class WizardItem extends HBox {
private final Label subTitleLabel; private final Label subTitleLabel;
private final SetupCB parentCB; private final SetupCB parentCB;
private final Parent content; private final Parent content;
private final NavigationItem navigationItem;
private CodeBehind<? extends PresentationModel> childController; private CodeBehind<? extends PresentationModel> childController;
@ -168,6 +169,7 @@ class WizardItem extends HBox {
WizardItem(SetupCB parentCB, Parent content, String title, String subTitle, NavigationItem navigationItem) { WizardItem(SetupCB parentCB, Parent content, String title, String subTitle, NavigationItem navigationItem) {
this.parentCB = parentCB; this.parentCB = parentCB;
this.content = content; this.content = content;
this.navigationItem = navigationItem;
setId("wizard-item-background-deactivated"); setId("wizard-item-background-deactivated");
layout(); layout();
setSpacing(5); setSpacing(5);
@ -202,7 +204,7 @@ class WizardItem extends HBox {
getChildren().addAll(imageView, vBox); getChildren().addAll(imageView, vBox);
} }
public CodeBehind<? extends PresentationModel> show(NavigationItem navigationItem) { public CodeBehind<? extends PresentationModel> show() {
loadView(navigationItem); loadView(navigationItem);
setId("wizard-item-background-active"); setId("wizard-item-background-active");
imageView.setImage(ImageUtil.getIconImage(ImageUtil.ARROW_BLUE)); imageView.setImage(ImageUtil.getIconImage(ImageUtil.ARROW_BLUE));