Over a million developers have joined DZone.

Sheet Support in SWT

· Java Zone

Navigate the Maze of the End-User Experience and pick up this APM Essential guide, brought to you in partnership with CA Technologies

For those who have downloaded 3.5 M7 would have seen Sheets support has been added to SWT and Platform UI has used the API wherever applicable. For those who are wondering what a Sheet means, its an eye-candy in Mac. Here is a sample of a MessageDialog shown with and without Sheet style. (in case you didn't notice the obvious, I'm back on a Mac :-P)


So what is a Sheet?

A Sheet is essentially a Dialog, which is tied to a parent window. It acts as a Modal Dialog, so the user cannot perform any operations on a window until the Dialog is dismissed. (He is free to work on other windows) The dialog is

  • always attached with the window until dismissed
  • placed in the center of the window
  • moves along when the window is moved
To Sheet or not to Sheet?

  • Use Sheets when the interaction is very short like the question "Is Eclipse a cool product?  ". Opening a 15 step Wizard to choose your life partner is not right place to use Sheet.
  • Do not use Sheets where the user might still need to interact with the Window (like copy something from window and paste it in the Sheet). Since Sheets are Window Modal, it doesn't allow the user to interact with the associated Window
  • Sheets are not Application Modal. So if you want a dialog to be Application Modal, don' use Sheets
  • Unlike normal Dialogs, Sheets do not have title. Avoid Sheets where title provides valuable information.
  • Do not use nested Sheets (says Apple's UI guidelines)
 

How do I use Sheet?

Simple. Set the SWT.Sheet style to the Shell of the dialog. In case you are using the MessageDialog, pass on the style bit as the last argument to the MessageDialog.open() method

From http://blog.eclipse-tips.com

 

Thrive in the application economy with an APM model that is strategic. Be E.P.I.C. with CA APM.  Brought to you in partnership with CA Technologies.

Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}