gwt-eclipse-plugin
gwt-eclipse-plugin copied to clipboard
Use Eclipse's font settings for GWT text editors
Hi,
I changed Eclipse's (Eclipse Photon) "Text Font" and "Text Editor Block Selection Font" settings. The new font shows up in the text editors for normal Java projects, but not when I open files associated to GWT projects, those still use the default one. It would be nice if GWT editors either respected the Basic Eclipse setting or there was an option for changing the font in those as well.
I am also experiencing this issue on Eclipse 2018-12. The only workaround I can find is to use File > Open With > Java Editor each time you open a file.
I took a brief look at the code. There is com.google.gwt.eclipse.core.editors.java.GWTJavaEditor which extends org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor which in turn extends the eclipse JavaEditor class.
If the Java Editor is successfully using the Text Font preference, I would expect any plugins that extend that editor to also use the same font preference, unless they specify otherwise. And this seems to have been working up until Photon came out? I wonder if it is a bug in Eclipse? Or is the GWT plugin not being explicit enough about the fonts?
I ran into this same issue with pretty much all of the eclipses with the GWT v3 plugin that has the GWT Java Editor. It doesn't follow the text-editor font inheritance properly.
Unless you absolutely need to use the GWT Java Editor for every single .java file type because it has syntax support for JNSI code, you can change the order in which the text editors are chosen for the .java file type.
Preferences > General > Editors > File Associations > File Types > *.java > Associated editors:
- Select "Java Editor"
- Click "Default" button to make that the default editor
You can still edit java files with JNSI comment code in it with the GWT Java Editor:
Project Explorer > Right Click your .java" file > Open With > GWT Java Editor
The regular java editor can easily change the default font size or resize the font size on the fly. I adjust the font size using the <ctrl>+ and <ctrl>- key press inside the Java editor.