org.gnu.gtk

Class FontSelection


public class FontSelection
extends VBox

A widget that lists the available fonts, styles and sizes, allowing the user to select a font. It is used in the FontSelectionDialog widget to provide a dialog box for selecting fonts.
See Also:
FontSelectionDialog

Constructor Summary

FontSelection()
Creates a new font selection widget
FontSelection(Handle handle)
Construct a new FontSelection from a handle to a native resource.

Method Summary

String
getFont()
Returns the name of the currently selected font.
static FontSelection
getFontSelection(Handle handle)
Internal static factory method to be used by Java-Gnome only.
String
getPreviewText()
Returns the text which appears in the preview box.
void
getPreviewText(String previewText)
Sets the text to appear in the preview box.
static Type
getType()
Retrieve the runtime type used by the GLib library.
void
setFont(String font)
Sets the currently-selected font.

Methods inherited from class org.gnu.gtk.VBox

getType, getVBox

Methods inherited from class org.gnu.gtk.Box

getHomogeneous, getSpacing, getType, packEnd, packEnd, packStart, packStart, reorderChild, setHomogeneous, setSpacing

Methods inherited from class org.gnu.gtk.Container

add, addListener, getBooleanChildProperty, getBorderWidth, getChildProperty, getChildren, getEventListenerClass, getEventType, getIntChildProperty, getResizeMode, getType, remove, removeListener, resizeChildren, setBooleanChildProperty, setBorderWidth, setChildProperty, setIntChildProperty, setResizeMode

Methods inherited from class org.gnu.gtk.Widget

activate, addAccelerator, addEvents, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, canActivateAccel, createContext, createLayout, draw, drawArea, drawArea, finish, getAccessible, getAllocation, getCanFocus, getColormap, getContext, getData, getDisplay, getDragData, getEventListenerClass, getEventType, getExtensionEvents, getModifierStyle, getName, getParent, getParentWindow, getPointer, getRootWindow, getScreen, getSensitive, getStyle, getToplevel, getType, getWidget, getWindow, grabDefault, grabFocus, hasFocus, hasScreen, hide, hideAll, highlight, highlight, intersect, isAncestor, makeWidget, modifyStyle, popColormap, pushColormap, realize, removeAccelerator, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, reparent, setBackgroundColor, setBaseColor, setCanFocus, setColormap, setDoubleBuffered, setDragDestination, setDragIcon, setDragIconPixbuf, setDragIconStock, setDragSource, setEvents, setExtensionEvents, setFont, setForegroundColor, setMinimumSize, setName, setNoDragDestination, setNoDragSource, setSensitive, setTextColor, shapeCombineMask, show, showAll, unHighlight, unHighlight

Methods inherited from class org.gnu.gtk.GtkObject

destroy, getType, sink

Constructor Details

FontSelection

public FontSelection()
Creates a new font selection widget

FontSelection

public FontSelection(Handle handle)
Construct a new FontSelection from a handle to a native resource.

Method Details

getFont

public String getFont()
Returns the name of the currently selected font.
Returns:
The name of the selected font.

getFontSelection

public static FontSelection getFontSelection(Handle handle)
Internal static factory method to be used by Java-Gnome only.

getPreviewText

public String getPreviewText()
Returns the text which appears in the preview box.

getPreviewText

public void getPreviewText(String previewText)
Sets the text to appear in the preview box.
Parameters:
previewText - The text which should appear in the preview box

getType

public static Type getType()
Retrieve the runtime type used by the GLib library.
Overrides:
getType in interface VBox

setFont

public void setFont(String font)
            throws org.gnu.gtk.FontSelection.FontNotFoundException
Sets the currently-selected font.
Parameters:
font - The name of the font to be selected