gwt-eclipse-plugin icon indicating copy to clipboard operation
gwt-eclipse-plugin copied to clipboard

Use Eclipse's font settings for GWT text editors

Open LinusPhoenix opened this issue 7 years ago • 3 comments

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.

LinusPhoenix avatar Oct 04 '18 09:10 LinusPhoenix

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.

rob5n avatar Feb 11 '19 23:02 rob5n

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?

rob5n avatar Feb 12 '19 00:02 rob5n

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:

  1. Select "Java Editor"
  2. 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.

voytechs avatar Jun 20 '19 10:06 voytechs