FontDialog widget problem on windows 7, 8, 10 [message #1765588] |
Mon, 12 June 2017 11:12 |
Eclipse User |
|
|
|
I am using Eclipse 3.7.0 for plugin development and I am using Xtext 2.9.2. My editor preferences isn't working correctly.
On windows 7, 8, 10 this happens:
- On 64 bit builds, I am not able to change editor font. Hitting the change button does nothing but change the mouse to the busy/sandclock for a second and then back again to normal.
*** The same 64 bit builds were tested on windows XP and everything works as it should. ***
- On 32 bit builds, everything works as expected and the windows font picker dialog appears.
enter image description here
This is how I create the preference page:
@Override
protected void createFieldEditors() {
// Add show font preference
fontField = new FontFieldEditor(JFaceResources.TEXT_FONT, EDIT_EDITOR_FONT_LABEL, getFieldEditorParent());
addField(fontField);
fontField.setPreferenceStore(getPreferenceStore());
// initialize the font preference with the default resources font if not initialized
String defaultFont = getPreferenceStore().getDefaultString(JFaceResources.TEXT_FONT);
if(defaultFont.isEmpty()) {
font= JFaceResources.getTextFont();
if (font != null) {
FontData[] data= font.getFontData();
if (data != null && data.length > 0) {
PreferenceConverter.setDefault(getPreferenceStore(), JFaceResources.TEXT_FONT, data[0]);
}
}
}
}
-----------------------------------------------------------------------
The .log file is empty and has nothing that is beneficial.
-----------------------------------------------------------------------
While debugging, I went to org.eclipse.swt.widgets.FontDialog.java and found that this line always returns false without the dialog appearing:
/* Open the dialog */
boolean success = OS.ChooseFont (lpcf)
From what I understand this call should be blocking and will only return when the dialog is closed either by X, OK or Cancel buttons but it returns immediately with false.
-----------------------------------------------------------------------
I also tried something as minimal as this example http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/FontDialogExample.htm and same thing happens.
|
|
|
Powered by
FUDForum. Page generated in 0.02773 seconds