public class CmsSourceEditor extends java.lang.Object implements I_CmsEditor, I_CmsWindowCloseListener, com.vaadin.navigator.ViewChangeListener, I_CmsHasShortcutActions
| Modifier and Type | Class and Description |
|---|---|
static class |
CmsSourceEditor.EditorSettings
Stores the editor settings.
|
| Constructor and Description |
|---|
CmsSourceEditor()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterViewChange(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent event) |
boolean |
beforeViewChange(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent event) |
CmsCodeMirror.CodeMirrorLanguage |
getHighlightMode(CmsResource resource)
Returns the syntax highlighting type for the currently edited resource.
|
int |
getPriority()
Gets the priority.
|
java.util.Map<com.vaadin.event.Action,java.lang.Runnable> |
getShortcutActions()
Returns the shortcut actions.
|
void |
initUI(I_CmsAppUIContext context,
CmsResource resource,
java.lang.String backLink,
java.util.Map<java.lang.String,java.lang.String> params)
Within this method the editor UI should be initialized.
|
boolean |
matchesResource(CmsResource resource,
boolean plainText)
Checks whether the editor is available for the given resource.
|
boolean |
matchesType(I_CmsResourceType type,
boolean plainText)
Checks whether the editor is available for the given resource type.
|
I_CmsEditor |
newInstance()
Returns a new editor instance.
|
void |
onWindowClose()
Executed on window close.
|
public CmsSourceEditor()
public void afterViewChange(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent event)
afterViewChange in interface com.vaadin.navigator.ViewChangeListenerViewChangeListener.afterViewChange(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent)public boolean beforeViewChange(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent event)
beforeViewChange in interface com.vaadin.navigator.ViewChangeListenerViewChangeListener.beforeViewChange(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent)public CmsCodeMirror.CodeMirrorLanguage getHighlightMode(CmsResource resource)
resource - the resource to editpublic int getPriority()
I_CmsEditorIf multiple editors for the same resource type are available, the one with the highest priority will be picked.
getPriority in interface I_CmsEditorI_CmsEditor.getPriority()public java.util.Map<com.vaadin.event.Action,java.lang.Runnable> getShortcutActions()
I_CmsHasShortcutActionsgetShortcutActions in interface I_CmsHasShortcutActionsI_CmsHasShortcutActions.getShortcutActions()public void initUI(I_CmsAppUIContext context, CmsResource resource, java.lang.String backLink, java.util.Map<java.lang.String,java.lang.String> params)
I_CmsEditorUse the context to add the app's components to the UI.
initUI in interface I_CmsEditorcontext - the UI contextresource - the resource to editbackLink - the link to return to when closing the editorparams - optional parametersI_CmsEditor.initUI(org.opencms.ui.apps.I_CmsAppUIContext, org.opencms.file.CmsResource, java.lang.String, java.util.Map)public boolean matchesResource(CmsResource resource, boolean plainText)
I_CmsEditormatchesResource in interface I_CmsEditorresource - the resource to editplainText - if plain text editing is requiredtrue if the editor is available for the given resourceI_CmsEditor.matchesResource(org.opencms.file.CmsResource, boolean)public boolean matchesType(I_CmsResourceType type, boolean plainText)
I_CmsEditormatchesType in interface I_CmsEditortype - the resource type to editplainText - if plain text editing is requiredtrue if the editor is available for the given resourceI_CmsEditor.matchesType(org.opencms.file.types.I_CmsResourceType, boolean)public I_CmsEditor newInstance()
I_CmsEditornewInstance in interface I_CmsEditorI_CmsEditor.newInstance()public void onWindowClose()
I_CmsWindowCloseListeneronWindowClose in interface I_CmsWindowCloseListenerI_CmsWindowCloseListener.onWindowClose()