Skip to main content
Jump to: navigation, search

Nebula PasswordRevealer

< Back to Nebula Main Page

Introduction

This widget is an extension of a password text field. It behaves like a password widget, but it allows the user to reveal the password. When one clicks on the "eye" button besides the field:

Passwordrevealer1.png

The password is revealed until the user stops clicking:

Passwordrevealer2.png

Usage

You use this widget like a Text widget but you do not have to set the SWT.PASSWORD style :

 final PasswordRevealer revealer = new PasswordRevealer(shell, SWT.NONE);
 revealer.setBackground(white);

All methods of the Text widget can be used :

 String password = revealer.getText();
 revealer.addListener(SWT.Modify, e-> System.out.println("Modified"));
 revealer.setForeground(foregroundColor);
 ...

Examples

An example called PasswordRevealerSnippet.java is located in the plugin org.eclipse.nebula.widgets.passwordrevealer.snippets.

This example is also available here : PasswordRevealerSnippet.java

Back to the top