Examples of PasswordPrompt


Examples of com.google.appengine.tools.admin.AppAdminFactory.PasswordPrompt

        final String password = SecurePreferencesFactory.getDefault()
            .get(Activator.PLUGIN_ID + "." + appId, null);
        if (userId != null && userId.length() != 0 && password != null) {
          ConnectOptions connectOptions = new ConnectOptions();
          connectOptions.setUserId(userId);
          connectOptions.setPasswordPrompt(new PasswordPrompt() {

            public String getPassword() {
              return password;
            }
          });
          return connectOptions;
        }
      } catch (final StorageException e) {
        Display.getDefault().syncExec(new Runnable() {

          public void run() {
            MessageDialog.openError(Display.getDefault()
                .getActiveShell(), "Error", e.getMessage());
          }
        });

      }
    }
    final Options options = new Options();
    options.usId = userId;
    if (storePass) {
      try {
        options.password = SecurePreferencesFactory.getDefault().get(
            Activator.PLUGIN_ID + "." + appId, null);
      } catch (final StorageException e) {
        Display.getDefault().syncExec(new Runnable() {

          public void run() {
            MessageDialog.openError(Display.getDefault()
                .getActiveShell(), "Error", e.getMessage());
          }
        });
      }
    }

    options.alwaysUse = alwaysUse;
    Display.getDefault().syncExec(new Runnable() {

      public void run() {
        CompositeEditor compositeEditor = new CompositeEditor(options,
            true);

        Binding binding = (Binding) compositeEditor.getBinding();
        binding.setName("Credentials");
        binding
            .setDescription("Authentification to Google Account for application: "
                + appId);
        compositeEditor.add(new OneLineTextElement<String>(binding
            .getBinding("usId")));
        OneLineTextElement<String> element = new OneLineTextElement<String>(
            binding.getBinding("password"));
        element.setIsPassword(true);
        Binding binding2 = binding.getBinding("alwaysUse");
        binding2
            .setName("Remember password(Could trigger secure storage login)");
        ButtonSelector sl = new ButtonSelector(binding2);
        compositeEditor.add(element);
        compositeEditor.add(sl);

        TitledDialog t = new TitledDialog(compositeEditor);
        DisposeBindingListener.linkBindingLifeCycle(binding,
            compositeEditor);
        int open = t.open();
        options.ok = open == Dialog.OK;
      }
    });
    if (options.ok) {
      ConnectOptions cm = new ConnectOptions();
      cm.setUserId(options.usId);
      cm.setPasswordPrompt(new PasswordPrompt() {

        public String getPassword() {
          return options.password;
        }
      });
View Full Code Here

Examples of org.apache.geronimo.deployment.cli.ServerConnection.PasswordPrompt

        out.print("Username: ");
        out.flush();
        user = in.readLine();
      }
      if (password == null) {
        password = new PasswordPrompt("Password: ", out)
            .getPassword(in);
      }
    } catch (IOException e) {
      System.out.println("Unable to prompt for login.");
      System.exit(1);
View Full Code Here

Examples of org.apache.geronimo.deployment.cli.ServerConnection.PasswordPrompt

        out.print("Username: ");
        out.flush();
        user = in.readLine();
      }
      if (password == null) {
        password = new PasswordPrompt("Password: ", out)
            .getPassword(in);
      }
    } catch (IOException e) {
      System.out.println("Unable to prompt for login.");
      System.exit(1);
View Full Code Here

Examples of org.apache.geronimo.deployment.cli.ServerConnection.PasswordPrompt

        out.print("Username: ");
        out.flush();
        user = in.readLine();
      }
      if (password == null) {
        password = new PasswordPrompt("Password: ", out)
            .getPassword(in);
      }
    } catch (IOException e) {
      System.out.println("Unable to prompt for login.");
      System.exit(1);
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.