public class TitleAreaDialog extends TrayDialog
This dialog class may be subclassed.
Window.IExceptionHandler
Modifier and Type | Field and Description |
---|---|
static String |
DLG_IMG_TITLE_BANNER
Image registry key for banner image (value
"dialog_title_banner_image" ). |
static String |
DLG_IMG_TITLE_ERROR
Image registry key for error message image.
|
static String |
INFO_MESSAGE
Deprecated.
|
static String |
WARNING_MESSAGE
Deprecated.
|
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, ELLIPSIS
CANCEL, OK, resizeHasOccurred
Constructor and Description |
---|
TitleAreaDialog(Shell parentShell)
Instantiate a new title area dialog.
|
Modifier and Type | Method and Description |
---|---|
protected Control |
createContents(Composite parent)
The
Dialog implementation of this Window
method 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 Control |
createDialogArea(Composite parent)
Creates and returns the contents of the upper part of this dialog (above
the button bar).
|
String |
getErrorMessage()
Returns the current error message being shown in the dialog, or
null if there is no error message being shown. |
protected Point |
getInitialSize()
The
TitleAreaDialog implementation of this
Window methods returns an initial size which is at least
some reasonable minimum. |
String |
getMessage()
Returns the current message text for this dialog.
|
protected Composite |
getTitleArea()
Deprecated.
|
protected Label |
getTitleImageLabel()
Returns the title image label.
|
void |
setErrorMessage(String newErrorMessage)
Display the given error message.
|
void |
setMessage(String newMessage)
Set the message text.
|
void |
setMessage(String newMessage,
int newType)
Sets the message for this dialog with an indication of what type of
message it is.
|
void |
setTitle(String newTitle)
Sets the title to be shown in the title area of this dialog.
|
void |
setTitleAreaColor(RGB color)
Sets the title bar color for this dialog.
|
void |
setTitleImage(Image newTitleImage)
Sets the title image to be shown in the title area of this dialog.
|
closeTray, createButtonBar, createHelpControl, getLayout, getTray, handleShellCloseEvent, isDialogHelpAvailable, isHelpAvailable, openTray, setDialogHelpAvailable, setHelpAvailable
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, shortenText
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
public static final String DLG_IMG_TITLE_ERROR
public static final String DLG_IMG_TITLE_BANNER
"dialog_title_banner_image"
).@Deprecated public static final String INFO_MESSAGE
@Deprecated public static final String WARNING_MESSAGE
public TitleAreaDialog(Shell parentShell)
parentShell
- the parent SWT shellprotected Control createContents(Composite parent)
Dialog
Dialog
implementation of this Window
method 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 the createDialogArea
and
createButtonBar
methods to create the dialog area and
button bar, respectively. Overriding createDialogArea
and
createButtonBar
are recommended rather than overriding
this method.createContents
in class Dialog
parent
- the parent composite for the controls in this window. The type
of layout used is determined by getLayout()protected Control createDialogArea(Composite parent)
The Dialog
implementation of this framework method creates
and returns a new Composite
with no margins and spacing.
Subclasses should override.
createDialogArea
in class Dialog
parent
- The parent composite to contain the dialog areaprotected Point getInitialSize()
TitleAreaDialog
implementation of this
Window
methods returns an initial size which is at least
some reasonable minimum.getInitialSize
in class Dialog
Dialog.getDialogBoundsSettings()
,
Dialog.getDialogBoundsStrategy()
@Deprecated protected Composite getTitleArea()
protected Label getTitleImageLabel()
public void setErrorMessage(String newErrorMessage)
null
.newErrorMessage
- the newErrorMessage to display or null
public void setMessage(String newMessage)
null
.
Shortcut for setMessage(newMessage, IMessageProvider.NONE)
newMessage
- the message, or null
to clear the messagepublic void setMessage(String newMessage, int newType)
The valid message types are one of NONE
,
INFORMATION
,WARNING
, or
ERROR
.
Note that for backward compatibility, a message of type
ERROR
is different than an error message (set using
setErrorMessage
). 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.
newMessage
- the message, or null
to clear the messagenewType
- the message typepublic void setTitle(String newTitle)
newTitle
- the title showpublic void setTitleAreaColor(RGB color)
color
- the title bar colorpublic void setTitleImage(Image newTitleImage)
newTitleImage
- the title image to be shownpublic String getMessage()
null
. 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 whenever setErrorMessage(String)
is called with
a null
parameter.null
.setMessage(String)
,
setErrorMessage(String)
public String getErrorMessage()
null
if there is no error message being shown.null
.setErrorMessage(String)
,
setMessage(String)
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.