Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.jface.resource
Class JFaceResources

java.lang.Object
  extended by 
org.eclipse.jface.resource.JFaceResources

public class JFaceResources
extends Object

Utility methods to access JFace-specific resources.

All methods declared on this class are static. This class cannot be instantiated.

The following global state is also maintained by this class:

  • a font registry
  • a color registry
  • an image registry
  • a resource bundle

Restriction:
This class is not intended to be subclassed by clients.
Restriction:
This class is not intended to be instantiated by clients.

Field Summary
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
 
Method Summary
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.
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BANNER_FONT

public static final 
String BANNER_FONT
The symbolic font name for the banner font (value "org.eclipse.jface.bannerfont").

See Also:
Constant Field Values

DEFAULT_FONT

public static final 
String DEFAULT_FONT
The symbolic font name for the standard font (value "org.eclipse.jface.defaultfont").

See Also:
Constant Field Values

DIALOG_FONT

public static final 
String DIALOG_FONT
The symbolic font name for the dialog font (value "org.eclipse.jface.dialogfont").

See Also:
Constant Field Values

HEADER_FONT

public static final 
String HEADER_FONT
The symbolic font name for the header font (value "org.eclipse.jface.headerfont").

See Also:
Constant Field Values

TEXT_FONT

public static final 
String TEXT_FONT
The symbolic font name for the text font (value "org.eclipse.jface.textfont").

See Also:
Constant Field Values

VIEWER_FONT

public static final 
String VIEWER_FONT
Deprecated. This font is not in use
The symbolic font name for the viewer font (value "org.eclipse.jface.viewerfont").

See Also:
Constant Field Values

WINDOW_FONT

public static final 
String WINDOW_FONT
Deprecated. This font is not in use
The symbolic font name for the window font (value "org.eclipse.jface.windowfont").

See Also:
Constant Field Values
Method Detail

format

public static 
String format(
String key,
                            
Object[] args)
Returns the formatted message for the given key in JFace's resource bundle.

Parameters:
key - the resource name
args - the message arguments
Returns:
the string

getBannerFont

public static 
Font getBannerFont()
Returns the JFace's banner font. Convenience method equivalent to
 JFaceResources.getFontRegistry().get(JFaceResources.BANNER_FONT)
 

Returns:
the font

getBundle

public static 
ResourceBundle getBundle()
Returns the resource bundle for JFace itself. The resouble bundle is obtained from 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.

Returns:
the resource bundle

getColorRegistry

public static 
ColorRegistry getColorRegistry()
Returns the color registry for JFace itself.

Returns:
the ColorRegistry.
Since:
3.0

getResources

public static 
ResourceManager getResources(
Display toQuery)
Returns the global resource manager for the given display

Parameters:
toQuery - display to query
Returns:
the global resource manager for the given display
Since:
3.1

getResources

public static 
ResourceManager getResources()
Returns the ResourceManager for the current display. May only be called from a UI thread.

Returns:
the global ResourceManager for the current display
Since:
3.1

getDefaultFont

public static 
Font getDefaultFont()
Returns JFace's standard font. Convenience method equivalent to
 JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT)
 

Returns:
the font

getDefaultFontDescriptor

public static 
FontDescriptor getDefaultFontDescriptor()
Returns the descriptor for JFace's standard font. Convenience method equivalent to
 JFaceResources.getFontRegistry().getDescriptor(JFaceResources.DEFAULT_FONT)
 

Returns:
the font
Since:
3.3

getDialogFont

public static 
Font getDialogFont()
Returns the JFace's dialog font. Convenience method equivalent to
 JFaceResources.getFontRegistry().get(JFaceResources.DIALOG_FONT)
 

Returns:
the font

getDialogFontDescriptor

public static 
FontDescriptor getDialogFontDescriptor()
Returns the descriptor for JFace's dialog font. Convenience method equivalent to
 JFaceResources.getFontRegistry().getDescriptor(JFaceResources.DIALOG_FONT)
 

Returns:
the font
Since:
3.3

getFont

public static 
Font getFont(
String symbolicName)
Returns the font in JFace's font registry with the given symbolic font name. Convenience method equivalent to
 JFaceResources.getFontRegistry().get(symbolicName)
 
If an error occurs, return the default font.

Parameters:
symbolicName - the symbolic font name
Returns:
the font

getFontDescriptor

public static 
FontDescriptor getFontDescriptor(
String symbolicName)
Returns the font descriptor for in JFace's font registry with the given symbolic name. Convenience method equivalent to
 JFaceResources.getFontRegistry().getDescriptor(symbolicName)
 
If an error occurs, return the default font.

Parameters:
symbolicName - the symbolic font name
Returns:
the font descriptor (never null)
Since:
3.3

getFontRegistry

public static 
FontRegistry getFontRegistry()
Returns the font registry for JFace itself. If the value has not been established by an earlier call to 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.

Returns:
the JFace font registry

getHeaderFont

public static 
Font getHeaderFont()
Returns the JFace's header font. Convenience method equivalent to
 JFaceResources.getFontRegistry().get(JFaceResources.HEADER_FONT)
 

Returns:
the font

getHeaderFontDescriptor

public static 
FontDescriptor getHeaderFontDescriptor()
Returns the descriptor for JFace's header font. Convenience method equivalent to
 JFaceResources.getFontRegistry().get(JFaceResources.HEADER_FONT)
 

Returns:
the font descriptor (never null)
Since:
3.3

getImage

public static 
Image getImage(
String key)
Returns the image in JFace's image registry with the given key, or null if none. Convenience method equivalent to
 JFaceResources.getImageRegistry().get(key)
 

Parameters:
key - the key
Returns:
the image, or null if none

getImageRegistry

public static 
ImageRegistry getImageRegistry()
Returns the image registry for JFace itself.

Note that the static convenience method getImage is also provided on this class.

Returns:
the JFace image registry

getString

public static 
String getString(
String key)
Returns the resource object with the given key in JFace's resource bundle. If there isn't any value under the given key, the key is returned.

Parameters:
key - the resource name
Returns:
the string

getStrings

public static 
String[] getStrings(
String[] keys)
Returns a list of string values corresponding to the given list of keys. The lookup is done with getString. The values are in the same order as the keys.

Parameters:
keys - a list of keys
Returns:
a list of corresponding string values

getTextFont

public static 
Font getTextFont()
Returns JFace's text font. Convenience method equivalent to
 JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT)
 

Returns:
the font

getTextFontDescriptor

public static 
FontDescriptor getTextFontDescriptor()
Returns the descriptor for JFace's text font. Convenience method equivalent to
 JFaceResources.getFontRegistry().getDescriptor(JFaceResources.TEXT_FONT)
 

Returns:
the font descriptor (never null)
Since:
3.3

getViewerFont

public static 
Font getViewerFont()
Deprecated. This font is not in use

Returns JFace's viewer font. Convenience method equivalent to
 JFaceResources.getFontRegistry().get(JFaceResources.VIEWER_FONT)
 

Returns:
the font

setFontRegistry

public static void setFontRegistry(
FontRegistry registry)
Sets JFace's font registry to the given value. This method may only be called once; the call must occur before JFaceResources.getFontRegistry is invoked (either directly or indirectly).

Parameters:
registry - a font registry

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire