Examples of JXLoginDialog


Examples of org.jdesktop.swingx.JXLoginDialog

    if (!isLock()) {
      return true;
    }

    // ask for data
    JXLoginDialog login = new JXLoginDialog(new LoginService() {
      @Override
      public boolean authenticate(String name, char[] password, String server) {

        String type = getCryptotyp();

        cache.put("projectpw", name + " - " + String.valueOf(password));
        cache.put("projecttype", type);

        File zip = new File(path, type + ".zip"), crypt = new File(path, type + ".crypt");

        // decrypt it
        try {
          FileHelper.decryptFile(crypt, zip, (String) cache.get("projectpw"), type);

          // extract archive
          FileHelper.extractArchiveThrow(zip, path);

          // delete it
          FileHelper.deleteFile(crypt);
          FileHelper.deleteFile(zip);

        } catch (Throwable t) {
          Log.ger.info("Can not extract project", t);
          return false;
        }

        return true;
      }
    }, null, null);
    login.setModalityType(ModalityType.APPLICATION_MODAL);
    login.setVisible(true);

    // don't want it?
    if (JXLoginPane.Status.NOT_STARTED.equals(login.getStatus()) || JXLoginPane.Status.CANCELLED.equals(login.getStatus())) {
      return false;
    }

    return true;
  }
View Full Code Here

Examples of org.jdesktop.swingx.JXLoginDialog

    }

    @Override
     public void onPreStartup()
    {
        jxLoginDialog = new JXLoginDialog(new LoginService()
        {
            @Override
            public boolean authenticate(String name, char[] password, String server) throws Exception
            {
                Thread.sleep(2000);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.