예제 #1
0
  /**
   * ct.
   *
   * @param config die PINTAN-Config.
   * @throws RemoteException
   */
  public TANDialog(PinTanConfig config) throws RemoteException {
    super(TANDialog.POSITION_CENTER);

    this.config = config;
    this.setSize(WINDOW_WIDTH, SWT.DEFAULT);

    // Deaktivierung der Anzeige von Sternen im TAN-Dialog.
    setShowPassword(this.config != null && this.config.getShowTan());

    setLabelText(i18n.tr("TAN"));

    // Einmal aufrufen, damit der Text gesetzt wird.
    setText(null);

    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 (s != null) setTitle(i18n.tr("TAN-Eingabe - Konto {0}", s));
    else setTitle(i18n.tr("TAN-Eingabe"));
  }
예제 #2
0
  /** @see de.willuhn.jameica.gui.dialogs.AbstractDialog#paint(org.eclipse.swt.widgets.Composite) */
  protected void paint(Composite parent) throws Exception {
    LabelGroup group = new LabelGroup(parent, i18n.tr("Auswahl des Import-Filters"));
    group.addText(i18n.tr("Bitte wählen Sie das gewünschte Dateiformat für den Import aus"), true);

    Input formats = getImporterList();
    group.addLabelPair(i18n.tr("Verfügbare Formate:"), formats);

    ButtonArea buttons = new ButtonArea(parent, 2);
    Button button =
        new Button(
            i18n.tr("Import starten"),
            new Action() {
              public void handleAction(Object context) throws ApplicationException {
                doImport();
              }
            },
            null,
            true);
    button.setEnabled(!(formats instanceof LabelInput));
    buttons.addButton(button);
    buttons.addButton(
        i18n.tr("Abbrechen"),
        new Action() {
          public void handleAction(Object context) throws ApplicationException {
            throw new OperationCanceledException();
          }
        });
    getShell().setMinimumSize(getShell().computeSize(WINDOW_WIDTH, SWT.DEFAULT));
  }
예제 #3
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"));
  }
