Package de.willuhn.util

Examples of de.willuhn.util.I18N


   * Erwartet keinen Parameter.
   * @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, UmsatzTyp.class);
      d.open();
    }
    catch (OperationCanceledException oce)
    {
      Logger.info(oce.getMessage());
      return;
    }
    catch (ApplicationException ae)
    {
      throw ae;
    }
    catch (Exception e)
    {
      Logger.error("error while importing categories",e);
      GUI.getStatusBar().setErrorText(i18n.tr("Fehler beim Importieren der Umsatz-Kategorien"));
    }
  }
View Full Code Here


   * falls sie nicht schon existieren.
   * @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)
      throw new ApplicationException(i18n.tr("Bitte w�hlen Sie ein oder mehrere Auftr�ge aus"));

    if (!(context instanceof Transfer) &&
        !(context instanceof Transfer[]) &&
        !(context instanceof Address) &&
        !(context instanceof Address[]) &&
        !(context instanceof Umsatz) &&
        !(context instanceof Umsatz[]))
      throw new ApplicationException(i18n.tr("Bitte w�hlen Sie ein oder mehrere Auftr�ge aus"));

    List<HibiscusAddress> items = new ArrayList<HibiscusAddress>();
    try {

      ///////////////////////////////////////////////////////////////
      // Transfers
      if (context instanceof Transfer)
      {
        Transfer t = (Transfer) context;
        items.add(create(t.getGegenkontoName(),t.getGegenkontoNummer(),t.getGegenkontoBLZ()));
      }
      else if (context instanceof Transfer[])
      {
        Transfer[] list = (Transfer[]) context;
        for (int i=0;i<list.length;++i)
        {
          Transfer t = list[i];
          items.add(create(t.getGegenkontoName(),t.getGegenkontoNummer(),t.getGegenkontoBLZ()));
        }
      }
      ///////////////////////////////////////////////////////////////
      // Hibiscus-Adressen
      else if (context instanceof HibiscusAddress)
      {
        items.add((HibiscusAddress)context);
      }
      else if (context instanceof HibiscusAddress[])
      {
        HibiscusAddress[] list = (HibiscusAddress[]) context;
        for (int i=0;i<list.length;++i)
        {
          items.add(list[i]);
        }
      }
      ///////////////////////////////////////////////////////////////
      // Address
      else if (context instanceof Address)
      {
        Address a = (Address) context;
        items.add(create(a.getName(),a.getKontonummer(),a.getBlz()));
      }
      else if (context instanceof Address[])
      {
        Address[] list = (Address[]) context;
        for (int i=0;i<list.length;++i)
        {
          Address a = list[i];
          items.add(create(a.getName(),a.getKontonummer(),a.getBlz()));
        }
      }
      ///////////////////////////////////////////////////////////////

      if (items.size() == 0)
        return;
     
      // Falls mehrere Eintraege markiert sind, kann es sein, dass einige
      // davon doppelt da sind, die fischen wir raus.
      HashMap seen = new HashMap();
      AddressbookService book = (AddressbookService) Application.getServiceFactory().lookup(HBCI.class,"addressbook");

      String q1 = i18n.tr("Eine Adresse mit dem Namen {0} (Kto. {1}, BLZ {2}) existiert bereits im Adressbuch.\n" +
                          "M�chten Sie die Adresse dennoch hinzuf�gen?");
      String q2 = i18n.tr("Eine Adresse mit dem Namen {0} (IBAN {1}) existiert bereits im Adressbuch.\n" +
                          "M�chten Sie die Adresse dennoch hinzuf�gen?");

      int count = 0;
      for (int i=0;i<items.size();++i)
      {
        // wir checken erstmal, ob wir den schon haben.
        HibiscusAddress e = items.get(i);

        if (e.getName() == null || e.getName().length() == 0)
        {
          Logger.warn("address [kto. " + e.getKontonummer() + ", blz " + e.getBlz() + " has no name, skipping");
          continue;
        }
        String key = e.getName() + "-" + e.getKontonummer() + "-" + e.getBlz() + "-" + e.getIban();
        if (seen.get(key) != null)
          continue; // den hatten wir schonmal. Und wir wollen den User doch nicht immer wieder fragen

        seen.put(key,e);

        if (book.contains(e) != null)
        {
          if (StringUtils.trimToNull(e.getKontonummer()) != null)
          {
            if (!Application.getCallback().askUser(q1,new String[]{e.getName(),e.getKontonummer(),e.getBlz()}))
              continue;
          }
          else
          {
            if (!Application.getCallback().askUser(q2,new String[]{e.getName(),e.getIban()}))
              continue;
          }
        }
       
        // OK, speichern
        e.store();
        count++;
      }
      if (count > 0)
        Application.getMessagingFactory().sendMessage(new StatusBarMessage(i18n.tr("Adresse{0} gespeichert",(count > 1 ? "n" : "")), StatusBarMessage.TYPE_SUCCESS));
    }
    catch (ApplicationException ae)
    {
      throw ae;
    }
    catch (Exception e)
    {
      Logger.error("error while storing empfaenger",e);
      GUI.getStatusBar().setErrorText(i18n.tr("Fehler beim Speichern des Empf�ngers"));
    }
  }
