Exemplo n.º 1
0
  private void initComponents() {
    accountCombo = new AccountListComboBox();

    helpPane = new JTextPane();
    helpPane.setEditable(false);
    helpPane.setEditorKit(new StyledEditorKit());
    helpPane.setBackground(getBackground());
    helpPane.setText(TextResource.getString("QifOne.txt"));

    /* Create the combo for date format selection */
    String[] formats = {QifUtils.US_FORMAT, QifUtils.EU_FORMAT};
    dateFormatCombo = new JComboBox<>(formats);

    dateFormatCombo.addActionListener(this);
    dateFormatCombo.setSelectedIndex(pref.getInt(DATE_FORMAT, 0));

    accountCombo.addActionListener(this);

    /* Try a set the combobox to the last selected account */
    String lastAccount = pref.get(LAST_ACCOUNT, "");

    Account last = EngineFactory.getEngine(EngineFactory.DEFAULT).getAccountByUuid(lastAccount);

    if (last != null) {
      setAccount(last);
    }
  }
Exemplo n.º 2
0
 @Override
 public boolean isPageValid() {
   // an account was selected, make sure that the destination is valid
   if (destinationAccount == null) {
     destinationAccount = accountCombo.getSelectedAccount();
   }
   return true;
 }
Exemplo n.º 3
0
  private void accountAction() {
    destinationAccount = accountCombo.getSelectedAccount();

    /* Save the id of the selected account */
    if (destinationAccount != null) {
      pref.put(LAST_ACCOUNT, destinationAccount.getUuid());
      pref.putInt(DATE_FORMAT, dateFormatCombo.getSelectedIndex());
    }
  }
Exemplo n.º 4
0
 void setAccount(Account account) {
   destinationAccount = account;
   accountCombo.setSelectedAccount(destinationAccount);
 }
Exemplo n.º 5
0
 public Account getAccount() {
   if (destinationAccount == null) {
     destinationAccount = accountCombo.getSelectedAccount();
   }
   return destinationAccount;
 }