Package org.opencms.ui.apps
Class CmsEditor
- java.lang.Object
-
- org.opencms.ui.apps.CmsEditor
-
- All Implemented Interfaces:
com.vaadin.navigator.ViewChangeListener
,java.io.Serializable
,I_CmsHasShortcutActions
,I_CmsWorkplaceApp
,I_CmsWindowCloseListener
public class CmsEditor extends java.lang.Object implements I_CmsWorkplaceApp, com.vaadin.navigator.ViewChangeListener, I_CmsWindowCloseListener, I_CmsHasShortcutActions
The editor app. Will open the appropriate editor for a resource.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BACK_LINK_PREFIX
The back link prefix.static java.lang.String
PLAIN_TEXT_PREFIX
The back link prefix.static java.lang.String
RESOURCE_ID_PREFIX
The resource id state prefix.static java.lang.String
RESOURCE_PATH_PREFIX
The resource id state prefix.
-
Constructor Summary
Constructors Constructor Description CmsEditor()
-
Method Summary
All Methods Static 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)
static java.lang.String
getEditLink(CmsUUID structureId, boolean plainText, java.lang.String backLink)
Returns the edit link for given resource structure id.static java.lang.String
getEditState(CmsUUID structureId, boolean plainText, java.lang.String backLink)
Returns the edit state for the given resource structure id.static java.lang.String
getEditStateForNew(CmsObject cms, I_CmsResourceType resourceType, java.lang.String contextPath, java.lang.String modelFilePath, boolean plainText, java.lang.String backLink)
Returns the edit state for the given resource structure id.java.util.Map<com.vaadin.event.Action,java.lang.Runnable>
getShortcutActions()
Returns the shortcut actions.void
initUI(I_CmsAppUIContext context)
Within this method the app UI should be initialized.void
onStateChange(java.lang.String state)
Called on navigation events.void
onWindowClose()
Executed on window close.static void
openBackLink(java.lang.String backlink)
Navigates to the back link target.
-
-
-
Field Detail
-
BACK_LINK_PREFIX
public static final java.lang.String BACK_LINK_PREFIX
The back link prefix.- See Also:
- Constant Field Values
-
PLAIN_TEXT_PREFIX
public static final java.lang.String PLAIN_TEXT_PREFIX
The back link prefix.- See Also:
- Constant Field Values
-
RESOURCE_ID_PREFIX
public static final java.lang.String RESOURCE_ID_PREFIX
The resource id state prefix.- See Also:
- Constant Field Values
-
RESOURCE_PATH_PREFIX
public static final java.lang.String RESOURCE_PATH_PREFIX
The resource id state prefix.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsEditor
public CmsEditor()
-
-
Method Detail
-
getEditLink
public static java.lang.String getEditLink(CmsUUID structureId, boolean plainText, java.lang.String backLink)
Returns the edit link for given resource structure id.- Parameters:
structureId
- the resource structure isplainText
- if plain text/source editing is requiredbackLink
- the back link location- Returns:
- the state
-
getEditState
public static java.lang.String getEditState(CmsUUID structureId, boolean plainText, java.lang.String backLink)
Returns the edit state for the given resource structure id.- Parameters:
structureId
- the resource structure idplainText
- if plain text/source editing is requiredbackLink
- the back link location- Returns:
- the state
-
getEditStateForNew
public static java.lang.String getEditStateForNew(CmsObject cms, I_CmsResourceType resourceType, java.lang.String contextPath, java.lang.String modelFilePath, boolean plainText, java.lang.String backLink)
Returns the edit state for the given resource structure id.- Parameters:
cms
- the cms contextresourceType
- the resource type to createcontextPath
- the context pathmodelFilePath
- the model file pathplainText
- if plain text/source editing is requiredbackLink
- the back link location- Returns:
- the state
-
openBackLink
public static void openBackLink(java.lang.String backlink)
Navigates to the back link target.- Parameters:
backlink
- the back link
-
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)
-
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)
Description copied from interface:I_CmsWorkplaceApp
Within this method the app UI should be initialized.Use the context to add the app's components to the UI.
- Specified by:
initUI
in interfaceI_CmsWorkplaceApp
- Parameters:
context
- the UI context- See Also:
I_CmsWorkplaceApp.initUI(org.opencms.ui.apps.I_CmsAppUIContext)
-
onStateChange
public void onStateChange(java.lang.String state)
Description copied from interface:I_CmsWorkplaceApp
Called on navigation events.- Specified by:
onStateChange
in interfaceI_CmsWorkplaceApp
- Parameters:
state
- the app state to show- See Also:
I_CmsWorkplaceApp.onStateChange(java.lang.String)
-
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()
-
-