Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Sheet Support in SWT

DZone's Guide to

Sheet Support in SWT

· Java Zone ·
Free Resource

Verify, standardize, and correct the Big 4 + more– name, email, phone and global addresses – try our Data Quality APIs now at Melissa Developer Portal!

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

 

Developers! Quickly and easily gain access to the tools and information you need! Explore, test and combine our data quality APIs at Melissa Developer Portal – home to tools that save time and boost revenue. 

Topics:

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}