Package org.opencms.ui.components
Class CmsExtendedSiteSelector
java.lang.Object
com.vaadin.server.AbstractClientConnector
com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractListing<T>
com.vaadin.ui.AbstractSingleSelect<T>
com.vaadin.ui.ComboBox<CmsExtendedSiteSelector.SiteSelectorOption>
org.opencms.ui.components.CmsExtendedSiteSelector
- All Implemented Interfaces:
com.vaadin.data.HasFilterableDataProvider<CmsExtendedSiteSelector.SiteSelectorOption,
,String> com.vaadin.data.HasItems<CmsExtendedSiteSelector.SiteSelectorOption>
,com.vaadin.data.HasValue<CmsExtendedSiteSelector.SiteSelectorOption>
,com.vaadin.event.ContextClickEvent.ContextClickNotifier
,com.vaadin.event.FieldEvents.BlurNotifier
,com.vaadin.event.FieldEvents.FocusNotifier
,com.vaadin.event.MethodEventSource
,com.vaadin.server.ClientConnector
,com.vaadin.server.Sizeable
,com.vaadin.shared.Connector
,com.vaadin.ui.Component
,com.vaadin.ui.Component.Focusable
,com.vaadin.ui.SingleSelect<CmsExtendedSiteSelector.SiteSelectorOption>
,Serializable
public class CmsExtendedSiteSelector
extends com.vaadin.ui.ComboBox<CmsExtendedSiteSelector.SiteSelectorOption>
Site selector widget which also optionally offers subsite options.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Class representing a single option.Nested classes/interfaces inherited from class com.vaadin.ui.ComboBox
com.vaadin.ui.ComboBox.CaptionFilter, com.vaadin.ui.ComboBox.DeclarativeStyleGenerator<T extends Object>, com.vaadin.ui.ComboBox.FetchItemsCallback<T extends Object>, com.vaadin.ui.ComboBox.NewItemHandler, com.vaadin.ui.ComboBox.NewItemProvider<T extends Object>
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractListing
com.vaadin.ui.AbstractListing.AbstractListingExtension<T extends Object>
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.data.HasValue
com.vaadin.data.HasValue.ValueChangeEvent<V extends Object>, com.vaadin.data.HasValue.ValueChangeListener<V extends Object>
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable
com.vaadin.server.Sizeable.Unit
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Longer default page length for site selectors.Fields inherited from class com.vaadin.ui.AbstractComponent
DESIGN_ATTR_PLAIN_TEXT
Fields inherited from interface com.vaadin.server.Sizeable
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetExplorerSiteSelectorOptions
(CmsObject cms, boolean addSubsites) Builds a list of site selector option that also includes subsites with the 'include in site selector' option enabled in their configuration.getOptionForSiteRoot
(String siteRoot) Gets the option for the specific site root (without any subsite path).void
initOptions
(CmsObject cms, boolean addSubsites) Initializes the select options.void
selectSite
(String siteRoot) Selects a specific site.Methods inherited from class com.vaadin.ui.ComboBox
addBlurListener, addFocusListener, addValueChangeListener, attach, detach, getDataProvider, getEmptySelectionCaption, getItemCaptionGenerator, getItemIconGenerator, getNewItemHandler, getNewItemProvider, getPageLength, getPlaceholder, getPopupWidth, getState, getState, getStyleGenerator, isEmptySelectionAllowed, isScrollToSelectedItem, isTextInputAllowed, readItem, readItems, setDataProvider, setDataProvider, setDataProvider, setDataProvider, setEmptySelectionAllowed, setEmptySelectionCaption, setItemCaptionGenerator, setItemIconGenerator, setItems, setItems, setItems, setItems, setItems, setNewItemHandler, setNewItemProvider, setPageLength, setPlaceholder, setPopupWidth, setScrollToSelectedItem, setStyleGenerator, setTextInputAllowed, updateSelectedItemState, writeItem
Methods inherited from class com.vaadin.ui.AbstractSingleSelect
addSelectionListener, getCustomAttributes, getSelectedItem, getValue, isReadOnly, isRequiredIndicatorVisible, isSelected, keyToItem, setReadOnly, setRequiredIndicatorVisible, setSelectedItem, setSelectedItem, setValue
Methods inherited from class com.vaadin.ui.AbstractListing
addDataGenerator, deserializeDeclarativeRepresentation, doReadDesign, doWriteDesign, focus, getDataCommunicator, getTabIndex, internalGetDataProvider, internalSetDataProvider, internalSetDataProvider, readDesign, readItem, removeDataGenerator, serializeDeclarativeRepresentation, setTabIndex, writeDesign, writeItems
Methods inherited from class com.vaadin.ui.AbstractComponent
addContextClickListener, addListener, addShortcutListener, addStyleName, beforeClientResponse, findAncestor, fireComponentErrorEvent, fireComponentEvent, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeight, setHeightFull, setHeightUndefined, setIcon, setId, setLocale, setParent, setPrimaryStyleName, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth, setWidthFull, setWidthUndefined
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, 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, 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
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
Methods inherited from interface com.vaadin.data.HasFilterableDataProvider
setDataProvider
Methods inherited from interface com.vaadin.data.HasValue
clear, getDefaultValidator, getEmptyValue, getOptionalValue, isEmpty
Methods inherited from interface com.vaadin.server.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightFull, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull, setWidthUndefined
-
Field Details
-
LONG_PAGE_LENGTH
Longer default page length for site selectors.- See Also:
-
-
Constructor Details
-
CmsExtendedSiteSelector
public CmsExtendedSiteSelector()Creates a new instance.To actually use the widget, the initOptions method has to be called first.
-
-
Method Details
-
getExplorerSiteSelectorOptions
public static List<CmsExtendedSiteSelector.SiteSelectorOption> getExplorerSiteSelectorOptions(CmsObject cms, boolean addSubsites) Builds a list of site selector option that also includes subsites with the 'include in site selector' option enabled in their configuration.- Parameters:
cms
- the current CMS contextaddSubsites
- true if subsite options should be added- Returns:
- the the extended site selecctor options
-
getOptionForSiteRoot
Gets the option for the specific site root (without any subsite path).If no option for the site is found, returns null.
- Parameters:
siteRoot
- the site root- Returns:
- the option for the site root
-
initOptions
Initializes the select options.- Parameters:
cms
- the CMS contextaddSubsites
- true if subsites should be shown
-
selectSite
Selects a specific site.- Parameters:
siteRoot
- the site root
-