예제 #4
0
  /** @see de.willuhn.datasource.db.AbstractDBObject#insertCheck() */
  protected void insertCheck() throws ApplicationException {
    try {

      if (getZeiteinheit() != Turnus.ZEITEINHEIT_MONATLICH
          && getZeiteinheit() != Turnus.ZEITEINHEIT_WOECHENTLICH)
        throw new ApplicationException(i18n.tr("Bitte wählen Sie eine gültige Zeiteinheit aus"));

      if (getIntervall() < 1)
        throw new ApplicationException(i18n.tr("Bitte geben Sie ein gültiges Intervall ein"));

      // BUGZILLA #49 http://www.willuhn.de/bugzilla/show_bug.cgi?id=49
      if (getZeiteinheit() == Turnus.ZEITEINHEIT_MONATLICH
          && (getTag() < 1 || getTag() > 31)
          && getTag() != HBCIProperties.HBCI_LAST_OF_MONTH)
        throw new ApplicationException(
            i18n.tr(
                "Bei monatlicher Zeiteinheit darf der Zahltag nicht kleiner als 1 und nicht größer als 31 sein. Angegebener Tag: {0}",
                "" + getTag()));

      if (getZeiteinheit() == Turnus.ZEITEINHEIT_WOECHENTLICH && (getTag() < 1 || getTag() > 7))
        throw new ApplicationException(i18n.tr("Bitte wählen Sie einen gültigen Wochentag"));
    } catch (RemoteException e) {
      Logger.error("error in turnus insertCheck", e);
      throw new ApplicationException(i18n.tr("Fehler beim Speichern des Turnus"));
    }
  }
  /** @see de.willuhn.datasource.db.AbstractDBObject#insertCheck() */
  protected void insertCheck() throws ApplicationException {
    try {
      if (getKonto() == null)
        throw new ApplicationException(i18n.tr("Bitte wählen Sie ein Konto aus."));
      if (getKonto().isNewObject())
        throw new ApplicationException(i18n.tr("Bitte speichern Sie zunächst das Konto"));

      if (getGegenkontoNummer() == null || getGegenkontoNummer().length() == 0)
        throw new ApplicationException(
            i18n.tr("Bitte geben Sie die Kontonummer des Gegenkontos ein"));

      if (getGegenkontoBLZ() == null || getGegenkontoBLZ().length() == 0)
        throw new ApplicationException(i18n.tr("Bitte geben Sie die BLZ des Gegenkontos ein"));

      // BUGZILLA 280
      HBCIProperties.checkChars(getGegenkontoNummer(), HBCIProperties.HBCI_KTO_VALIDCHARS);
      HBCIProperties.checkChars(getGegenkontoBLZ(), HBCIProperties.HBCI_BLZ_VALIDCHARS);
      HBCIProperties.checkLength(getGegenkontoNummer(), HBCIProperties.HBCI_KTO_MAXLENGTH_HARD);

      double betrag = getBetrag();
      if (betrag == 0.0 || Double.isNaN(betrag))
        throw new ApplicationException(i18n.tr("Bitte geben Sie einen gültigen Betrag ein."));

      if (getGegenkontoName() == null || getGegenkontoName().length() == 0)
        throw new ApplicationException(
            i18n.tr("Bitte geben Sie den Namen des Kontoinhabers des Gegenkontos ein"));

      int blzLen = getGegenkontoBLZ().length();
      if (blzLen != HBCIProperties.HBCI_BLZ_LENGTH)
        throw new ApplicationException(
            i18n.tr(
                "Ungültige BLZ \"{0}\". Muss {1} Stellen lang sein.",
                new String[] {getGegenkontoBLZ(), "" + HBCIProperties.HBCI_BLZ_LENGTH}));

      HBCIProperties.checkLength(getGegenkontoName(), HBCIProperties.HBCI_TRANSFER_NAME_MAXLENGTH);

      // BUGZILLA 163
      HBCIProperties.checkChars(getGegenkontoName(), HBCIProperties.HBCI_DTAUS_VALIDCHARS);

      if (!HBCIProperties.checkAccountCRC(getGegenkontoBLZ(), getGegenkontoNummer()))
        throw new ApplicationException(
            i18n.tr("Ungültige BLZ/Kontonummer. Bitte prüfen Sie Ihre Eingaben."));

      if (getZweck() == null || "".equals(getZweck()))
        throw new ApplicationException(i18n.tr("Bitte geben Sie einen Verwendungszweck ein"));

      HBCIProperties.checkLength(getZweck(), HBCIProperties.HBCI_TRANSFER_USAGE_MAXLENGTH);
      HBCIProperties.checkLength(getZweck2(), HBCIProperties.HBCI_TRANSFER_USAGE_MAXLENGTH);

      HBCIProperties.checkChars(getZweck(), HBCIProperties.HBCI_DTAUS_VALIDCHARS);
      HBCIProperties.checkChars(getZweck2(), HBCIProperties.HBCI_DTAUS_VALIDCHARS);

      VerwendungszweckUtil.checkMaxUsage(this);
    } catch (RemoteException e) {
      Logger.error("error while checking transfer", e);
      throw new ApplicationException(i18n.tr("Fehler beim Prüfen des Auftrages."));
    }
  }
예제 #6
0
  /** @see de.willuhn.jameica.gui.AbstractView#bind() */
  public void bind() throws Exception {
    I18N i18n = Application.getPluginLoader().getPlugin(HBCI.class).getResources().getI18N();

    GUI.getView().setTitle(i18n.tr("Sparquote eines Kontos"));

    de.willuhn.jameica.hbci.gui.parts.SparQuote q =
        new de.willuhn.jameica.hbci.gui.parts.SparQuote();
    q.paint(getParent());
  }
예제 #7
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);
  }
예제 #8
0
 /** @see de.willuhn.datasource.db.AbstractDBObject#deleteCheck() */
 protected void deleteCheck() throws ApplicationException {
   try {
     if (isInitial())
       throw new ApplicationException(
           i18n.tr("Turnus ist Bestandteil der System-Daten und kann nicht gelöscht werden."));
   } catch (RemoteException e) {
     Logger.error("error in turnus deletCheck", e);
     throw new ApplicationException(i18n.tr("Fehler beim Löschen des Turnus"));
   }
 }
