Package org.gudy.azureus2.ui.console

Examples of org.gudy.azureus2.ui.console.UserProfile


    BufferedReader br = new BufferedReader(new InputStreamReader(in));
    ps.print("Username: ");
    String username = br.readLine();
    ps.print("Password: ");
    String password = br.readLine();
    UserProfile userProfile = userManager.authenticate(username, password);
    if( userProfile != null )
    {
      ps.println("Login successful");
      return userProfile;
    }
View Full Code Here


      {       
        ci.out.println("> AddUser error: user '" + userName + "' already exists");
        return;
      }
     
      UserProfile profile = new UserProfile(userName, userType);
      profile.setPassword(password);
      String defaultSaveDirectory = commandLine.getOptionValue('d', null);
      profile.setDefaultSaveDirectory(defaultSaveDirectory);
     
      getUserManager().addUser(profile);
      ci.out.println("> AddUser: user '" + userName + "' added");
      saveUserManagerConfig(ci.out);
    }
View Full Code Here

      {
        ci.out.println("> ModifyUser: (u)sername option not specified");
        return;
      }
     
      UserProfile profile = getUserManager().getUser(userName);
      if( profile == null )
      {       
        ci.out.println("> ModifyUser: error - user '" + userName + "' not found");
        return;
      }

      boolean modified = false;
     
      String userType = commandLine.getOptionValue('t');
      if( userType != null )
      {
        if( UserProfile.isValidUserType(userType.toLowerCase()))
        {
          profile.setUserType(userType.toLowerCase());
          modified = true;
        }
        else
        {
          ci.out.println("> ModifyUser: invalid profile type '" + userType + "'. Valid values are: " + UserProfile.ADMIN + "," + UserProfile.USER + "," + UserProfile.GUEST);
          return;
        }
      }     
     
      String password = commandLine.getOptionValue('p');
      if( password != null )
      {
        profile.setPassword(password);
        modified = true;
      }
      String defaultSaveDirectory = commandLine.getOptionValue('d');
     
      if( defaultSaveDirectory != null ){
       
        modified = true;

        if defaultSaveDirectory.length() > 0 ){
       
          profile.setDefaultSaveDirectory(defaultSaveDirectory);
        }else{
     
          profile.setDefaultSaveDirectory(null);
        }
      }
     
      if( modified )
      {
View Full Code Here

    public void execute(String commandName, ConsoleInput ci, List args)
    {
      ci.out.println("> -----");
      ci.out.println("> Username\tProfile\t\tSave Directory");
      for (Iterator iter = getUserManager().getUsers().iterator(); iter.hasNext();) {
        UserProfile profile = (UserProfile) iter.next();
        String saveDir = profile.getDefaultSaveDirectory();
        if( saveDir == null ) saveDir = "(default)";
        ci.out.println("> " + profile.getUsername() + "\t\t" + profile.getUserType() + "\t\t" + saveDir);
      }
      ci.out.println("> -----");
    }
View Full Code Here

   */
  protected void setUp() throws Exception {
    super.setUp();
   
    manager = new InMemoryUserManager(null);
    profile1 = new UserProfile();
    profile1.setUsername("myuser1");
    profile1.setPassword("mypassword");
    manager.addUser(profile1);
    profile2 = new UserProfile();
    profile2.setUsername("myuser2");
    profile2.setPassword("zigzag");
    profile2.setUserType(UserProfile.USER);
    manager.addUser(profile2);   
  }
View Full Code Here

    manager.save(out);
    System.out.println("Saved to: " + new String(out.toByteArray()));
    ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
    InMemoryUserManager newManager = new InMemoryUserManager(null);
    newManager.load(in);
    UserProfile profile3 = new UserProfile();
    profile3.setUserType(UserProfile.GUEST);
    profile3.setUsername("user3");
    profile3.setPassword("whatever");
    assertTrue( manager.getUsers().contains(profile1 ) );
    assertTrue( manager.getUsers().contains(profile2 ) );
    assertFalse( manager.getUsers().contains(profile3 ) );
    assertTrue( newManager.getUsers().contains(profile1 ) );
    assertTrue( newManager.getUsers().contains(profile2 ) );
View Full Code Here

    warningIcon = imageLoader.getImage("image.sidebar.vitality.alert");
    infoIcon   = imageLoader.getImage("image.sidebar.vitality.info");
    updateStatusWarnings();
    Messages.setLanguageText(statusWarnings,
        "MainWindow.status.warning.tooltip");
    Alerts.addMessageHistoryListener(new AlertHistoryListener() {
      public void alertHistoryAdded(LogAlert params) {
        updateStatusWarnings();
      }
      public void alertHistoryRemoved(LogAlert alert) {
        updateStatusWarnings();
View Full Code Here

    itemDownSpeedManual.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        String kbps_str = MessageText.getString("MyTorrentsView.dialog.setNumber.inKbps",
            new String[]{ DisplayFormatters.getRateUnit(DisplayFormatters.UNIT_KB ) });

        SimpleTextEntryWindow entryWindow = new SimpleTextEntryWindow();
        entryWindow.initTexts("MyTorrentsView.dialog.setSpeed.title",
            new String[] {
              MessageText.getString(up_menu
                  ? "MyTorrentsView.dialog.setNumber.upload"
                  : "MyTorrentsView.dialog.setNumber.download")
            }, "MyTorrentsView.dialog.setNumber.text", new String[] {
              kbps_str,
              MessageText.getString(up_menu
                  ? "MyTorrentsView.dialog.setNumber.upload"
                  : "MyTorrentsView.dialog.setNumber.download")
            });

        entryWindow.prompt(new UIInputReceiverListener() {
          public void UIInputReceiverClosed(UIInputReceiver entryWindow) {
            if (!entryWindow.hasSubmittedInput()) {
              return;
            }
            String sReturn = entryWindow.getSubmittedInput();

            if (sReturn == null)
              return;

            int newSpeed;
View Full Code Here

          new Listener()
        {
              public void
          handleEvent(Event event)
              {
                new CertificateCreatorWindow();
              }
          });
     
      new Label(gSecurity, SWT.NULL );
     
View Full Code Here

  public static MenuItem addBetaMenuItem(Menu menuParent) {
    final MenuItem menuItem = addMenuItem(menuParent, MENU_ID_BETA_PROG,
        new Listener() {
          public void handleEvent(Event e) {
            new BetaWizard();
      }
    });

    COConfigurationManager.addAndFireParameterListener(
        "Beta Programme Enabled", new ParameterListener() {
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.ui.console.UserProfile

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.