Package de.willuhn.jameica.system

Examples of de.willuhn.jameica.system.OperationCanceledException


      }
    },null,false,"ok.png");
    buttons.addButton(i18n.tr("Abbrechen"), new Action() {
      public void handleAction(Object context) throws ApplicationException
      {
        throw new OperationCanceledException();
      }
    },null,false,"process-stop.png");
    buttons.paint(parent);
  }
View Full Code Here


      int factor = 100 / (list.size() * DDVConfig.PORTS.length);
           
      for (Reader reader:list)
      {
        if (task.isInterrupted())
          throw new OperationCanceledException();
       
        monitor.setStatusText(i18n.tr("Teste {0}",reader.getName()));

        // Testen, ob der Kartenleser ueberhaupt unterstuetzt wird
        if (!reader.isSupported())
        {
          monitor.log("  " + i18n.tr("�berspringe Kartenleser, wird von Ihrem System nicht unterst�tzt"));
          continue;
        }

        // Checken, ob der CTAPI-Treiber existiert.
        String s = StringUtils.trimToNull(reader.getCTAPIDriver());
        Type type = reader.getType();
        if (type.isCTAPI())
        {
          if (s == null)
          {
            monitor.log("  " + i18n.tr("�berspringe Kartenleser, kein CTAPI-Treiber definiert."));
            continue;
          }
          File f = new File(s);
          if (!f.exists())
          {
            monitor.log("  " + i18n.tr("�berspringe Kartenleser, CTAPI-Treiber {0} existiert nicht.",f.getAbsolutePath()));
            continue;
          }
        }

        int ctNumber = reader.getCTNumber();
        temp.setCTNumber(ctNumber == -1 ? 0 : ctNumber);
        temp.setEntryIndex(1);
        temp.setReaderPreset(reader);
        temp.setSoftPin(reader.useSoftPin());
        temp.setCTAPIDriver(s);
        temp.setHBCIVersion(reader.getDefaultHBCIVersion());

        // PC/SC-Kartenleser suchen
        if (type.isPCSC())
        {
          try
          {
            List<CardTerminal> terminals = TerminalFactory.getDefault().terminals().list();
            // Eigentlich koennen wir hier pauschal den ersten gefundenen nehmen
            if (terminals != null && terminals.size() > 0)
            {
              CardTerminal terminal = terminals.get(0);
              String name = terminal.getName();
              temp.setPCSCName(name);
              PassportHandle handle = new PassportHandleImpl(temp);
              handle.open();
              handle.close(); // nein, nicht im finally, denn wenn das Oeffnen

              // Passport liess sich oeffnen und schliessen. Dann haben
              // wir den Kartenleser gefunden.
              monitor.log("  " + name + " " + i18n.tr("gefunden"));
              monitor.setStatusText(i18n.tr("OK. Kartenleser \"{0}\" gefunden",name));
              monitor.setStatus(ProgressMonitor.STATUS_DONE);
              monitor.setPercentComplete(100);
             
              // Wir kopieren die temporaere Config noch in eine richtige
              DDVConfig config = temp.copy();
              config.setName(name);
              return config;
            }
          }
          catch (ApplicationException ae)
          {
            monitor.log("  " + ae.getMessage());
          }
          catch (Exception e)
          {
            Logger.error("unable to create ddv config",e);
          }
          finally
          {
            temp.setPCSCName(null); // muessen wir wieder zuruecksetzen
          }
         
          // Wir haben wohl nichts via PC/SC gefunden
          monitor.log("  " + i18n.tr("  nicht gefunden"));
          continue;
        }

        // Wir probieren alle Ports durch
        for (String port:DDVConfig.PORTS)
        {
          if (task.isInterrupted())
            throw new OperationCanceledException();
         
          monitor.addPercentComplete(factor);
          monitor.log("  " + i18n.tr("Port {0}",port));
               
          temp.setPort(port);
View Full Code Here

    {
      throw oce;
    }
    catch (Exception e)
    {
      OperationCanceledException oce = (OperationCanceledException) HBCIProperties.getCause(e,OperationCanceledException.class);
      if (oce != null)
        throw oce;
       
      ApplicationException ae = (ApplicationException) HBCIProperties.getCause(e,ApplicationException.class);
      if (ae != null)
View Full Code Here

    {
      throw oce;
    }
    catch (Exception e)
    {
      OperationCanceledException oce = (OperationCanceledException) HBCIProperties.getCause(e,OperationCanceledException.class);
      if (oce != null)
        throw oce;
       
      ApplicationException ae = (ApplicationException) HBCIProperties.getCause(e,ApplicationException.class);
      if (ae != null)
View Full Code Here

      }
    },null,true);
    buttons.addButton(i18n.tr("Abbrechen"), new Action() {
      public void handleAction(Object context) throws ApplicationException
      {
        throw new OperationCanceledException();
      }
    });
    buttons.paint(parent);
  }
