Skip to content

Commit

Permalink
Fix for rendering issue with embedded props editor
Browse files Browse the repository at this point in the history
See: #611
  • Loading branch information
kdvolder committed May 4, 2021
1 parent e125871 commit c917df2
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,8 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,8 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.ui.PreferenceConstants;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
Expand All @@ -41,6 +44,9 @@
import org.eclipse.jface.text.source.projection.ProjectionViewer;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
Expand Down Expand Up @@ -142,6 +148,8 @@ public Object execute(ExecutionEvent arg0) throws ExecutionException {

private DefaultMarkerAnnotationAccess fileMarkerAnnotationAccess;

private Font font;

public EmbeddedEditor(ViewerConfigurationFactory viewerConfigFactory, IPreferenceStore prefStore, boolean withHandlers, boolean withDecorations) {
this.viewerConfigFactory = viewerConfigFactory;
this.prefStore = prefStore;
Expand Down Expand Up @@ -267,6 +275,9 @@ private void initViewer() {
IAnnotationModel annotationModel = provider.getAnnotationModel(editorInput);
viewer.setDocument(document, annotationModel);
viewer.setEditable(this.isEditable());
StyledText textWidget = viewer.getTextWidget();
Font font = JFaceResources.getTextFont();
textWidget.setFont(font);
}

private void updateDocumentProvider(IEditorInput editorInput) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,8 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,8 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,8 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,8 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
Expand Down

0 comments on commit c917df2

Please sign in to comment.