Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2011 itemis AG (http://www.itemis.eu) and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html /
 
 package org.eclipse.xtext.ui.editor.embedded;
 
Handle for an embedded Xtext editor. It allows to initialize the edited model and provides accessors for the document, the source viewer configuration, and the viewer.

Author(s):
Sebastian Zarnekow - Initial contribution and API
Since:
2.2
Noinstantiate:
This class is not intended to be instantiated by clients.
public class EmbeddedEditor {
	private final XtextSourceViewer viewer;
	private final XtextDocument document;
	private final Runnable afterSetDocument;
	public EmbeddedEditor(XtextDocument documentXtextSourceViewer viewerXtextSourceViewerConfiguration configurationIEditedResourceProvider resourceProviderRunnable afterSetDocumet) {
		this. = document;
		this. = viewer;
		this. = configuration;
		this. = resourceProvider;
		this. = afterSetDocumet;
	}
		return this.;
	}
		return this.;
	}
		return this.;
	}

Obtain the model access for this editor instance. It can be used to query the currently edited text or update it externally. The prefix and the suffix will not be visible in the editor. It is possible to insert artificial line-breaks between the three parts (prefix, editablePart, suffix).

Returns:
the model access. Never null.
	public EmbeddedEditorModelAccess createPartialEditor(String prefixString editablePartString suffixboolean insertLineBreaks) {
		EmbeddedEditorModelAccess result = new EmbeddedEditorModelAccess(this.this.insertLineBreaks);
		result.setModel(getDocument(), prefixeditablePartsuffix);
		return result;
	}

Obtain the model access for this editor instance. It can be used to query the currently edited text or update it externally. This is a shortcut for createPartialEditor("", "", "", insertLinebreaks).

Returns:
the model access. Never null.
	public EmbeddedEditorModelAccess createPartialEditor(boolean insertLinebreaks) {
		return createPartialEditor(""""""insertLinebreaks);
	}

Obtain the model access for this editor instance. It can be used to query the currently edited text or update it externally. This is a shortcut for createPartialEditor("", "", "", false).

Returns:
the model access. Never null.
		return createPartialEditor(""""""false);
	}
New to GrepCode? Check out our FAQ X