View Full Code Here

    },null,true,"ok.png");
    buttons.addButton(i18n.tr("Abbrechen"), new Action()
    {
      public void handleAction(Object context) throws ApplicationException
      {
        throw new OperationCanceledException();
      }
    },null,false,"process-stop.png");
    c.addButtonArea(buttons);

    getShell().setMinimumSize(getShell().computeSize(WINDOW_WIDTH,SWT.DEFAULT));
View Full Code Here

    {
      throw oce;
    }
    catch (Exception e)
    {
      OperationCanceledException oce = (OperationCanceledException) HBCIProperties.getCause(e,OperationCanceledException.class);
      if (oce != null)
        throw oce;
       
      ApplicationException ae = (ApplicationException) HBCIProperties.getCause(e,ApplicationException.class);
      if (ae != null)
View Full Code Here

        if (!f.exists())
        {
          InsertKeyDialog kd = new InsertKeyDialog(f);
          Boolean b = (Boolean) kd.open();
          if (b == null || !b.booleanValue())
            throw new OperationCanceledException(i18n.tr("Schl�sseldiskette nicht eingelegt oder nicht lesbar"));
        }
      }
     
      HBCI plugin = (HBCI) Application.getPluginLoader().getPlugin(HBCI.class);
      callback = plugin.getHBCICallback();
      if (callback != null && (callback instanceof HBCICallbackSWT))
        ((HBCICallbackSWT)callback).setCurrentHandle(new PassportHandleImpl());
      else
        Logger.warn("unable to register current handle, callback: " + callback);
     
      String type = getPassportType();
      HBCIUtils.setParam("client.passport.default",type); // ist eigentlich nicht noetig
      HBCIUtils.setParam("client.passport." + type + ".filename",filename);
      HBCIUtils.setParam("client.passport." + type + ".init","1");
      return AbstractHBCIPassport.getInstance(type);
    }
    catch (Exception e)
    {
      OperationCanceledException oce = (OperationCanceledException) HBCIProperties.getCause(e,OperationCanceledException.class);
      if (oce != null)
        throw oce;

      ApplicationException ae = (ApplicationException) HBCIProperties.getCause(e,ApplicationException.class);
      if (ae != null)
View Full Code Here

    },null,false,"list-remove.png");
    buttons.addButton(i18n.tr("Abbrechen"), new Action()
    {
      public void handleAction(Object context) throws ApplicationException
      {
        throw new OperationCanceledException();
      }
    },null,false,"process-stop.png");
   
    group.addButtonArea(buttons);
  }
View Full Code Here

    ButtonArea buttons = new ButtonArea();
    buttons.addButton(apply);
    buttons.addButton(i18n.tr("Abbrechen"), new Action() {
      public void handleAction(Object context) throws ApplicationException
      {
        throw new OperationCanceledException();
      }
    },null,false,"process-stop.png");
    buttons.paint(parent);
  }
View Full Code Here

TOP

Related Classes of de.willuhn.jameica.system.OperationCanceledException

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.