2010/09/27

Password quality meter in GWT

A simple password quality meter is part of the gwt-aux project.
It has a very simple API and implementation, but it is very easy to use as well:

// Minimum password length is 6

final int passwordMinimumLength = 6;

// Create password field

final PasswordTextField passwordField = new PasswordTextField();
passwordField.addValidator(new MinLengthValidator(passwordMinimumLength));
addAndReplaceElement(passwordField, "passwordField");

// Create validation result panel

ValidationResultPanel passwordValidationResultPanel = new ValidationResultPanel(passwordField);
addAndReplaceElement(passwordValidationResultPanel, "passwordValidationResultPanel");

// Create password quality meter

final PasswordQualityMeter passwordQualityMeter = new PasswordQualityMeter(passwordMinimumLength);
addAndReplaceElement(passwordQualityMeter, "passwordQualityMeter");

// Validate field and update password quality meter on every key press

passwordField.addKeyUpHandler(new KeyUpHandler()
{
 @Override
 public void onKeyUp(KeyUpEvent event)
 {
  passwordQualityMeter.setPassword(passwordField.getFieldValue());
  passwordField.forceAndVisualizeValidation();
 }
});

Resources:

2010/09/22

Lazy scrolling panel in GWT

Google reader displays blog entries in a lazy scrolling panel, which means initially only a few entries are displayed, but if the user scrolls near the bottom, the next entries are loaded automatically. Implementing such a component in GWT is very simple.

Negative progress using Subversive :)

Recently I ran into I/O performance problems using Subclipse, so I decided to give a try to the "another" SVN plugin for Eclipse, Subversive. Although I miss some minor features (eg. tagging/branching in the repository is a little bit comfortable in Subclipse) and sometimes merging has unusual results, but I can say I'm satisfied with it.

One funny thing I noticed when sharing a project was a negative percent value in the progress bar:

Anyway, the sharing operation completed as expected, so who cares if it takes "more than 100%" :)