Class CmsResourceSelectDialog
- java.lang.Object
-
- com.vaadin.server.AbstractClientConnector
-
- com.vaadin.ui.AbstractComponent
-
- com.vaadin.ui.CustomComponent
-
- org.opencms.ui.components.fileselect.CmsResourceSelectDialog
-
- All Implemented Interfaces:
com.vaadin.event.ContextClickEvent.ContextClickNotifier
,com.vaadin.event.MethodEventSource
,com.vaadin.server.ClientConnector
,com.vaadin.server.Sizeable
,com.vaadin.shared.Connector
,com.vaadin.ui.Component
,com.vaadin.ui.HasComponents
,java.io.Serializable
,java.lang.Iterable<com.vaadin.ui.Component>
- Direct Known Subclasses:
CmsLocaleLinkTargetSelectionDialog
public class CmsResourceSelectDialog extends com.vaadin.ui.CustomComponent
Dialog with a site selector and file tree which can be used to select resources.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CmsResourceSelectDialog.Options
Class for site select options.-
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener
-
Nested classes/interfaces inherited from interface com.vaadin.ui.Component
com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener
-
Nested classes/interfaces inherited from interface com.vaadin.ui.HasComponents
com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier, com.vaadin.ui.HasComponents.ComponentAttachEvent, com.vaadin.ui.HasComponents.ComponentAttachListener, com.vaadin.ui.HasComponents.ComponentDetachEvent, com.vaadin.ui.HasComponents.ComponentDetachListener
-
-
Field Summary
Fields Modifier and Type Field Description protected CmsObject
m_currentCms
The CMS context.protected CmsResourceFilter
m_filter
The resource filter.protected CmsResource
m_root
The resource initially displayed at the root of the tree.static java.lang.String
PROPERTY_SITE_CAPTION
The property used for the site caption.
-
Constructor Summary
Constructors Constructor Description CmsResourceSelectDialog(CmsResourceFilter filter)
Creates a new instance.CmsResourceSelectDialog(CmsResourceFilter filter, CmsObject cms)
public constructor with given CmsObject.CmsResourceSelectDialog(CmsResourceFilter filter, CmsObject cms, CmsResourceSelectDialog.Options options)
public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSelectionHandler(I_CmsSelectionHandler<CmsResource> handler)
Adds a resource selection handler.protected CmsResourceTreeTable
createTree(CmsObject cms, CmsResource root)
Creates the resource tree for the given root.void
disableSiteSwitch()
Disables the option to select resources from other sites.protected CmsResourceSelectDialogContents
getContents()
Gets the content panel of this dialog.protected CmsResourceTreeTable
getFileTree()
Gets the file tree.protected void
onSiteChange(java.lang.String site)
Called when the user changes the site.void
openPath(java.lang.String path)
Opens the given path.void
showSitemapView(boolean showSitemapView)
Switches between the folders and sitemap view of the tree.void
showStartResource(CmsResource startResource)
Displays the start resource by opening all nodes in the tree leading to it.protected void
updateRoot(CmsObject rootCms, CmsResource siteRootResource)
Updates the current site root resource.protected void
updateView()
Updates the filtering state.-
Methods inherited from class com.vaadin.ui.CustomComponent
getComponentCount, getCompositionRoot, getState, getState, iterator, setCompositionRoot
-
Methods inherited from class com.vaadin.ui.AbstractComponent
addContextClickListener, addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getCustomAttributes, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isReadOnly, isRequiredIndicatorVisible, isResponsive, isVisible, readDesign, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeight, setHeightFull, setHeightUndefined, setIcon, setId, setLocale, setParent, setPrimaryStyleName, setReadOnly, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth, setWidthFull, setWidthUndefined, writeDesign
-
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
-
Methods inherited from interface com.vaadin.ui.Component
addListener, addStyleName, addStyleNames, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, readDesign, removeListener, removeStyleName, removeStyleNames, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setStyleName, setVisible, writeDesign
-
-
-
-
Field Detail
-
PROPERTY_SITE_CAPTION
public static final java.lang.String PROPERTY_SITE_CAPTION
The property used for the site caption.- See Also:
- Constant Field Values
-
m_currentCms
protected CmsObject m_currentCms
The CMS context.
-
m_filter
protected CmsResourceFilter m_filter
The resource filter.
-
m_root
protected CmsResource m_root
The resource initially displayed at the root of the tree.
-
-
Constructor Detail
-
CmsResourceSelectDialog
public CmsResourceSelectDialog(CmsResourceFilter filter) throws CmsException
Creates a new instance.- Parameters:
filter
- the resource filter to use- Throws:
CmsException
- if something goes wrong
-
CmsResourceSelectDialog
public CmsResourceSelectDialog(CmsResourceFilter filter, CmsObject cms) throws CmsException
public constructor with given CmsObject.- Parameters:
filter
- filter the resource filter to usecms
- CmsObejct to use- Throws:
CmsException
- if something goes wrong
-
CmsResourceSelectDialog
public CmsResourceSelectDialog(CmsResourceFilter filter, CmsObject cms, CmsResourceSelectDialog.Options options) throws CmsException
public constructor.- Parameters:
filter
- resource filtercms
- CmsObjectoptions
- options- Throws:
CmsException
- exception
-
-
Method Detail
-
addSelectionHandler
public void addSelectionHandler(I_CmsSelectionHandler<CmsResource> handler)
Adds a resource selection handler.- Parameters:
handler
- the handler
-
disableSiteSwitch
public void disableSiteSwitch()
Disables the option to select resources from other sites.
-
openPath
public void openPath(java.lang.String path)
Opens the given path.- Parameters:
path
- the path to open
-
showSitemapView
public void showSitemapView(boolean showSitemapView)
Switches between the folders and sitemap view of the tree.- Parameters:
showSitemapView
-true
to show the sitemap view
-
showStartResource
public void showStartResource(CmsResource startResource)
Displays the start resource by opening all nodes in the tree leading to it.- Parameters:
startResource
- the resource which should be shown in the tree
-
createTree
protected CmsResourceTreeTable createTree(CmsObject cms, CmsResource root)
Creates the resource tree for the given root.- Parameters:
cms
- the CMS contextroot
- the root resource- Returns:
- the resource tree
-
getContents
protected CmsResourceSelectDialogContents getContents()
Gets the content panel of this dialog.- Returns:
- content panel of this dialog
-
getFileTree
protected CmsResourceTreeTable getFileTree()
Gets the file tree.- Returns:
- the file tree
-
onSiteChange
protected void onSiteChange(java.lang.String site)
Called when the user changes the site.- Parameters:
site
- the new site root
-
updateRoot
protected void updateRoot(CmsObject rootCms, CmsResource siteRootResource)
Updates the current site root resource.- Parameters:
rootCms
- the CMS contextsiteRootResource
- the resource corresponding to a site root
-
updateView
protected void updateView()
Updates the filtering state.
-
-