예제 #9
0
  /**
   * Ueberschrieben, um einen DisposeListener an das Composite zu haengen.
   *
   * @see de.willuhn.jameica.gui.parts.TablePart#paint(org.eclipse.swt.widgets.Composite)
   */
  public synchronized void paint(Composite parent) throws RemoteException {
    final TabFolder folder = new TabFolder(parent, SWT.NONE);
    folder.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    TabGroup tab = new TabGroup(folder, i18n.tr("Anzeige einschränken"));

    ColumnLayout cols = new ColumnLayout(tab.getComposite(), 2);

    {
      this.left = new SimpleContainer(cols.getComposite());

      Input t = this.getText();
      this.left.addInput(t);

      // Duerfen wir erst nach dem Zeichnen
      t.getControl().addKeyListener(new DelayedAdapter());

      this.left.addInput(this.getKonto());
    }

    {
      Container right = new SimpleContainer(cols.getComposite());

      right.addInput(this.getRange());
      MultiInput range = new MultiInput(this.getFrom(), this.getTo());
      right.addInput(range);
    }

    this.buttons.addButton(
        i18n.tr("Aktualisieren"),
        new Action() {
          public void handleAction(Object context) throws ApplicationException {
            handleReload(true);
          }
        },
        null,
        true,
        "view-refresh.png");
    this.buttons.paint(parent);

    // Erstbefuellung
    GenericIterator items =
        getList(
            getKonto().getValue(),
            (Date) getFrom().getValue(),
            (Date) getTo().getValue(),
            (String) getText().getValue());
    if (items != null) {
      items.begin();
      while (items.hasNext()) addItem(items.next());
    }

    super.paint(parent);
  }
예제 #10
0
  /** @see de.willuhn.jameica.gui.Part#paint(org.eclipse.swt.widgets.Composite) */
  public void paint(Composite parent) throws RemoteException {
    try {
      if (this.konto == null) {
        if (tiny) {
          ColumnLayout layout = new ColumnLayout(parent, 2);
          Container left = new SimpleContainer(layout.getComposite());
          left.addInput(this.getKontoAuswahl());
          Container right = new SimpleContainer(layout.getComposite());
          right.addInput(this.getRange());
        } else {
          final TabFolder folder = new TabFolder(parent, SWT.NONE);
          folder.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
          TabGroup tab = new TabGroup(folder, i18n.tr("Anzeige einschränken"));

          tab.addInput(this.getKontoAuswahl());
          tab.addInput(this.getRange());

          ButtonArea buttons = new ButtonArea();
          buttons.addButton(
              i18n.tr("Aktualisieren"),
              new Action() {

                /** @see de.willuhn.jameica.gui.Action#handleAction(java.lang.Object) */
                public void handleAction(Object context) throws ApplicationException {
                  reloadListener.handleEvent(new Event());
                }
              },
              null,
              true,
              "view-refresh.png");

          buttons.paint(parent);
        }
      } else {
        Container container = new SimpleContainer(parent);
        container.addInput(this.getRange());
      }

      this.chart = new LineChart();
      this.reloadListener.handleEvent(null); // einmal initial ausloesen
      chart.paint(parent);
    } catch (RemoteException re) {
      throw re;
    } catch (Exception e) {
      Logger.error("unable to paint chart", e);
      Application.getMessagingFactory()
          .sendMessage(
              new StatusBarMessage(
                  i18n.tr("Fehler beim Anzeigen des Saldo-Verlaufs"), StatusBarMessage.TYPE_ERROR));
    }
  }
  /** @see de.willuhn.datasource.db.AbstractDBObject#store() */
  public void store() throws RemoteException, ApplicationException {
    try {
      this.transactionBegin();
      super.store();

      Konto k = this.getKonto();
      String blz = getGegenkontoBLZ();
      if (blz != null) {
        String[] params =
            new String[] {
              getGegenkontoName(),
              getGegenkontoNummer(),
              getGegenkontoBLZ(),
              k.getWaehrung(),
              HBCI.DECIMALFORMAT.format(getBetrag())
            };
        k.addToProtokoll(
            i18n.tr("Auftrag [Gegenkonto: {0}, Kto. {1}, BLZ {2}] {3} {4} gespeichert", params),
            Protokoll.TYP_SUCCESS);
      } else {
        String[] params =
            new String[] {
              getGegenkontoName(),
              getGegenkontoNummer(),
              k.getWaehrung(),
              HBCI.DECIMALFORMAT.format(getBetrag())
            };
        k.addToProtokoll(
            i18n.tr("Auftrag [Gegenkonto: {0}, Kto. {1}] {2} {3} gespeichert", params),
            Protokoll.TYP_SUCCESS);
      }

      this.transactionCommit();
    } catch (RemoteException re) {
      try {
        this.transactionRollback();
      } catch (Exception e2) {
        Logger.error("unable to rollback transaction", e2);
      }
      throw re;
    } catch (ApplicationException ae) {
      try {
        this.transactionRollback();
      } catch (Exception e2) {
        Logger.error("unable to rollback transaction", e2);
      }
      throw ae;
    }
  }
