package bndtools.editor;

import org.bndtools.core.editors.BndResourceMarkerAnnotationModel;
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.text.source.IAnnotationModel;
import org.eclipse.ui.editors.text.TextFileDocumentProvider;

public class BndSourceDocumentProvider extends TextFileDocumentProvider {
    @Override
    protected IAnnotationModel createAnnotationModel(IFile file) {
        return new BndResourceMarkerAnnotationModel(file);
    }
}

package bndtools.editor;

import org.bndtools.core.editors.BndResourceMarkerAnnotationModel;
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.text.source.IAnnotationModel;
import org.eclipse.ui.editors.text.TextFileDocumentProvider;

public class BndSourceDocumentProvider extends TextFileDocumentProvider {
    @Override
    protected IAnnotationModel createAnnotationModel(IFile file) {
        return new BndResourceMarkerAnnotationModel(file);
    }

    @Override
    public String getDefaultEncoding() {
        return "UTF-8";
    }

}

Make sure we always save bnd files as UTF-8 and not accidentally inherit the local Eclipse platform encoding …
Make sure we always save bnd files as UTF-8 and not accidentally inherit the local Eclipse platform encoding …

We need to force this since we should not depend on local Eclipse settings

Signed-off-by: Peter Kriens <016a769244db65ccbb64c8b271e9b7b28d4a3ce8@aqute.biz>