Showing posts with label gwt. Show all posts
Showing posts with label gwt. Show all posts

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.

2010/02/06

Efficient GWT development with Eclipse-Maven integration

In this article I present an efficient GWT development environment based on Eclipse and Maven, with tight integration between them.

Goals
  • Maven-friendly Eclipse project
  • easy development using Eclipse and WTP
  • ability to build the entire project using Maven (eg. for deployment or nightly builds)
It should be noted that there are many ways for efficient integration of the given technologies, I present here only one of them.
If you want to skip the 'boring' step-by-step explanation, simply check out the project from SVN :)

2010/01/28

GWT 2 "Debugging and Compiling" FAQ missing

The GWT compiler has several options that can be used to customize the build process. There are two trivial ways to get the option list:
  • by running the com.google.gwt.dev.Compiler class without arguments
  • reading the Debugging and Compiling part of the offiicial documentation
I naively thought that the second would be easier but surprisingly it isn't :)

2009/12/29

GWT 2.0 is finally here!

GWT 2.0 contains huge improvements compared to the previous 1.7 release. I think the most importants are the new development mode and the draft compilation.

2009/12/23

Adding many items to a GWT ListBox - a faster approach

Adding items to a ListBox using the ListBox.addItem() method may result in performance problems on some browsers, which has been reported as issue#49.

For example, adding 10000 items in a loop takes (on my computer):

BrowserTime
FireFox 3.5.6205 ms
Google Chrome 3.0.195.3858 ms
Internet Explorer 8.0.6001.1870233375 ms

The performance of IE8 is not acceptable, it's just too slow.
Fortunatelly there is a much faster method if you need to add many items when the ListBox is created (or it is possible to recreate the ListBox when it has to be repopulated).