Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT.PASSWORD default echo char
SWT.PASSWORD default echo char [message #525917] Thu, 08 April 2010 09:38 Go to next message
Luca Ferrari is currently offline Luca FerrariFriend
Messages: 159
Registered: November 2009
Senior Member
Hi,
I'm using a text field for password prompt, and the field has the SWT.PASSWORD style. Since I'd like to provide the user with a "show password" checkbox I need the echo char used in the SWT.PASSWORD field to set/unset it as echo char. On my platform (Linux KDE) the echo char is a big black circle, not the usual '*'. So after I've done a
passwordText.setEchoChar('\0');

I'd like to re-set it again with such default big black circle. Is there a way to set such default password echo char?
Re: SWT.PASSWORD default echo char [message #525983 is a reply to message #525917] Thu, 08 April 2010 13:17 Go to previous messageGo to next message
Dmitry K is currently offline Dmitry KFriend
Messages: 17
Registered: July 2009
Junior Member
Have you looked at the setEchoChar source?

Under win it starts with smth like:
public void setEchoChar (char echo) {
	checkWidget ();
	if ((style & SWT.MULTI) != 0) return;
	if (echo != 0) {
		if ((echo = (char) Display.wcsToMbcs (echo, getCodePage ())) == 0) echo = '*';
	}


Maybe, under KDE char for this circle can be found in the same location?
Re: SWT.PASSWORD default echo char [message #525986 is a reply to message #525917] Thu, 08 April 2010 13:13 Go to previous messageGo to next message
Praveen  is currently offline Praveen Friend
Messages: 86
Registered: July 2009
Member
Luca Ferrari wrote:
> I'd like to re-set it again with such default big black circle. Is there
> a way to set such default password echo char?
Use this code - it will reset to (default) dark circle :)

char ch = 0x25cf;
text.setEchoChar(ch);

I hope it works on all platforms.
Re: SWT.PASSWORD default echo char [message #525994 is a reply to message #525986] Thu, 08 April 2010 13:47 Go to previous message
Luca Ferrari is currently offline Luca FerrariFriend
Messages: 159
Registered: November 2009
Senior Member
Thanks,
using such character works for me.
Previous Topic:CTabFolderRenderer can't be usefully subclassed
Next Topic:SWT Browser Widget, no mouse events while loading
Goto Forum:
  


Current Time: Wed Aug 21 04:41:22 GMT 2019

Powered by FUDForum. Page generated in 0.02005 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top