Class FontDialog
- java.lang.Object
-
- org.eclipse.jface.window.Window
-
- org.eclipse.jface.dialogs.Dialog
-
- org.eclipse.jface.dialogs.TrayDialog
-
- org.eclipse.jface.dialogs.TitleAreaDialog
-
- com._1c.g5.v8.dt.md.ui.dialogs.font.FontDialog
-
- All Implemented Interfaces:
IChooseValueDialog<Font>
,org.eclipse.jface.window.IShellProvider
public final class FontDialog extends org.eclipse.jface.dialogs.TitleAreaDialog implements IChooseValueDialog<Font>
Defines font selection dialog. It provides user with a list of predefined font styles. Each style defines:
- Font family
- Font size
- Font typography: bold, italic, underlined, striken through
The class uses EMF Font as input/output media. It accepts an instance implementing the interface in constructor and returns such an instance ingetValue()
method.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FontDialog.FontStyleLabelProvider
The class displays a FontStyle object in a ListViewer.
-
Field Summary
-
Fields inherited from class org.eclipse.jface.dialogs.TitleAreaDialog
DLG_IMG_TITLE_BANNER, DLG_IMG_TITLE_ERROR, INFO_MESSAGE, WARNING_MESSAGE
-
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, ELLIPSIS
-
-
Constructor Summary
Constructors Constructor Description FontDialog(org.eclipse.swt.widgets.Shell parentShell, Font font, Map<String,Font> styleFonts, Map<String,Font> systemFonts, Map<String,Font> styleItemFonts, boolean editable)
Creates a newFontDialog
class to choose font specification with.FontDialog(org.eclipse.swt.widgets.Shell parentShell, Font font, Map<String,Font> styleFonts, Map<String,Font> systemFonts, Map<String,Font> styleItemFonts, boolean avoidStrikenThrough, boolean editable)
Creates a newFontDialog
class to choose font specification with.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
close()
void
create()
protected org.eclipse.swt.widgets.Control
createContents(org.eclipse.swt.widgets.Composite parent)
protected org.eclipse.swt.widgets.Control
createDialogArea(org.eclipse.swt.widgets.Composite parent)
protected org.eclipse.swt.graphics.Point
getInitialSize()
Font
getValue()
Returns aFont
object that defines a font that user chose in this dialog.protected void
okPressed()
void
setErrorMessage(String newErrorMessage)
void
setMessage(String newMessage, int newType)
-
Methods inherited from class org.eclipse.jface.dialogs.TitleAreaDialog
getErrorMessage, getMessage, getTitleArea, getTitleImageLabel, setMessage, setTitle, setTitleAreaColor, setTitleImage
-
Methods inherited from class org.eclipse.jface.dialogs.TrayDialog
closeTray, createButtonBar, createHelpControl, getLayout, getTray, handleShellCloseEvent, isDialogHelpAvailable, isHelpAvailable, openTray, setDialogHelpAvailable, setHelpAvailable
-
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, buttonPressed, cancelPressed, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, createButton, createButtonsForButtonBar, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getOKButton, initializeBounds, initializeDialogUnits, isResizable, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText
-
Methods 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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com._1c.g5.v8.dt.ui.dialog.IChooseValueDialog
open
-
-
-
-
Constructor Detail
-
FontDialog
public FontDialog(org.eclipse.swt.widgets.Shell parentShell, Font font, Map<String,Font> styleFonts, Map<String,Font> systemFonts, Map<String,Font> styleItemFonts, boolean editable)
Creates a newFontDialog
class to choose font specification with.- Parameters:
parentShell
- the parent windowfont
- an object to instantiate value of each control on the dialogstyleFonts
- the all style fonts of current project, cannot benull
systemFonts
- the all system fonts of current project, cannot benull
styleItemFonts
- the all style item fonts of current project, cannot benull
editable
- the editable state,true
if this dialog is editable,false
otherwise
-
FontDialog
public FontDialog(org.eclipse.swt.widgets.Shell parentShell, Font font, Map<String,Font> styleFonts, Map<String,Font> systemFonts, Map<String,Font> styleItemFonts, boolean avoidStrikenThrough, boolean editable)
Creates a newFontDialog
class to choose font specification with.- Parameters:
parentShell
- the parent windowfont
- an object to instantiate value of each control on the dialogstyleFonts
- the all style fonts of current project, cannot benull
systemFonts
- the all system fonts of current project, cannot benull
styleItemFonts
- the all style item fonts of current project, cannot benull
avoidStrikenThrough
- if true, disables StrikenThrough font flag settingeditable
- the editable state,true
if this dialog is editable,false
otherwise
-
-
Method Detail
-
close
public boolean close()
- Overrides:
close
in classorg.eclipse.jface.dialogs.Dialog
-
getValue
public Font getValue()
Returns aFont
object that defines a font that user chose in this dialog.- Specified by:
getValue
in interfaceIChooseValueDialog<Font>
-
setErrorMessage
public void setErrorMessage(String newErrorMessage)
- Overrides:
setErrorMessage
in classorg.eclipse.jface.dialogs.TitleAreaDialog
-
setMessage
public void setMessage(String newMessage, int newType)
- Overrides:
setMessage
in classorg.eclipse.jface.dialogs.TitleAreaDialog
-
create
public void create()
- Overrides:
create
in classorg.eclipse.jface.dialogs.Dialog
-
createContents
protected org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite parent)
- Overrides:
createContents
in classorg.eclipse.jface.dialogs.TitleAreaDialog
-
createDialogArea
protected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent)
- Overrides:
createDialogArea
in classorg.eclipse.jface.dialogs.TitleAreaDialog
-
getInitialSize
protected org.eclipse.swt.graphics.Point getInitialSize()
- Overrides:
getInitialSize
in classorg.eclipse.jface.dialogs.TitleAreaDialog
-
okPressed
protected void okPressed()
- Overrides:
okPressed
in classorg.eclipse.jface.dialogs.Dialog
-
-