Package org.eclipse.jface.dialogs
Class TitleAreaDialog
java.lang.Object
org.eclipse.jface.window.Window
org.eclipse.jface.dialogs.Dialog
org.eclipse.jface.dialogs.TrayDialog
org.eclipse.jface.dialogs.TitleAreaDialog
- All Implemented Interfaces:
IShellProvider
- Direct Known Subclasses:
CompareWithOtherResourceDialog,SaveAsDialog,SourceLookupDialog,WizardDialog
A dialog that has a title area for displaying a title and an image as well as
a common area for displaying a description, a message, or an error message.
This dialog class may be subclassed.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
Window.IExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringImage registry key for banner image (value"dialog_title_banner_image").static final StringImage registry key for error message image.static final StringDeprecated.static final StringDeprecated.Fields inherited from class org.eclipse.jface.dialogs.Dialog
blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, dialogArea, DLG_IMG_ERROR, DLG_IMG_HELP, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSISFields inherited from class org.eclipse.jface.window.Window
CANCEL, OK, resizeHasOccurred -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ControlcreateContents(Composite parent) TheDialogimplementation of thisWindowmethod creates and lays out the top level composite for the dialog, and determines the appropriate horizontal and vertical dialog units based on the font size.protected ControlcreateDialogArea(Composite parent) Creates and returns the contents of the upper part of this dialog (above the button bar).Returns the current error message being shown in the dialog, ornullif there is no error message being shown.protected PointTheTitleAreaDialogimplementation of thisWindowmethods returns an initial size which is at least some reasonable minimum.Returns the current message text for this dialog.protected CompositeDeprecated.protected LabelReturns the title image label.voidsetErrorMessage(String newErrorMessage) Display the given error message.voidsetMessage(String newMessage) Set the message text.voidsetMessage(String newMessage, int newType) Sets the message for this dialog with an indication of what type of message it is.voidSets the title to be shown in the title area of this dialog.voidsetTitleAreaColor(RGB color) Sets the title bar color for this dialog.voidsetTitleImage(Image newTitleImage) Sets the title image to be shown in the title area of this dialog.Methods inherited from class org.eclipse.jface.dialogs.TrayDialog
closeTray, createButtonBar, createHelpControl, getLayout, getTray, handleShellCloseEvent, isDialogHelpAvailable, isHelpAvailable, openTray, setDialogHelpAvailable, setHelpAvailableMethods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, buttonPressed, cancelPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, createButtonsForButtonBar, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getOKButton, initializeBounds, initializeDialogUnits, isResizable, okPressed, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenTextMethods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, configureShell, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
-
Field Details
-
DLG_IMG_TITLE_ERROR
Image registry key for error message image.- See Also:
-
DLG_IMG_TITLE_BANNER
Image registry key for banner image (value"dialog_title_banner_image").- See Also:
-
INFO_MESSAGE
Deprecated.Message type constant used to display an info icon with the message.- Since:
- 2.0
- See Also:
-
WARNING_MESSAGE
Deprecated.Message type constant used to display a warning icon with the message.- Since:
- 2.0
- See Also:
-
-
Constructor Details
-
TitleAreaDialog
Instantiate a new title area dialog.- Parameters:
parentShell- the parent SWT shell
-
-
Method Details
-
createContents
Description copied from class:DialogTheDialogimplementation of thisWindowmethod creates and lays out the top level composite for the dialog, and determines the appropriate horizontal and vertical dialog units based on the font size. It then calls thecreateDialogAreaandcreateButtonBarmethods to create the dialog area and button bar, respectively. OverridingcreateDialogAreaandcreateButtonBarare recommended rather than overriding this method.- Overrides:
createContentsin classDialog- Parameters:
parent- the parent composite for the controls in this window. The type of layout used is determined by getLayout()- Returns:
- the control that will be returned by subsequent calls to getContents()
-
createDialogArea
Creates and returns the contents of the upper part of this dialog (above the button bar).The
Dialogimplementation of this framework method creates and returns a newCompositewith no margins and spacing. Subclasses should override.- Overrides:
createDialogAreain classDialog- Parameters:
parent- The parent composite to contain the dialog area- Returns:
- the dialog area control
-
getInitialSize
TheTitleAreaDialogimplementation of thisWindowmethods returns an initial size which is at least some reasonable minimum.- Overrides:
getInitialSizein classDialog- Returns:
- the initial size of the dialog
- See Also:
-
getTitleArea
Deprecated.Retained for backward compatibility. Returns the title area composite. There is no composite in this implementation so the shell is returned.- Returns:
- Composite
-
getTitleImageLabel
Returns the title image label.- Returns:
- the title image label
-
setErrorMessage
Display the given error message. The currently displayed message is saved and will be redisplayed when the error message is set tonull.- Parameters:
newErrorMessage- the newErrorMessage to display ornull
-
setMessage
Set the message text. If the message line currently displays an error, the message is saved and will be redisplayed when the error message is set tonull.Shortcut for
This method should be called after the dialog has been opened as it updates the message label immediately.setMessage(newMessage, IMessageProvider.NONE)- Parameters:
newMessage- the message, ornullto clear the message
-
setMessage
Sets the message for this dialog with an indication of what type of message it is.The valid message types are one of
NONE,INFORMATION,WARNING, orERROR.Note that for backward compatibility, a message of type
ERRORis different than an error message (set usingsetErrorMessage). An error message overrides the current message until the error message is cleared. This method replaces the current message and does not affect the error message.- Parameters:
newMessage- the message, ornullto clear the messagenewType- the message type- Since:
- 2.0
-
setTitle
Sets the title to be shown in the title area of this dialog.- Parameters:
newTitle- the title show
-
setTitleAreaColor
Sets the title bar color for this dialog.- Parameters:
color- the title bar color
-
setTitleImage
Sets the title image to be shown in the title area of this dialog.- Parameters:
newTitleImage- the title image to be shown
-
getMessage
Returns the current message text for this dialog. This message is displayed in the message line of the dialog when the error message isnull. If there is a non-null error message, this message is not shown, but is stored so that it can be shown in the message line wheneversetErrorMessage(String)is called with anullparameter.- Returns:
- the message text, which is never
null. - Since:
- 3.6
- See Also:
-
getErrorMessage
Returns the current error message being shown in the dialog, ornullif there is no error message being shown.- Returns:
- the error message, which may be
null. - Since:
- 3.6
- See Also:
-