Beispiel #1
0
  /**
   * BUGZILLA 150
   *
   * @see PasswordDialog#setText(String)
   */
  public void setText(String text) {
    ////////////////////////////////////////////////////////////////////////////
    // Bezeichnung des Kontos ermitteln
    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 = HBCIUtils.getNameForBLZ(konto.getBLZ());
        if (name != null && name.length() > 0) s += " [" + name + "]";
      }
    } catch (Exception e) {
      Logger.error("unable to determine current konto", e);
    }

    if (text == null || text.length() == 0) {
      text = i18n.tr("Bitte geben Sie eine TAN-Nummer ein.");
    } else {
      // Der Text kann ein "challenge" von der Bank enthalten. Dieser kann Formatierungen enthalten.
      // Z.Bsp. "<b>Text</b>", "<li>..." usw. Siehe
      // FinTS_3.0_Security_Sicherheitsverfahren_PINTAN_Rel_20101027_final_version.pdf
      // Seite 127. Das muss noch beachtet werden
      // Eigentlich kann man in den BPD noch nachschauen, ob fuer das TAN-Verfahren
      // "ischallengestructured=J",
      // aber das brauchen wir nicht. Wenn HTML-Tags drin stehen, ersetzen wir sie gegen
      // Formatierungen.

      text = text.replaceAll("<br>", "\n");
      text = text.replaceAll("<p>", "\n\n");

      text = text.replaceAll("<p>", "\n\n");

      text = text.replaceAll("<ul>", "\n");
      text = text.replaceAll("</ul>", "");
      text = text.replaceAll("<ol>", "\n");
      text = text.replaceAll("</ol>", "");
      text = text.replaceAll("</li>", "\n");

      text = text.replaceAll("<li>", "  - ");

      // Unterstuetzen wir noch nicht
      text = text.replaceAll("<b>", "");
      text = text.replaceAll("</b>", "");
      text = text.replaceAll("<i>", "");
      text = text.replaceAll("</i>", "");
      text = text.replaceAll("<u>", "");
      text = text.replaceAll("</u>", "");
    }

    if (s != null) text += ("\n" + i18n.tr("Konto: {0}", s));

    super.setText(text);
  }
Beispiel #2
0
 /**
  * @see de.willuhn.jameica.gui.dialogs.PasswordDialog#paint(org.eclipse.swt.widgets.Composite)
  *     BUGZILLA 738
  */
 protected void paint(Composite parent) throws Exception {
   super.paint(parent);
   getShell().setMinimumSize(getShell().computeSize(WINDOW_WIDTH, SWT.DEFAULT));
 }