예제 #12
0
  /**
   * Versucht, das Objekt als Integer-Zahl zu parsen.
   *
   * @param o das Objekt. Darf NICHT NULL sein.
   * @return die Zahl.
   * @throws ApplicationException
   */
  public static int parse(Object o, String spalte) throws ApplicationException {
    if (o == null) {
      throw new ApplicationException(i18n.tr("Ungültiger Wert in Spalte " + spalte));
    }

    try {
      if (o instanceof Number) {
        return ((Number) o).intValue();
      }
      return Integer.parseInt(o.toString());
    } catch (Exception e) {
      throw new ApplicationException(
          i18n.tr("Ungültiger Wert in Spalte {1}: {0}", o.toString(), spalte));
    }
  }
예제 #13
0
  /**
   * Erwartet ein Objekt vom Typ <code>Konto</code> im Context.
   *
   * @see de.willuhn.jameica.gui.Action#handleAction(java.lang.Object)
   */
  public void handleAction(Object context) throws ApplicationException {
    I18N i18n = Application.getPluginLoader().getPlugin(HBCI.class).getResources().getI18N();
    if (context == null || !(context instanceof Konto))
      throw new ApplicationException(i18n.tr("Bitte wählen Sie ein Konto aus."));

    Konto k = (Konto) context;

    try {
      if (k.isNewObject()) k.store(); // wir speichern eigenmaechtig
    } catch (RemoteException e) {
      Logger.error("error while storing konto", e);
      GUI.getStatusBar().setErrorText(i18n.tr("Fehler beim Speichern des Kontos"));
    }
    GUI.startView(de.willuhn.jameica.hbci.gui.views.UmsatzList.class, k);
  }
  /** @see de.willuhn.jameica.gui.Action#handleAction(java.lang.Object) */
  public void handleAction(Object context) throws ApplicationException {
    I18N i18n = Application.getPluginLoader().getPlugin(HBCI.class).getResources().getI18N();

    try {
      ImportDialog d = new ImportDialog(null, AuslandsUeberweisung.class);
      d.open();
    } catch (OperationCanceledException oce) {
      Logger.info(oce.getMessage());
      return;
    } catch (ApplicationException ae) {
      throw ae;
    } catch (Exception e) {
      Logger.error("error while importing transfers", e);
      GUI.getStatusBar().setErrorText(i18n.tr("Fehler beim Importieren der SEPA-Überweisungen"));
    }
  }
예제 #15
0
  /**
   * Ueberschrieben, um die Summe zu berechnen.
   *
   * @see de.willuhn.jameica.gui.parts.TablePart#getSummary()
   */
  @Override
  protected String getSummary() {
    try {
      Object o = this.getSelection();
      int size = this.size();

      // nichts markiert oder nur einer, dann muss nichts berechnet werden
      if (o == null || size == 1 || !(o instanceof Object[])) {
        return super.getSummary();
      }

      // Andernfalls berechnen wir die Summe
      Object[] list = (Object[]) o;
      BigDecimal sum = this.calculateSum(list);
      if (sum == null) return super.getSummary();

      return i18n.tr(
          "{0} Aufträge, {1} markiert, Summe: {2} {3}",
          Integer.toString(size),
          Integer.toString(list.length),
          HBCI.DECIMALFORMAT.format(sum),
          HBCIProperties.CURRENCY_DEFAULT_DE);
    } catch (Exception e) {
      Logger.error("error while updating summary", e);
    }
    return super.getSummary();
  }
