public class JFaceResources extends Object
All methods declared on this class are static. This class cannot be instantiated.
The following global state is also maintained by this class:
Modifier and Type | Field and Description |
---|---|
static String |
BANNER_FONT
The symbolic font name for the banner font (value
"org.eclipse.jface.bannerfont" ). |
static String |
DEFAULT_FONT
The symbolic font name for the standard font (value
"org.eclipse.jface.defaultfont" ). |
static String |
DIALOG_FONT
The symbolic font name for the dialog font (value
"org.eclipse.jface.dialogfont" ). |
static String |
HEADER_FONT
The symbolic font name for the header font (value
"org.eclipse.jface.headerfont" ). |
static String |
TEXT_FONT
The symbolic font name for the text font (value
"org.eclipse.jface.textfont" ). |
static String |
VIEWER_FONT
Deprecated.
This font is not in use
|
static String |
WINDOW_FONT
Deprecated.
This font is not in use
|
Modifier and Type | Method and Description |
---|---|
static String |
format(String key,
Object[] args)
Returns the formatted message for the given key in JFace's resource
bundle.
|
static Font |
getBannerFont()
Returns the JFace's banner font.
|
static ResourceBundle |
getBundle()
Returns the resource bundle for JFace itself.
|
static ColorRegistry |
getColorRegistry()
Returns the color registry for JFace itself.
|
static Font |
getDefaultFont()
Returns JFace's standard font.
|
static FontDescriptor |
getDefaultFontDescriptor()
Returns the descriptor for JFace's standard font.
|
static Font |
getDialogFont()
Returns the JFace's dialog font.
|
static FontDescriptor |
getDialogFontDescriptor()
Returns the descriptor for JFace's dialog font.
|
static Font |
getFont(String symbolicName)
Returns the font in JFace's font registry with the given symbolic font
name.
|
static FontDescriptor |
getFontDescriptor(String symbolicName)
Returns the font descriptor for in JFace's font registry with the given
symbolic name.
|
static FontRegistry |
getFontRegistry()
Returns the font registry for JFace itself.
|
static Font |
getHeaderFont()
Returns the JFace's header font.
|
static FontDescriptor |
getHeaderFontDescriptor()
Returns the descriptor for JFace's header font.
|
static Image |
getImage(String key)
Returns the image in JFace's image registry with the given key, or
null if none. |
static ImageRegistry |
getImageRegistry()
Returns the image registry for JFace itself.
|
static ResourceManager |
getResources()
Returns the ResourceManager for the current display.
|
static ResourceManager |
getResources(Display toQuery)
Returns the global resource manager for the given display
|
static String |
getString(String key)
Returns the resource object with the given key in JFace's resource
bundle.
|
static String[] |
getStrings(String[] keys)
Returns a list of string values corresponding to the given list of keys.
|
static Font |
getTextFont()
Returns JFace's text font.
|
static FontDescriptor |
getTextFontDescriptor()
Returns the descriptor for JFace's text font.
|
static Font |
getViewerFont()
Deprecated.
This font is not in use
|
static void |
setFontRegistry(FontRegistry registry)
Sets JFace's font registry to the given value.
|
public static final String BANNER_FONT
"org.eclipse.jface.bannerfont"
).public static final String DEFAULT_FONT
"org.eclipse.jface.defaultfont"
).public static final String DIALOG_FONT
"org.eclipse.jface.dialogfont"
).public static final String HEADER_FONT
"org.eclipse.jface.headerfont"
).public static final String TEXT_FONT
"org.eclipse.jface.textfont"
).@Deprecated public static final String VIEWER_FONT
"org.eclipse.jface.viewerfont"
).@Deprecated public static final String WINDOW_FONT
"org.eclipse.jface.windowfont"
).public static String format(String key, Object[] args)
key
- the resource nameargs
- the message argumentspublic static Font getBannerFont()
JFaceResources.getFontRegistry().get(JFaceResources.BANNER_FONT)
public static ResourceBundle getBundle()
ResourceBundle.getBundle("org.eclipse.jface.jface_nls")
.
Note that several static convenience methods are also provided on this class for directly accessing resources in this bundle.
public static ColorRegistry getColorRegistry()
ColorRegistry
.public static ResourceManager getResources(Display toQuery)
toQuery
- display to querypublic static ResourceManager getResources()
public static Font getDefaultFont()
JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT)
public static FontDescriptor getDefaultFontDescriptor()
JFaceResources.getFontRegistry().getDescriptor(JFaceResources.DEFAULT_FONT)
public static Font getDialogFont()
JFaceResources.getFontRegistry().get(JFaceResources.DIALOG_FONT)
public static FontDescriptor getDialogFontDescriptor()
JFaceResources.getFontRegistry().getDescriptor(JFaceResources.DIALOG_FONT)
public static Font getFont(String symbolicName)
JFaceResources.getFontRegistry().get(symbolicName)If an error occurs, return the default font.
symbolicName
- the symbolic font namepublic static FontDescriptor getFontDescriptor(String symbolicName)
JFaceResources.getFontRegistry().getDescriptor(symbolicName)If an error occurs, return the default font.
symbolicName
- the symbolic font namepublic static FontRegistry getFontRegistry()
setFontRegistry
, is it
initialized to
new FontRegistry("org.eclipse.jface.resource.jfacefonts")
.
Note that several static convenience methods are also provided on this class for directly accessing JFace's standard fonts.
public static Font getHeaderFont()
JFaceResources.getFontRegistry().get(JFaceResources.HEADER_FONT)
public static FontDescriptor getHeaderFontDescriptor()
JFaceResources.getFontRegistry().get(JFaceResources.HEADER_FONT)
public static Image getImage(String key)
null
if none. Convenience method equivalent to
JFaceResources.getImageRegistry().get(key)
key
- the keynull
if nonepublic static ImageRegistry getImageRegistry()
Note that the static convenience method getImage
is also
provided on this class.
public static String getString(String key)
key
- the resource namepublic static String[] getStrings(String[] keys)
getString
. The values are in the
same order as the keys.keys
- a list of keyspublic static Font getTextFont()
JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT)
public static FontDescriptor getTextFontDescriptor()
JFaceResources.getFontRegistry().getDescriptor(JFaceResources.TEXT_FONT)
@Deprecated public static Font getViewerFont()
JFaceResources.getFontRegistry().get(JFaceResources.VIEWER_FONT)
public static void setFontRegistry(FontRegistry registry)
JFaceResources.getFontRegistry
is invoked (either directly
or indirectly).registry
- a font registry
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.