[SOLVED] How to get ride of the scrollbars in EmbeddedEditor [message #1728494] |
Tue, 05 April 2016 01:40 |
Parsa Pourali Messages: 210 Registered: February 2014 |
Senior Member |
|
|
Hi,
I am trying to view xtext embedded editor. However it shows the scrollbars which are really disturbing, e.g. when a single line is enough to show the text !
my code is as below:
EmbeddedEditorFactory factory = new EmbeddedEditorFactory();
xtextInjector.injectMembers(factory);
xTextEmbeddedEditor = factory.newEditor(new IEditedResourceProvider() {
@Override
public XtextResource createResource() {
return xtextResource;
}
}).showErrorAndWarningAnnotations().withParent(xtextEditorComposite);
xtextPartialEditor = xTextEmbeddedEditor.createPartialEditor(prefix,
editablePart, suffix, true);
xtextEditorComposite.update();
I found that in WithParent() method in the EmbeddedEditorFactory there is a code as below which forces scroll bars !
public EmbeddedEditor withParent(final Composite parent) {
if (editorBuild)
throw new IllegalStateException();
editorBuild = true;
// /*fProjectionSupport =*/installProjectionSupport(this.fSourceViewer);
final CompositeRuler annotationRuler;
if (annotationTypes != null && annotationTypes.length != 0) {
annotationRuler = new CompositeRuler();
} else {
annotationRuler = null;
}
final XtextSourceViewer viewer = this.sourceViewerFactory.createSourceViewer(
parent,
annotationRuler,
null, // overviewRuler
false, // showAnnotationOverview
SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
final XtextSourceViewerConfiguration viewerConfiguration = this.sourceViewerConfigurationProvider.get();
viewer.configure(viewerConfiguration);
...
Also, can you please guide me to some code examples for this slide :
http://fr.slideshare.net/meysholdt/lightweight-xtext-editorsasswtwidgets
Thanks,
Bests,
Parsa
[Updated on: Tue, 05 April 2016 20:58] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03016 seconds