예제 #16
0
  /**
   * Liefert ein Eingabefeld fuer einen Suchbegriff.
   *
   * @return Eingabefeld fuer einen Suchbegriff.
   */
  public Input getText() {
    if (this.text != null) return this.text;

    this.text = new TextInput(settings.getString("transferlist.filter.text", null), 255);
    this.text.setName(i18n.tr("Suchbegriff"));
    return this.text;
  }
예제 #17
0
 /** @see de.willuhn.jameica.gui.dialogs.PasswordDialog#checkPassword(java.lang.String) */
 protected boolean checkPassword(String password) {
   if (password == null || password.length() == 0) {
     setErrorText(i18n.tr("Fehler: Bitte geben Sie Ihr Passwort ein.") + " " + getRetryString());
     return false;
   }
   return true;
 }
  /** @see de.willuhn.datasource.db.AbstractDBObject#delete() */
  public void delete() throws RemoteException, ApplicationException {
    try {
      this.transactionBegin();

      super.delete();

      // und noch in's Protokoll schreiben.
      Konto k = this.getKonto();
      if (k != null)
        k.addToProtokoll(
            i18n.tr(
                "Auftrag [Gegenkonto: {0}, Kto. {1}, BLZ {2}] {3} {4} gelöscht",
                getGegenkontoName(),
                getGegenkontoNummer(),
                getGegenkontoBLZ(),
                k.getWaehrung(),
                HBCI.DECIMALFORMAT.format(getBetrag())),
            Protokoll.TYP_SUCCESS);

      this.transactionCommit();
    } catch (RemoteException re) {
      this.transactionRollback();
      throw re;
    } catch (ApplicationException ae) {
      this.transactionRollback();
      throw ae;
    }
  }
  /**
   * Liefert die Liste der verfuegbaren HBCI-Varianten.
   *
   * @return die Liste der verfuegbaren HBCI-Varianten.
   */
  public synchronized List<InfoPanel> getVariants() {
    if (this.variants != null) return this.variants;

    this.variants = new ArrayList<InfoPanel>();

    BeanService bs = Application.getBootLoader().getBootable(BeanService.class);
    final HBCIAccountProvider hbci = bs.get(HBCIAccountProvider.class);

    for (final HBCIVariant v : hbci.getVariants()) {
      InfoPanel p = v.getInfo();
      final Button button =
          new Button(
              i18n.tr("Verfahren auswählen..."),
              new Action() {
                @Override
                public void handleAction(Object context) throws ApplicationException {
                  Logger.info(
                      "creating new account. type: "
                          + hbci.getName()
                          + ", variant: "
                          + v.getName());
                  v.create();
                }
              },
              null,
              false,
              "go-next.png");
      p.addButton(button);
      this.variants.add(p);
    }

    return this.variants;
  }
  /**
   * @see de.willuhn.jameica.hbci.io.Exporter#doExport(java.lang.Object[],
   *     de.willuhn.jameica.hbci.io.IOFormat, java.io.OutputStream, de.willuhn.util.ProgressMonitor)
   */
  public void doExport(Object[] objects, IOFormat format, OutputStream os, ProgressMonitor monitor)
      throws RemoteException, ApplicationException {
    if (objects == null || !(objects instanceof UmsatzTree[]))
      throw new ApplicationException(i18n.tr("Bitte wählen Sie die zu exportierenden Umsätze aus"));

    UmsatzTree[] t = (UmsatzTree[]) objects;
    if (t.length == 0)
      throw new ApplicationException(i18n.tr("Bitte wählen Sie die zu exportierenden Umsätze aus"));

    UmsatzTree tree = t[0];
    List list = tree.getUmsatzTree();
    Konto k = tree.getKonto();

    String subTitle =
        i18n.tr(
            "Zeitraum {0} - {1}, {2}",
            HBCI.DATEFORMAT.format(tree.getStart()),
            HBCI.DATEFORMAT.format(tree.getEnd()),
            k == null ? i18n.tr("alle Konten") : k.getBezeichnung());

    Reporter reporter = null;
    try {
      reporter = new Reporter(os, monitor, i18n.tr("Umsatzkategorien"), subTitle, list.size());

      reporter.addHeaderColumn(i18n.tr("Kategorie"), Element.ALIGN_CENTER, 130, Color.LIGHT_GRAY);
      reporter.addHeaderColumn(i18n.tr("Einnahmen"), Element.ALIGN_CENTER, 30, Color.LIGHT_GRAY);
      reporter.addHeaderColumn(i18n.tr("Ausgaben"), Element.ALIGN_CENTER, 30, Color.LIGHT_GRAY);
      reporter.addHeaderColumn(i18n.tr("Betrag"), Element.ALIGN_CENTER, 30, Color.LIGHT_GRAY);
      reporter.createHeader();

      // Iteration ueber die Kategorien
      for (int i = 0; i < list.size(); ++i) {
        renderNode(reporter, (UmsatzTreeNode) list.get(i), 0);
        reporter.setNextRecord();
      }
      if (monitor != null) monitor.setStatus(ProgressMonitor.STATUS_DONE);
    } catch (Exception e) {
      if (monitor != null) monitor.setStatus(ProgressMonitor.STATUS_ERROR);
      Logger.error("error while creating report", e);
      throw new ApplicationException(
          i18n.tr("Fehler beim Erzeugen der Auswertung: {0}", e.getMessage()), e);
    } finally {
      if (reporter != null) {
        try {
          reporter.close();
        } catch (Exception e) {
          Logger.error("unable to close report", e);
        }
      }
    }
  }
