Interface IEmbeddedEditor
-
- All Known Implementing Classes:
EmbeddedXtextSourceEditor
public interface IEmbeddedEditorRepresents an embedded editor.- Author:
- Holger Eichelberger
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceIEmbeddedEditor.IDocumentStateListenerInforms interested parties about actual document changes.static interfaceIEmbeddedEditor.IValidationStateListenerInforms interested parties about the actual validation state of the editor.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddDocumentStateListener(IEmbeddedEditor.IDocumentStateListener listener)Adds a document state listener.voidaddValidationStateListener(IEmbeddedEditor.IValidationStateListener listener)Adds a validation state listener.booleandoSave()Save the editor content to the original resource if content changed.java.lang.StringgetContent()Returns the full content of the editor, including potential context such as prefix and postfix.java.lang.StringgetEditableContent()Returns the editable content in this editor.org.eclipse.jface.viewers.ViewergetViewer()Returns the actual viewer implementing the editor.voidrefresh()Refreshes the editor.voidremoveDocumentStateListener(IEmbeddedEditor.IDocumentStateListener listener)Removes the given document state listener.voidremoveValidationStateListener(IEmbeddedEditor.IValidationStateListener listener)Removes the given validation state listener.booleansetContent(java.lang.String[] content)Changes the content of the embedded editor.voidsetEditable(boolean editable)Changes whether the editor is enabled for editing.voidsetModelListener(AbstractModelChangeListener modelListener)Defines the model listener being called indoSave().
-
-
-
Method Detail
-
getViewer
org.eclipse.jface.viewers.Viewer getViewer()
Returns the actual viewer implementing the editor.- Returns:
- the actiall viewer
-
setContent
boolean setContent(java.lang.String[] content)
Changes the content of the embedded editor.- Parameters:
content- the actual editable content in terms of prefix not to be shown [0], content to be displayed [1] and postfix not to be shown[2]- Returns:
- whether the operation was successful (
true) or not (false)
-
refresh
void refresh()
Refreshes the editor.
-
addValidationStateListener
void addValidationStateListener(IEmbeddedEditor.IValidationStateListener listener)
Adds a validation state listener.- Parameters:
listener- the listener to be added
-
removeValidationStateListener
void removeValidationStateListener(IEmbeddedEditor.IValidationStateListener listener)
Removes the given validation state listener.- Parameters:
listener- the listener to be removed
-
addDocumentStateListener
void addDocumentStateListener(IEmbeddedEditor.IDocumentStateListener listener)
Adds a document state listener.- Parameters:
listener- the listener to be added
-
removeDocumentStateListener
void removeDocumentStateListener(IEmbeddedEditor.IDocumentStateListener listener)
Removes the given document state listener.- Parameters:
listener- the listener to be removed
-
doSave
boolean doSave()
Save the editor content to the original resource if content changed.- Returns:
trueif the content was saved,falseelse
-
setModelListener
void setModelListener(AbstractModelChangeListener modelListener)
Defines the model listener being called indoSave().- Parameters:
modelListener- the model listener (null for ignore it)
-
getEditableContent
java.lang.String getEditableContent()
Returns the editable content in this editor.- Returns:
- the editable content
-
getContent
java.lang.String getContent()
Returns the full content of the editor, including potential context such as prefix and postfix.- Returns:
- the full content
-
setEditable
void setEditable(boolean editable)
Changes whether the editor is enabled for editing.- Parameters:
editable-trueif editing is enabled,falseif only viewing is supported
-
-