public interface IEditionService
A text editor is bound to a model element and a file, and must have one of those types:
Each editor can be set to read-only mode.
IMDAEditorListener
Modifier and Type | Method and Description |
---|---|
void |
activateEditor(IMDATextEditor editor)
Set the focus on a specific editor.
|
void |
closeEditor(IMDATextEditor editor)
Close the given text editor.
|
boolean |
createDocumentContent(ExternDocument doc)
Create a document content for the given document.
|
Path |
editRichNote(ExternDocument doc,
IExternDocumentChangeListener listener)
Get a copy of the file for a given external document.
|
List<String> |
getSupportedMimeTypes()
Indicates which mime type are supported in the current instance of Modelio.
|
String |
html2text(String s) |
void |
openEditor(AbstractDiagram diagram)
Open a diagram editor from an absract diagram.
|
void |
openEditor(Artifact artifact)
Open an editor from an artifact.
The file declared by the artifact must be part of the supported mime type list. |
void |
openEditor(ExternDocument document)
Open an editor from an extern document.
The type of the document's file must be part of the supported mime type list. |
IMDATextEditor |
openEditor(ModelElement modelElement,
File file,
EditorType editorTypeID,
boolean readonly)
Open a new text editor, making the correspondence between a model element and a file.
|
IMDATextEditor |
openEditor(ModelElement modelElement,
File file,
EditorType editorTypeID,
boolean readonly,
String charsetName)
Open a new text editor, making the correspondence between a model element and a file.
|
void |
registerDiagramContributor(ContributorCategory category,
IWizardContributor contributor)
Register creation wizard contributor
|
void |
saveRichNote(ExternDocument doc,
Path fileToSave)
Save the external document.
|
void |
setDocumentContent(ExternDocument doc,
Path content)
Set a document content for the given document.
|
void |
unregisterDiagramContributor(ContributorCategory category,
IWizardContributor contributor)
Unregister creation wizard contributor
|
void |
unregisterListener(IExternDocumentChangeListener editor)
To call when an listener is not used anymore.
|
void closeEditor(IMDATextEditor editor)
editor
- The text editor to close.void activateEditor(IMDATextEditor editor)
editor
- the editor to focus.List<String> getSupportedMimeTypes()
IMDATextEditor openEditor(ModelElement modelElement, File file, EditorType editorTypeID, boolean readonly)
modelElement
- the model element to edit.file
- the file to display in the editor.editorTypeID
- the type of the editor to open.readonly
- true
if the editor is in read only mode.IMDATextEditor openEditor(ModelElement modelElement, File file, EditorType editorTypeID, boolean readonly, String charsetName)
modelElement
- the model element to edit.file
- the file to display in the editor.editorTypeID
- the type of the editor to open.readonly
- true
if the editor is in read only mode.charsetName
- The name of a supported charset
.void openEditor(AbstractDiagram diagram)
diagram
- the diagram to edit.void openEditor(Artifact artifact)
artifact
- the artifact to edit.boolean createDocumentContent(ExternDocument doc) throws IOException
A default content is found by 2 ways:
ExternDocumentType
with the same MIME type.
role_name.mime_type.dat
like file
role_name.dat
like file.
doc
- The document to initializetrue
if the file was created, false if no default content could be found.IOException
- in case of error trying to create the file.void setDocumentContent(ExternDocument doc, Path content) throws IOException
doc
- The document to update.content
- the content to set.IOException
- in case of error trying to set the file.Path editRichNote(ExternDocument doc, IExternDocumentChangeListener listener) throws IOException
doc
- an external document.listener
- A listener fired if the original note is modified externally, by SVN for example. null
means no edition.IOException
- in case of failure.void saveRichNote(ExternDocument doc, Path fileToSave) throws IOException
doc
- the external document model object.fileToSave
- the external document contentIOException
- in case of failure.void unregisterListener(IExternDocumentChangeListener editor)
editor
- the listener to unregister.void openEditor(ExternDocument document)
document
- the extern document to edit.void registerDiagramContributor(ContributorCategory category, IWizardContributor contributor)
contributor
- category
- of the diagram contributorvoid unregisterDiagramContributor(ContributorCategory category, IWizardContributor contributor)
contributor
- category
- of the diagram contributor