Class DialogPage
- All Implemented Interfaces:
IDialogPage
,IMessageProvider
- Direct Known Subclasses:
InstallationPage
,PreferencePage
,WizardPage
-
Field Summary
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
-
Constructor Summary
ModifierConstructorDescriptionprotected
Creates a new empty dialog page.protected
DialogPage
(String title) Creates a new dialog page with the given title.protected
DialogPage
(String title, ImageDescriptor image) Creates a new dialog page with the given title and image. -
Method Summary
Modifier and TypeMethodDescriptionprotected int
convertHeightInCharsToPixels
(int chars) Returns the number of pixels corresponding to the height of the given number of characters.protected int
convertHorizontalDLUsToPixels
(int dlus) Returns the number of pixels corresponding to the given number of horizontal dialog units.protected int
convertVerticalDLUsToPixels
(int dlus) Returns the number of pixels corresponding to the given number of vertical dialog units.protected int
convertWidthInCharsToPixels
(int chars) Returns the number of pixels corresponding to the width of the given number of characters.void
dispose()
TheDialogPage
implementation of thisIDialogPage
method disposes of the page image if it has one.Returns the top level control for this dialog page.Returns this dialog page's description text.protected String
Returns the symbolic font name used by dialog pages.Returns the current error message for this dialog page.protected Font
getFont()
Returns the default font to use for this dialog page.getImage()
Returns this dialog page's image.Returns the current message for this wizard page.int
Returns a value indicating if the message is a an information message, a warning message, or an error message.getShell()
Returns this dialog page's shell.getTitle()
Returns this dialog page's title.protected final String
getToolTipText
(int widgetId) Deprecated.protected void
initializeDialogUnits
(Control testControl) Initializes the computation of horizontal and vertical dialog units based on the size of current font.protected boolean
Tests whether this page's UI content has already been created.void
This default implementation of anIDialogPage
method does nothing.protected GridData
setButtonLayoutData
(Button button) Sets theGridData
on the specified button to be one that is spaced for the current dialog page units.protected void
setControl
(Control newControl) Set the control for the receiver.void
setDescription
(String description) Sets this dialog page's description text.void
setErrorMessage
(String newMessage) Sets or clears the error message for this page.void
Sets this dialog page's image.void
setMessage
(String newMessage) Sets or clears the message for this page.void
setMessage
(String newMessage, int newType) Sets the message for this page with an indication of what type of message it is.void
TheDialogPage
implementation of thisIDialogPage
method remembers the title in an internal state variable.void
setVisible
(boolean visible) TheDialogPage
implementation of thisIDialogPage
method sets the control to the given visibility state.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage
createControl
-
Constructor Details
-
DialogPage
protected DialogPage()Creates a new empty dialog page. -
DialogPage
Creates a new dialog page with the given title.- Parameters:
title
- the title of this dialog page, ornull
if none
-
DialogPage
Creates a new dialog page with the given title and image.- Parameters:
title
- the title of this dialog page, ornull
if noneimage
- the image for this dialog page, ornull
if none
-
-
Method Details
-
convertHeightInCharsToPixels
protected int convertHeightInCharsToPixels(int chars) Returns the number of pixels corresponding to the height of the given number of characters.This method may only be called after
initializeDialogUnits
has been called.Clients may call this framework method, but should not override it.
- Parameters:
chars
- the number of characters- Returns:
- the number of pixels
-
convertHorizontalDLUsToPixels
protected int convertHorizontalDLUsToPixels(int dlus) Returns the number of pixels corresponding to the given number of horizontal dialog units.This method may only be called after
initializeDialogUnits
has been called.Clients may call this framework method, but should not override it.
- Parameters:
dlus
- the number of horizontal dialog units- Returns:
- the number of pixels
-
convertVerticalDLUsToPixels
protected int convertVerticalDLUsToPixels(int dlus) Returns the number of pixels corresponding to the given number of vertical dialog units.This method may only be called after
initializeDialogUnits
has been called.Clients may call this framework method, but should not override it.
- Parameters:
dlus
- the number of vertical dialog units- Returns:
- the number of pixels
-
convertWidthInCharsToPixels
protected int convertWidthInCharsToPixels(int chars) Returns the number of pixels corresponding to the width of the given number of characters.This method may only be called after
initializeDialogUnits
has been called.Clients may call this framework method, but should not override it.
- Parameters:
chars
- the number of characters- Returns:
- the number of pixels
-
dispose
public void dispose()TheDialogPage
implementation of thisIDialogPage
method disposes of the page image if it has one. Subclasses may extend.- Specified by:
dispose
in interfaceIDialogPage
-
getControl
Returns the top level control for this dialog page.- Specified by:
getControl
in interfaceIDialogPage
- Returns:
- the top level control
-
getDescription
Description copied from interface:IDialogPage
Returns this dialog page's description text.- Specified by:
getDescription
in interfaceIDialogPage
- Returns:
- the description text for this dialog page,
or
null
if none
-
getDialogFontName
Returns the symbolic font name used by dialog pages.- Returns:
- the symbolic font name
-
getErrorMessage
Description copied from interface:IDialogPage
Returns the current error message for this dialog page. May benull
to indicate no error message.An error message should describe some error state, as opposed to a message which may simply provide instruction or information to the user.
- Specified by:
getErrorMessage
in interfaceIDialogPage
- Returns:
- the error message, or
null
if none
-
getFont
Returns the default font to use for this dialog page.- Returns:
- the font
-
getImage
Description copied from interface:IDialogPage
Returns this dialog page's image.- Specified by:
getImage
in interfaceIDialogPage
- Returns:
- the image for this dialog page, or
null
if none
-
getMessage
Description copied from interface:IDialogPage
Returns the current message for this wizard page.A message provides instruction or information to the user, as opposed to an error message which should describe some error state.
- Specified by:
getMessage
in interfaceIDialogPage
- Specified by:
getMessage
in interfaceIMessageProvider
- Returns:
- the message, or
null
if none
-
getMessageType
public int getMessageType()Description copied from interface:IMessageProvider
Returns a value indicating if the message is a an information message, a warning message, or an error message.Returns one of
NONE
,INFORMATION
,WARNING
, orERROR
.- Specified by:
getMessageType
in interfaceIMessageProvider
- Returns:
- the message type
-
getShell
Returns this dialog page's shell. Convenience method forgetControl().getShell()
. This method may only be called after the page's control has been created.- Returns:
- the shell
-
getTitle
Description copied from interface:IDialogPage
Returns this dialog page's title.- Specified by:
getTitle
in interfaceIDialogPage
- Returns:
- the title of this dialog page,
or
null
if none
-
getToolTipText
Deprecated.Returns the tool tip text for the widget with the given id.The default implementation of this framework method does nothing and returns
null
. Subclasses may override.- Parameters:
widgetId
- the id of the widget for which hover help is requested- Returns:
- the tool tip text, or
null
if none
-
initializeDialogUnits
Initializes the computation of horizontal and vertical dialog units based on the size of current font.This method must be called before any of the dialog unit based conversion methods are called.
- Parameters:
testControl
- a control from which to obtain the current font
-
setButtonLayoutData
Sets theGridData
on the specified button to be one that is spaced for the current dialog page units. The methodinitializeDialogUnits
must be called once before calling this method for the first time.- Parameters:
button
- the button to set theGridData
- Returns:
- the
GridData
set on the specified button
-
isControlCreated
protected boolean isControlCreated()Tests whether this page's UI content has already been created.- Returns:
true
if the control has been created, andfalse
if not
-
performHelp
public void performHelp()This default implementation of anIDialogPage
method does nothing. Subclasses should override to take some action in response to a help request.- Specified by:
performHelp
in interfaceIDialogPage
-
setControl
Set the control for the receiver.- Parameters:
newControl
- control to set
-
setDescription
Description copied from interface:IDialogPage
Sets this dialog page's description text.- Specified by:
setDescription
in interfaceIDialogPage
- Parameters:
description
- the description text for this dialog page, ornull
if none
-
setErrorMessage
Sets or clears the error message for this page.- Parameters:
newMessage
- the message, ornull
to clear the error message
-
setImageDescriptor
Description copied from interface:IDialogPage
Sets this dialog page's image.- Specified by:
setImageDescriptor
in interfaceIDialogPage
- Parameters:
desc
- the image for this dialog page, ornull
if none
-
setMessage
Sets or clears the message for this page.This is a shortcut for
setMessage(newMesasge, NONE)
- Parameters:
newMessage
- the message, ornull
to clear the message
-
setMessage
Sets the message for this page 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
ERROR
is 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, ornull
to clear the messagenewType
- the message type- Since:
- 2.0
-
setTitle
TheDialogPage
implementation of thisIDialogPage
method remembers the title in an internal state variable. Subclasses may extend.- Specified by:
setTitle
in interfaceIDialogPage
- Parameters:
title
- the title of this dialog page, ornull
if none
-
setVisible
public void setVisible(boolean visible) TheDialogPage
implementation of thisIDialogPage
method sets the control to the given visibility state. Subclasses may extend.- Specified by:
setVisible
in interfaceIDialogPage
- Parameters:
visible
-true
to make this page visible, andfalse
to hide it
-