View Full Code Here

   * 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);
  }
View Full Code Here

  public About(int position)
  {
    super(position,false);

    AbstractPlugin plugin = Application.getPluginLoader().getPlugin(HBCI.class);
    final I18N i18n = plugin.getResources().getI18N();
   
    this.setTitle(i18n.tr("�ber ..."));
    this.setPanelText(i18n.tr("Hibiscus {0}",plugin.getManifest().getVersion().toString()));
  }
View Full Code Here

   * @see de.willuhn.jameica.gui.dialogs.AbstractDialog#paint(org.eclipse.swt.widgets.Composite)
   */
  protected void paint(Composite parent) throws Exception
  {
    AbstractPlugin plugin = Application.getPluginLoader().getPlugin(HBCI.class);
    final I18N i18n = plugin.getResources().getI18N();

    DBIterator list = Settings.getDBService().createList(Version.class);
    list.addFilter("name = ?","db");
    Version version = (Version) list.next();
   
    Label l = GUI.getStyleFactory().createLabel(parent,SWT.BORDER);
    l.setImage(SWTUtil.getImage("hibiscus.jpg"));

    Container container = new LabelGroup(parent,i18n.tr("Versionsinformationen"),true);
   
    FormTextPart text = new FormTextPart();
    text.setText("<form>" +
      "<p><b>Hibiscus - HBCI-Onlinebanking f�r Jameica</b></p>" +
      "<p>Lizenz: GPL [<a href=\"http://www.gnu.org/copyleft/gpl.html\">www.gnu.org/copyleft/gpl.html</a>]<br/>" +
      "Copyright by Olaf Willuhn [<a href=\"mailto:hibiscus@willuhn.de\">hibiscus@willuhn.de</a>]<br/>" +
      "<a href=\"http://www.willuhn.de/products/hibiscus/\">www.willuhn.de/products/hibiscus/</a></p>" +
      "<p>Software-Version: " + plugin.getManifest().getVersion() + "<br/>" +
      "Datenbank-Version: " + version.getVersion() + "<br/>" +
      "Build: " + plugin.getManifest().getBuildnumber() + " [Datum " + plugin.getManifest().getBuildDate() + "]</p>" +
      "</form>");

    container.addPart(text);

    ButtonArea buttons = new ButtonArea();
    buttons.addButton(i18n.tr("Datenbank-Informationen"), new Action() {
      public void handleAction(Object context) throws ApplicationException
      {
        try
        {
          new DebugDialog(DebugDialog.POSITION_CENTER).open();
        }
        catch (OperationCanceledException oce)
        {
          Logger.info(oce.getMessage());
          return;
        }
        catch (Exception e)
        {
          Logger.error("unable to display debug dialog",e);
          Application.getMessagingFactory().sendMessage(new StatusBarMessage(i18n.tr("Fehler beim Anzeigen der Datenbank-Informationen"), StatusBarMessage.TYPE_ERROR));
        }
      }
    },null,false,"dialog-information.png");
//    buttons.addButton(i18n.tr("Wallet"), new Action() {
//      public void handleAction(Object context) throws ApplicationException
//      {
//        try
//        {
//          new WalletDialog(DebugDialog.POSITION_CENTER).open();
//        }
//        catch (OperationCanceledException oce)
//        {
//          Logger.info(oce.getMessage());
//          return;
//        }
//        catch (Exception e)
//        {
//          Logger.error("unable to display wallet dialog",e);
//          Application.getMessagingFactory().sendMessage(new StatusBarMessage(i18n.tr("Fehler beim Anzeigen des Wallet"), StatusBarMessage.TYPE_ERROR));
//        }
//      }
//    },null,false,"stock_keyring.png");
    buttons.addButton(i18n.tr("Spenden"),new Action() {
      public void handleAction(Object context) throws ApplicationException
      {
        close();
        new DonateView().handleAction(null);
      }
    },null,false,"emblem-special.png");
    buttons.addButton(i18n.tr("Schlie�en"),new Action() {
      public void handleAction(Object context) throws ApplicationException
      {
        close();
      }
    },null,true,"window-close.png");
View Full Code Here

  /**
   * @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"));
    }
  }
View Full Code Here

   * @see de.willuhn.sql.version.Update#execute(de.willuhn.sql.version.UpdateProvider)
   */
  public void execute(UpdateProvider provider) throws ApplicationException
  {
    HBCIUpdateProvider myProvider = (HBCIUpdateProvider) provider;
    I18N i18n = myProvider.getResources().getI18N();

    // Wenn wir eine Tabelle erstellen wollen, muessen wir wissen, welche
    // SQL-Dialekt wir sprechen
    String driver = HBCIDBService.SETTINGS.getString("database.driver",DBSupportH2Impl.class.getName());
    if (driver == null || !driver.equals(DBSupportMySqlImpl.class.getName()))
    {
      Logger.info("skip update, not needed");
      return; // Update nur fuer MySQL noetig
    }
    try
    {
      Logger.info("update sql table for update0011");
      String sql = "ALTER TABLE version CHANGE name name VARCHAR(255) NOT NULL;\n";
      ScriptExecutor.execute(new StringReader(sql),myProvider.getConnection(),myProvider.getProgressMonitor());
      myProvider.getProgressMonitor().log(i18n.tr("Tabelle 'version' aktualisiert"));
    }
    catch (ApplicationException ae)
    {
      throw ae;
    }
    catch (Exception e)
    {
      Logger.error("unable to execute update",e);
      throw new ApplicationException(i18n.tr("Fehler beim Ausf�hren des Updates"),e);
    }
  }
View Full Code Here

   * @see de.willuhn.sql.version.Update#execute(de.willuhn.sql.version.UpdateProvider)
   */
  public void execute(UpdateProvider provider) throws ApplicationException
  {
    HBCIUpdateProvider myProvider = (HBCIUpdateProvider) provider;
    I18N i18n = myProvider.getResources().getI18N();

    // Wenn wir eine Tabelle erstellen wollen, muessen wir wissen, welche
    // SQL-Dialekt wir sprechen
    String driver = HBCIDBService.SETTINGS.getString("database.driver",DBSupportH2Impl.class.getName());
    String sql = (String) statements.get(driver);
    if (sql == null)
      throw new ApplicationException(i18n.tr("Datenbank {0} nicht wird unterst�tzt",driver));
   
    try
    {
      Logger.info("create sql table for update0019");
      ScriptExecutor.execute(new StringReader(sql),myProvider.getConnection(),myProvider.getProgressMonitor());
      myProvider.getProgressMonitor().log(i18n.tr("Tabelle 'empfaenger' aktualisiert"));
    }
    catch (ApplicationException ae)
    {
      throw ae;
    }
    catch (Exception e)
    {
      Logger.error("unable to execute update",e);
      throw new ApplicationException(i18n.tr("Fehler beim Ausf�hren des Updates"),e);
    }
  }
View Full Code Here

   * @see de.willuhn.sql.version.Update#execute(de.willuhn.sql.version.UpdateProvider)
   */
  public void execute(UpdateProvider provider) throws ApplicationException
  {
    HBCIUpdateProvider myProvider = (HBCIUpdateProvider) provider;
    I18N i18n = myProvider.getResources().getI18N();

    // Wenn wir eine Tabelle erstellen wollen, muessen wir wissen, welche
    // SQL-Dialekt wir sprechen
    String driver = HBCIDBService.SETTINGS.getString("database.driver",DBSupportH2Impl.class.getName());
    String sql = (String) statements.get(driver);
    if (sql == null)
      throw new ApplicationException(i18n.tr("Datenbank {0} wird nicht unterst�tzt",driver));
   
    try
    {
      Logger.info("create sql table for update0006");
      ScriptExecutor.execute(new StringReader(sql),myProvider.getConnection(),myProvider.getProgressMonitor());
      myProvider.getProgressMonitor().log(i18n.tr("Tabelle 'property' erstellt"));
    }
    catch (ApplicationException ae)
    {
      throw ae;
    }
    catch (Exception e)
    {
      Logger.error("unable to execute update",e);
      throw new ApplicationException(i18n.tr("Fehler beim Ausf�hren des Updates"),e);
    }
  }
View Full Code Here

        context = u;
      }
      catch (RemoteException re)
      {
        Logger.error("unable to create umsatz",re);
        I18N i18n = Application.getPluginLoader().getPlugin(HBCI.class).getResources().getI18N();
        throw new ApplicationException(i18n.tr("Fehler beim Anlegen des Umsatzes: {0}",re.getMessage()));
      }
    }
    else if (!(context instanceof Umsatz))
      return;
    GUI.startView(de.willuhn.jameica.hbci.gui.views.UmsatzDetailEdit.class,context);
View Full Code Here

TOP

Related Classes of de.willuhn.util.I18N

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.