예제 #21
0
  /**
   * Liefert das Eingabe-Datum fuer das Start-Datum.
   *
   * @return Eingabe-Feld.
   */
  private synchronized Input getFrom() {
    if (this.from != null) return this.from;

    this.from = new DateFromInput();
    this.from.setName(i18n.tr("Von"));
    this.from.setComment(null);
    this.from.addListener(this.listener);
    return this.from;
  }
예제 #22
0
  /**
   * Liefert das Eingabe-Datum fuer das End-Datum.
   *
   * @return Eingabe-Feld.
   */
  public synchronized Input getTo() {
    if (this.to != null) return this.to;

    this.to = new DateToInput();
    this.to.setName(i18n.tr("bis"));
    this.to.setComment(null);
    this.to.addListener(this.listener);
    return this.to;
  }
예제 #23
0
  /**
   * ct.
   *
   * @param context Context.
   * @param type die Art der zu importierenden Objekte.
   */
  public ImportDialog(GenericObject context, Class type) {
    super(POSITION_CENTER);

    this.context = context;
    this.type = type;

    this.setTitle(i18n.tr("Daten-Import"));
    this.setSize(WINDOW_WIDTH, SWT.DEFAULT);
  }
예제 #24
0
  /**
   * ct.
   *
   * @throws RemoteException
   */
  public KontenrahmenList() throws RemoteException {
    super(init(), new KontoListe());
    this.setRememberColWidths(true);
    this.setRememberOrder(true);
    this.setSummary(false);
    this.addColumn(i18n.tr("Bezeichnung"), "name");
    this.addColumn(i18n.tr("Zugeordneter Mandant"), "mandant_id");

    ContextMenu menu = new ContextMenu();
    menu.addItem(
        new CheckedSingleContextMenuItem(
            i18n.tr("Duplizieren..."), new KontenrahmenClone(), "gtk-dnd-multiple.png"));

    // TODO: Support zum Loeschen von Kontenrahmen fehlt noch
    //    menu.addItem(ContextMenuItem.SEPARATOR);
    //    menu.addItem(new CheckedSingleContextMenuItem(i18n.tr("Löschen..."),new
    // DBObjectDelete(),"user-trash-full.png"));
    this.setContextMenu(menu);
  }
