Package org.opencms.ui.editors
Class CmsSourceEditor
- java.lang.Object
-
- org.opencms.ui.editors.CmsSourceEditor
-
- All Implemented Interfaces:
com.vaadin.navigator.ViewChangeListener
,java.io.Serializable
,I_CmsHasShortcutActions
,I_CmsWindowCloseListener
,I_CmsEditor
public class CmsSourceEditor extends java.lang.Object implements I_CmsEditor, I_CmsWindowCloseListener, com.vaadin.navigator.ViewChangeListener, I_CmsHasShortcutActions
The plain text editor.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CmsSourceEditor.EditorSettings
Stores the editor settings.
-
Constructor Summary
Constructors Constructor Description CmsSourceEditor()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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(CmsObject cms, 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.
-
-
-
Constructor Detail
-
CmsSourceEditor
public CmsSourceEditor()
Constructor.
-
-
Method Detail
-
afterViewChange
public void afterViewChange(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent event)
- Specified by:
afterViewChange
in interfacecom.vaadin.navigator.ViewChangeListener
- See Also:
ViewChangeListener.afterViewChange(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent)
-
beforeViewChange
public boolean beforeViewChange(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent event)
- Specified by:
beforeViewChange
in interfacecom.vaadin.navigator.ViewChangeListener
- See Also:
ViewChangeListener.beforeViewChange(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent)
-
getHighlightMode
public CmsCodeMirror.CodeMirrorLanguage getHighlightMode(CmsResource resource)
Returns the syntax highlighting type for the currently edited resource.- Parameters:
resource
- the resource to edit- Returns:
- the syntax highlighting type
-
getPriority
public int getPriority()
Description copied from interface:I_CmsEditor
Gets the priority.If multiple editors for the same resource type are available, the one with the highest priority will be picked.
- Specified by:
getPriority
in interfaceI_CmsEditor
- Returns:
- the priority
- See Also:
I_CmsEditor.getPriority()
-
getShortcutActions
public java.util.Map<com.vaadin.event.Action,java.lang.Runnable> getShortcutActions()
Description copied from interface:I_CmsHasShortcutActions
Returns the shortcut actions.- Specified by:
getShortcutActions
in interfaceI_CmsHasShortcutActions
- Returns:
- the shortcut actions
- See Also:
I_CmsHasShortcutActions.getShortcutActions()
-
initUI
public void initUI(I_CmsAppUIContext context, CmsResource resource, java.lang.String backLink, java.util.Map<java.lang.String,java.lang.String> params)
Description copied from interface:I_CmsEditor
Within this method the editor UI should be initialized.Use the context to add the app's components to the UI.
- Specified by:
initUI
in interfaceI_CmsEditor
- Parameters:
context
- the UI contextresource
- the resource to editbackLink
- the link to return to when closing the editorparams
- optional parameters- See Also:
I_CmsEditor.initUI(org.opencms.ui.apps.I_CmsAppUIContext, org.opencms.file.CmsResource, java.lang.String, java.util.Map)
-
matchesResource
public boolean matchesResource(CmsObject cms, CmsResource resource, boolean plainText)
Description copied from interface:I_CmsEditor
Checks whether the editor is available for the given resource.- Specified by:
matchesResource
in interfaceI_CmsEditor
- Parameters:
cms
- the CMS contextresource
- the resource to editplainText
- if plain text editing is required- Returns:
true
if the editor is available for the given resource- See Also:
I_CmsEditor.matchesResource(org.opencms.file.CmsObject, org.opencms.file.CmsResource, boolean)
-
matchesType
public boolean matchesType(I_CmsResourceType type, boolean plainText)
Description copied from interface:I_CmsEditor
Checks whether the editor is available for the given resource type.- Specified by:
matchesType
in interfaceI_CmsEditor
- Parameters:
type
- the resource type to editplainText
- if plain text editing is required- Returns:
true
if the editor is available for the given resource- See Also:
I_CmsEditor.matchesType(org.opencms.file.types.I_CmsResourceType, boolean)
-
newInstance
public I_CmsEditor newInstance()
Description copied from interface:I_CmsEditor
Returns a new editor instance.- Specified by:
newInstance
in interfaceI_CmsEditor
- Returns:
- the editor instance
- See Also:
I_CmsEditor.newInstance()
-
onWindowClose
public void onWindowClose()
Description copied from interface:I_CmsWindowCloseListener
Executed on window close.- Specified by:
onWindowClose
in interfaceI_CmsWindowCloseListener
- See Also:
I_CmsWindowCloseListener.onWindowClose()
-
-