Ejemplo n.º 1
0
  /**
   * ct.
   *
   * @param passport optionale Angabe des Passports.
   */
  public KeyPasswordLoadDialog(HBCIPassport passport) {
    super(POSITION_CENTER);
    setSize(550, SWT.DEFAULT);

    String s = null;
    try {
      BeanService service = Application.getBootLoader().getBootable(BeanService.class);
      SynchronizeSession session = service.get(HBCISynchronizeBackend.class).getCurrentSession();
      Konto konto = session != null ? session.getKonto() : null;

      if (konto != null) {
        s = konto.getBezeichnung();
        String name = HBCIProperties.getNameForBank(konto.getBLZ());
        if (name != null && name.length() > 0) s += " [" + name + "]";
      }
    } catch (Exception e) {
      Logger.error("unable to determine current konto", e);
    }

    String text = null;
    if (s != null) {
      setTitle(i18n.tr("Schlüsseldiskette. Konto: {0}", s));
      text = i18n.tr("Bitte geben Sie das Passwort der Schlüsseldiskette ein.\nKonto: {0}", s);
    } else {
      setTitle(i18n.tr("Schlüsseldiskette"));
      text = i18n.tr("Bitte geben Sie das Passwort der Schlüsseldiskette ein.");
    }

    if (passport != null && (passport instanceof HBCIPassportRDHNew))
      this.filename = ((HBCIPassportRDHNew) passport).getFilename();

    setText(text);
    setLabelText(i18n.tr("Ihr Passwort"));
  }
Ejemplo n.º 2
0
 /** @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event) */
 public void handleEvent(Event arg0) {
   try {
     String b = (String) getValue();
     if (b != null && b.length() > 0) {
       // Wir schnipseln gleich noch Leerzeichen raus - aber nur, wenn welche drin stehen
       if (b.indexOf(' ') != -1) b = b.replaceAll(" ", "");
       setComment(HBCIProperties.getNameForBank(b));
     } else {
       setComment("");
     }
   } catch (Exception e) {
     // ignore
   }
 }
Ejemplo n.º 3
0
 /** @see de.willuhn.datasource.GenericObject#getAttribute(java.lang.String) */
 public Object getAttribute(String attribute) throws RemoteException {
   if ("blz".equals(attribute)) return getBLZ();
   if ("bank".equals(attribute)) return HBCIProperties.getNameForBank(getBLZ());
   if ("url".equals(attribute)) return getURL();
   if ("port".equals(attribute)) return new Integer(getPort());
   if ("filtertype".equals(attribute)) return getFilterType();
   if ("hbciversion".equals(attribute)) return getHBCIVersion();
   if ("customerid".equals(attribute)) return getCustomerId();
   if ("userid".equals(attribute)) return getUserId();
   if ("bezeichnung".equals(attribute)) return getBezeichnung();
   if ("showtan".equals(attribute)) return new Boolean(getShowTan());
   if ("secmech".equals(attribute)) return getSecMech();
   if ("tanmedia".equals(attribute)) return getTanMedia();
   if ("tanmedias".equals(attribute)) return getTanMedias();
   return null;
 }
Ejemplo n.º 4
0
  /** @see de.willuhn.jameica.hbci.passport.Configuration#getDescription() */
  public String getDescription() {
    try {
      String name = this.getBezeichnung();
      String bank = HBCIProperties.getNameForBank(getBLZ());
      String url = this.getURL();

      boolean haveName = (name != null && name.trim().length() > 0);
      boolean haveBank = (bank != null && bank.length() > 0);

      // wenn wir weder Name noch Bank haben, nehmen wir die URL
      if (!haveBank && !haveName) return url;

      // wenn wir Name und Bank haben, nehmen wir beides
      if (haveBank && haveName) return name + " - " + bank;

      // Ansonsten das, was da ist
      if (haveName) return name;

      return bank;
    } catch (Exception e) {
      Logger.error("unable to determine name", e);
      return passport.getHost();
    }
  }