예제 #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);
    }
  }
예제 #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;
 }
예제 #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());
    }
  }
예제 #4
0
 void setAccount(Account account) {
   destinationAccount = account;
   accountCombo.setSelectedAccount(destinationAccount);
 }
예제 #5
0
 public Account getAccount() {
   if (destinationAccount == null) {
     destinationAccount = accountCombo.getSelectedAccount();
   }
   return destinationAccount;
 }