diff options
author | Grant Gayed <ggayed> | 2003-04-15 20:53:37 +0000 |
---|---|---|
committer | Grant Gayed <ggayed> | 2003-04-15 20:53:37 +0000 |
commit | 58c80ff0565eaf7cdcac1e8ac1379b16f9b58992 (patch) | |
tree | cc264bf619ac6c8e8b959e929fd9ac55fced6306 /bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/FontDialog.java | |
parent | 1c620522c51a270f40c2d23df3c326f48275d8bd (diff) | |
download | eclipse.platform.swt-58c80ff0565eaf7cdcac1e8ac1379b16f9b58992.tar.gz eclipse.platform.swt-58c80ff0565eaf7cdcac1e8ac1379b16f9b58992.tar.xz eclipse.platform.swt-58c80ff0565eaf7cdcac1e8ac1379b16f9b58992.zip |
33316
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/FontDialog.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/FontDialog.java | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/FontDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/FontDialog.java index 174ed80d92..8c9f027bc8 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/FontDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/FontDialog.java @@ -99,10 +99,24 @@ int destroyFunc (int widget, int colorInfo) { * selected in the dialog, or null if none is available. * * @return the FontData for the selected font, or null + * @deprecated use #getFontDataSet () */ -public FontData getFontData() { +public FontData getFontData () { return fontData; } +/** + * Returns a FontData set describing the font that was + * selected in the dialog, or null if none is available. + * + * @return the FontData for the selected font, or null + * @since 2.2 + */ +public FontData [] getFontDataSet () { + if (fontData == null) return null; + FontData [] result = new FontData [1]; + result [0] = fontData; + return result; +} int okFunc (int widget, int callData) { int hFontName = OS.gtk_font_selection_dialog_get_font_name (callData); int fontSize = OS.strlen (hFontName); @@ -165,8 +179,24 @@ public FontData open () { * the platform choose one. * * @param fontData the FontData to use initially, or null + * @deprecated use #setFontData (FontData []) */ public void setFontData (FontData fontData) { this.fontData = fontData; } +/** + * Sets a set of FontData objects describing the font to + * be selected by default in the dialog, or null to let + * the platform choose one. + * + * @param fontData the set of FontData objects to use initially, or null + * @since 2.2 + */ +public void setFontData (FontData [] fontData) { + if (fontData != null && fontData.length > 0) { + this.fontData = fontData [0]; + } else { + this.fontData = null; + } +} } |