예제 #25
0
  /** Erzeugt ein Kontext-Menu fuer eine Liste von Dauerauftraegen. */
  public DauerauftragList() {
    i18n = Application.getPluginLoader().getPlugin(HBCI.class).getResources().getI18N();

    addItem(
        new CheckedContextMenuItem(i18n.tr("Öffnen"), new DauerauftragNew(), "document-open.png"));
    addItem(
        new CheckedContextMenuItem(
            i18n.tr("Löschen..."), new DBObjectDelete(), "user-trash-full.png"));
    addItem(ContextMenuItem.SEPARATOR);
    addItem(
        new CheckedSingleContextMenuItem(
            i18n.tr("Drucken..."),
            new Action() {
              public void handleAction(Object context) throws ApplicationException {
                new Print().handleAction(new PrintSupportDauerauftrag((Dauerauftrag) context));
              }
            },
            "document-print.png"));
  }
 /** @see de.willuhn.jameica.search.Result#getName() */
 public String getName() {
   try {
     Konto k = u.getKonto();
     String[] params =
         new String[] {
           HBCI.DATEFORMAT.format(u.getTermin()),
           HBCI.DECIMALFORMAT.format(u.getBetrag()),
           k.getWaehrung(),
           u.getGegenkontoName(),
           u.getZweck(),
           k.getLongName(),
         };
     I18N i18n = Application.getPluginLoader().getPlugin(HBCI.class).getResources().getI18N();
     return i18n.tr("{0}: {1} {2} an {3} - {4} (via {5})", params);
   } catch (RemoteException re) {
     Logger.error("unable to determin result name", re);
     return null;
   }
 }
예제 #27
0
  /** @see de.willuhn.jameica.hbci.passports.rdh.keyformat.KeyFormat#importKey(java.io.File) */
  public RDHKey importKey(File file) throws ApplicationException, OperationCanceledException {
    // Checken, ob die Datei lesbar ist.
    if (file == null)
      throw new ApplicationException(i18n.tr("Bitte wählen Sie eine Schlüsseldatei aus"));

    if (!file.canRead() || !file.isFile())
      throw new ApplicationException(i18n.tr("Schlüsseldatei nicht lesbar"));

    // Das ist ein Hibiscus-Schluessel. Wir lassen den Schluessel gleich dort, wo er ist
    try {
      RDHKeyImpl key = new RDHKeyImpl(file);
      key.setFormat(this);
      return key;
    } catch (RemoteException re) {
      Logger.error("unable to import key " + file.getAbsolutePath(), re);
      throw new ApplicationException(
          i18n.tr("Schlüsseldatei kann nicht importiert werden: {0}", re.getMessage()));
    }
  }
예제 #28
0
  /**
   * Liefert die Konto-Auwahl.
   *
   * @return die Konto-Auswahl.
   * @throws RemoteException
   */
  private SelectInput getKontoAuswahl() throws RemoteException {
    if (this.kontoauswahl != null) return this.kontoauswahl;

    this.kontoauswahl = new KontoInput(null, KontoFilter.ALL);
    this.kontoauswahl.setRememberSelection("auswertungen.saldochart");
    this.kontoauswahl.setPleaseChoose(i18n.tr("<Alle Konten>"));
    if (tiny) this.kontoauswahl.setComment(null); // Keinen Kommentar anzeigen
    this.kontoauswahl.addListener(this.reloadListener);
    return this.kontoauswahl;
  }
예제 #29
0
  /**
   * Liefert ein Auswahlfeld fuer das Konto.
   *
   * @return Auswahlfeld fuer das Konto.
   * @throws RemoteException
   */
  public KontoInput getKonto() throws RemoteException {
    if (this.konto != null) return this.konto;

    this.konto = new KontoInput(null, KontoFilter.ALL);
    this.konto.setPleaseChoose(i18n.tr("<Alle Konten>"));
    this.konto.setSupportGroups(true);
    this.konto.setComment(null);
    this.konto.setRememberSelection("auftraege");
    this.konto.addListener(this.listener);
    return this.konto;
  }
예제 #30
0
  /**
   * ct.
   *
   * @param position Position des Dialogs.
   * @param passport optionale Angabe des Passport.
   */
  public KeyPasswordSaveDialog(int position, HBCIPassport passport) {
    super(position);

    setTitle(i18n.tr("Passwort-Eingabe"));
    setLabelText(i18n.tr("Ihr Passwort"));

    String text =
        i18n.tr(
            "Bitte vergeben Sie ein Passwort, mit dem der zu speichernde\nSchlüssel geschützt werden soll.");

    if (passport instanceof HBCIPassportRDHXFile)
      text += "\n\n" + i18n.tr("Geben Sie bitte mindestens 8 Zeichen ein.");
    else
      text +=
          "\n\n"
              + i18n.tr(
                  "Die folgenden Zeichen dürfen nicht enthalten sein: {0}",
                  String.copyValueOf(INVALID_CHARS));
    setText(text + "\n");
  }