Dependencies and Classes for Dialogs
Whether you are customizing a dialog or creating the sample dialog that the procedure in this book builds, both Eclipse and Sabre Red 360 have defined some dependencies and classes that are required to create a dialog in a plug-in.
Minimum Required Dependencies
com.sabre.edge.platform.core.ui. This is a Sabre Red 360 dependency. It provides the classes that are required to implement a dialog.
This is a Sabre Red 360 class.
Extend MySabreTrayDialog because this class has the basic methods that display a dialog. Your class will contain the content and buttons for your dialog.
With the exception of the code that invokes the dialog that goes into the handler methods, you must include all code inside the class that extends MySabreTrayDialog .
In order to add a custom title, overwrite this method and call your own method.
Overwrite this method to provide content for the dialog. If you do not override createDialogArea() , you cannot provide content for your dialog.
If you call super.createDialogArea() , this method creates a pre-defined layout to which you can add your content. If you do not want this behavior, do not call this method.
If you do not call super.createDialogArea() , you must create your own layout for the dialog, which includes properties such as margins and fonts.
Overwrite this method in order to create custom buttons.
The super.createButtonsForButtonBar() method creates the default OK and Cancel buttons.
okPressed() and cancelPressed()
In order to handle the selection of the OK and Cancel buttons, overwrite these methods. You should also call the super.okPressed() and super.cancelPressed() methods to get default behavior, such as closing a dialog and setting the correct status code.