Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Displaying Special Characters in JFace Error Dialog
Displaying Special Characters in JFace Error Dialog [message #551994] Tue, 10 August 2010 13:07 Go to next message
Aravindhan Annamalai is currently offline Aravindhan AnnamalaiFriend
Messages: 89
Registered: July 2009
Location: Chennai
Member
Hi,

I am not able to display the "&" in the error dialog.

MessageDialog.openError(this.getShell(), "TITLE", "&");

When I try to execute,

MessageDialog.openError(this.getShell(), "TITLE", "&&&&");

It is displaying two characters in the dialog.

Is there any valid reason?

Regards, Aravind
Re: Displaying Special Characters in JFace Error Dialog [message #552139 is a reply to message #551994] Wed, 11 August 2010 04:36 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
On 10/08/10 6:37 PM, Aravindhan.A wrote:
> Hi,
>
> I am not able to display the "&" in the error dialog.
>
> MessageDialog.openError(this.getShell(), "TITLE", "&");
>
> When I try to execute,
>
> MessageDialog.openError(this.getShell(), "TITLE", "&&&&");
>
> It is displaying two characters in the dialog.
>
> Is there any valid reason?

The message is displayed using a Label, which accepts mnemonic chars.
See Javadoc of Label.setText() for more details.

--
- Prakash
Platform UI Team, IBM

www.eclipse-tips.com
Re: Displaying Special Characters in JFace Error Dialog [message #552142 is a reply to message #551994] Wed, 11 August 2010 04:36 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
On 10/08/10 6:37 PM, Aravindhan.A wrote:
> Hi,
>
> I am not able to display the "&" in the error dialog.
>
> MessageDialog.openError(this.getShell(), "TITLE", "&");
>
> When I try to execute,
>
> MessageDialog.openError(this.getShell(), "TITLE", "&&&&");
>
> It is displaying two characters in the dialog.
>
> Is there any valid reason?

The message is displayed using a Label, which accepts mnemonic chars.
See Javadoc of Label.setText() for more details.

--
- Prakash
Platform UI Team, IBM

www.eclipse-tips.com
Re: Displaying Special Characters in JFace Error Dialog [message #552146 is a reply to message #552142] Wed, 11 August 2010 05:28 Go to previous messageGo to next message
Aravindhan Annamalai is currently offline Aravindhan AnnamalaiFriend
Messages: 89
Registered: July 2009
Location: Chennai
Member
Hi Prakash,

I forgot tht, the & character is used for mnemonics (shortcuts) when we use it in labels, and internally MessageDialog class uses.. Label.setText() to display it.

Instead they should have used a Text or TextArea to display it ... Smile

Thanks Prakash

Regards, Aravind
Re: Displaying Special Characters in JFace Error Dialog [message #931616 is a reply to message #552146] Wed, 03 October 2012 11:04 Go to previous message
Jitendra Pandey is currently offline Jitendra PandeyFriend
Messages: 1
Registered: October 2012
Junior Member
Hi Prakash, Arvind,

Special character "&" can be displayed in label using unicode value of "&" as

Label.setText("\u0026\u0026");

Don't use Label.setText("\u0026") as it will accept it as mnemonic character.

Thanks & Regards,
Jitendra Pandey
Previous Topic:[DataBinding] Delay model updates until dialog confirmation
Next Topic:Re: DataBindig - performance problems when binding large lists
Goto Forum:
  


Current Time: Tue Mar 19 07:44:30 GMT 2024

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

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

Back to the top