Package org.opencms.ade.sitemap.client
Class CmsSitemapTreeItem
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.Composite
-
- org.opencms.gwt.client.ui.CmsListItem
-
- org.opencms.gwt.client.ui.tree.CmsTreeItem
-
- org.opencms.gwt.client.ui.tree.CmsLazyTreeItem
-
- org.opencms.ade.sitemap.client.CmsSitemapTreeItem
-
- All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers
,com.google.gwt.event.shared.HasHandlers
,com.google.gwt.user.client.EventListener
,com.google.gwt.user.client.ui.HasVisibility
,com.google.gwt.user.client.ui.IsRenderable
,com.google.gwt.user.client.ui.IsWidget
,I_CmsDraggable
,I_CmsListItem
,I_CmsTruncable
public class CmsSitemapTreeItem extends CmsLazyTreeItem
Sitemap entry tree item implementation.- Since:
- 8.0.0
- See Also:
CmsLazyTreeItem
,CmsClientSitemapEntry
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
CmsSitemapTreeItem.DetailPageLabelTitleGenerator
Label generator for the detail page info label.-
Nested classes/interfaces inherited from class org.opencms.gwt.client.ui.tree.CmsLazyTreeItem
CmsLazyTreeItem.LoadingItem, CmsLazyTreeItem.LoadState
-
Nested classes/interfaces inherited from class org.opencms.gwt.client.ui.CmsListItem
CmsListItem.MoveHandle
-
-
Field Summary
Fields Modifier and Type Field Description protected org.opencms.util.CmsUUID
m_entryId
The current sitemap entry id.-
Fields inherited from class org.opencms.gwt.client.ui.tree.CmsTreeItem
ANIMATION_DURATION, m_children, m_opener
-
Fields inherited from class org.opencms.gwt.client.ui.CmsListItem
m_checkbox, m_decoratedPanel, m_decorationWidgets, m_decorationWidth, m_id, m_listItemWidget, m_mainWidget, m_panel, m_placeholder, m_provisionalParent, MOVE_HANDLE_MARKER_CLASS
-
-
Constructor Summary
Constructors Constructor Description CmsSitemapTreeItem(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
Default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static void
addInfo(java.util.List<org.opencms.gwt.shared.CmsAdditionalInfoBean> infos, java.lang.String label, java.lang.String value)
Helper method to add an additional info bean to a list.protected com.google.gwt.user.client.ui.Widget
addMarker(java.lang.String text)
Helper method for adding the marker widget.java.lang.String
getDisplayedUrl(java.lang.String sitePath)
Given the path of a sitemap entry, this method returns the URL which should be displayed to the user.com.google.gwt.dom.client.Element
getDragHelper(I_CmsDropTarget target)
Creates the drag helper element and attaches it into the DOM.org.opencms.util.CmsUUID
getEntryId()
Returns the entry id.static CmsSitemapTreeItem
getItemById(org.opencms.util.CmsUUID id)
Looks up a sitemap tree item by entry id.I_CmsDragHandle
getMoveHandle()
Returns the move handle.protected java.lang.String
getName(java.lang.String sitePath)
Return the name of this item, which can differ from the entry name for root nodes.java.lang.String
getPath()
Returns the path of IDs for the this item.org.opencms.ade.sitemap.shared.CmsClientSitemapEntry
getSitemapEntry()
Returns the sitemap entry.java.lang.String
getSitePath()
Returns the site path.void
highlight(boolean highlightOn)
Turns the highlighting for this item on or off.void
highlightTemporarily(int duration, CmsListItemWidget.Background background)
Temporarily highlights an item.boolean
isDropEnabled()
Checks if dropping is enabled.protected void
onChangeChildren()
Helper method which is called when the list of children changes.void
onDragCancel()
Executed on drag cancel.void
onDrop(I_CmsDropTarget target)
Executed on drop.void
onStartDrag(I_CmsDropTarget target)
Executed on drag start.protected void
removeInvalidChildren()
Helper method to remove invalid children that don't have a corresponding CmsSitemapClientEntry.void
resetEntry()
Resets entry appearance.void
setBackgroundColor(CmsListItemWidget.Background background)
Sets the background color of the list item widget.void
setStateIcon(org.opencms.gwt.shared.CmsListInfoBean.StateIcon icon)
Sets the icon.java.lang.String
toString()
void
updateDetailPageStatus()
Updates the detail page description.void
updateEditorMode()
Updates the sitemap editor mode.void
updateEntry(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
Refreshes the displayed data from the given sitemap entry.void
updateInNavigation(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
Updates the in navigation properties of the displayed entry.void
updateSitePath()
Updates the site path using the current site entry's data.void
updateSitePath(java.lang.String sitePath)
Updates the recursively the site path.-
Methods inherited from class org.opencms.gwt.client.ui.tree.CmsLazyTreeItem
getLoadState, isLoaded, onFinishLoading, onStartLoading
-
Methods inherited from class org.opencms.gwt.client.ui.tree.CmsTreeItem
add, addChild, adopt, clear, clearChildren, closeAllEmptyChildren, createOpener, executeOpen, fireClose, fireOpen, getChild, getChild, getChildCount, getChildren, getItemPosition, getLastOpenedItem, getParentItem, getParentTarget, getPathLevel, getTree, hideOpeners, insertChild, insertPlaceholderAsLastChild, isOpen, removeChild, removeChild, removeChild, removeOpener, repositionPlaceholder, setDropEnabled, setLeafStyle, setOpen, setOpen, setParentItem, setTree, showOpeners, visit
-
Methods inherited from class org.opencms.gwt.client.ui.CmsListItem
addCheckBox, addDecoration, addDecorationWidget, addMainWidget, cloneForPlaceholder, getCheckBox, getCursorOffsetDelta, getData, getDecorationWidgets, getDndHelperClass, getDndParentClass, getId, getListItemWidget, getMainWidget, getParentList, getPlaceholder, initContent, initContent, initContent, initMoveHandle, initMoveHandle, moveHandleLeft, removeDecorationWidget, setData, setDndHelperClass, setDndParentClass, setId, setSmallView, truncate
-
Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opencms.gwt.client.dnd.I_CmsDraggable
getElement
-
-
-
-
Field Detail
-
m_entryId
protected org.opencms.util.CmsUUID m_entryId
The current sitemap entry id.
-
-
Constructor Detail
-
CmsSitemapTreeItem
public CmsSitemapTreeItem(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
Default constructor.- Parameters:
entry
- the sitemap entry
-
-
Method Detail
-
getItemById
public static CmsSitemapTreeItem getItemById(org.opencms.util.CmsUUID id)
Looks up a sitemap tree item by entry id.- Parameters:
id
- the sitemap entry id- Returns:
- the corresponding sitemap tree item, or null if there is none
-
addInfo
protected static void addInfo(java.util.List<org.opencms.gwt.shared.CmsAdditionalInfoBean> infos, java.lang.String label, java.lang.String value)
Helper method to add an additional info bean to a list.- Parameters:
infos
- the list of additional info beanslabel
- the label for the new beanvalue
- the value for the new bean
-
getDisplayedUrl
public java.lang.String getDisplayedUrl(java.lang.String sitePath)
Given the path of a sitemap entry, this method returns the URL which should be displayed to the user.- Parameters:
sitePath
- the site path of a sitemap entry- Returns:
- the URL which should be displayed to the user
-
getDragHelper
public com.google.gwt.dom.client.Element getDragHelper(I_CmsDropTarget target)
Description copied from interface:I_CmsDraggable
Creates the drag helper element and attaches it into the DOM.- Specified by:
getDragHelper
in interfaceI_CmsDraggable
- Overrides:
getDragHelper
in classCmsTreeItem
- Parameters:
target
- the drop target- Returns:
- the drag helper element
- See Also:
I_CmsDraggable.getDragHelper(I_CmsDropTarget)
-
getEntryId
public org.opencms.util.CmsUUID getEntryId()
Returns the entry id.- Returns:
- the entry id
-
getMoveHandle
public I_CmsDragHandle getMoveHandle()
Description copied from class:CmsListItem
Returns the move handle.- Overrides:
getMoveHandle
in classCmsListItem
- Returns:
- the move handle
- See Also:
CmsListItem.getMoveHandle()
-
getPath
public java.lang.String getPath()
Description copied from class:CmsTreeItem
Returns the path of IDs for the this item.- Overrides:
getPath
in classCmsTreeItem
- Returns:
- a path of IDs separated by slash
- See Also:
CmsTreeItem.getPath()
-
getSitemapEntry
public org.opencms.ade.sitemap.shared.CmsClientSitemapEntry getSitemapEntry()
Returns the sitemap entry.- Returns:
- the sitemap entry
-
getSitePath
public java.lang.String getSitePath()
Returns the site path.- Returns:
- the site path
-
highlight
public void highlight(boolean highlightOn)
Turns the highlighting for this item on or off.- Parameters:
highlightOn
- if true, the highlighting is turned on, else off
-
highlightTemporarily
public void highlightTemporarily(int duration, CmsListItemWidget.Background background)
Temporarily highlights an item.- Parameters:
duration
- the duration for whichbackground
- the background to color to set when finished
-
isDropEnabled
public boolean isDropEnabled()
Description copied from class:CmsTreeItem
Checks if dropping is enabled.- Overrides:
isDropEnabled
in classCmsTreeItem
- Returns:
true
if dropping is enabled- See Also:
CmsTreeItem.isDropEnabled()
-
onDragCancel
public void onDragCancel()
Description copied from interface:I_CmsDraggable
Executed on drag cancel.- Specified by:
onDragCancel
in interfaceI_CmsDraggable
- Overrides:
onDragCancel
in classCmsTreeItem
- See Also:
I_CmsDraggable.onDragCancel()
-
onDrop
public void onDrop(I_CmsDropTarget target)
Description copied from interface:I_CmsDraggable
Executed on drop.- Specified by:
onDrop
in interfaceI_CmsDraggable
- Overrides:
onDrop
in classCmsListItem
- Parameters:
target
- the drop target- See Also:
I_CmsDraggable.onDrop(org.opencms.gwt.client.dnd.I_CmsDropTarget)
-
onStartDrag
public void onStartDrag(I_CmsDropTarget target)
Description copied from interface:I_CmsDraggable
Executed on drag start.- Specified by:
onStartDrag
in interfaceI_CmsDraggable
- Overrides:
onStartDrag
in classCmsListItem
- Parameters:
target
- the current drop target- See Also:
CmsListItem.onStartDrag(org.opencms.gwt.client.dnd.I_CmsDropTarget)
-
resetEntry
public void resetEntry()
Resets entry appearance.
-
setBackgroundColor
public void setBackgroundColor(CmsListItemWidget.Background background)
Sets the background color of the list item widget.If the background is
null
, the widget will be shown with its default style.- Parameters:
background
- the background color to set
-
setStateIcon
public void setStateIcon(org.opencms.gwt.shared.CmsListInfoBean.StateIcon icon)
Sets the icon.- Parameters:
icon
- the icon to set
-
toString
public java.lang.String toString()
- Overrides:
toString
in classcom.google.gwt.user.client.ui.UIObject
- See Also:
UIObject.toString()
-
updateDetailPageStatus
public void updateDetailPageStatus()
Updates the detail page description.
-
updateEditorMode
public void updateEditorMode()
Updates the sitemap editor mode.
-
updateEntry
public void updateEntry(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
Refreshes the displayed data from the given sitemap entry.- Parameters:
entry
- the sitemap entry to update
-
updateInNavigation
public void updateInNavigation(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
Updates the in navigation properties of the displayed entry.- Parameters:
entry
- the sitemap entry
-
updateSitePath
public void updateSitePath()
Updates the site path using the current site entry's data.
-
updateSitePath
public void updateSitePath(java.lang.String sitePath)
Updates the recursively the site path.- Parameters:
sitePath
- the new site path to set
-
addMarker
protected com.google.gwt.user.client.ui.Widget addMarker(java.lang.String text)
Helper method for adding the marker widget.- Parameters:
text
- the text for the marker widget- Returns:
- the new marker widget
-
getName
protected java.lang.String getName(java.lang.String sitePath)
Return the name of this item, which can differ from the entry name for root nodes.- Parameters:
sitePath
- the sitemap entry's site path- Returns:
- the name
-
onChangeChildren
protected void onChangeChildren()
Description copied from class:CmsTreeItem
Helper method which is called when the list of children changes.- Overrides:
onChangeChildren
in classCmsLazyTreeItem
- See Also:
CmsLazyTreeItem.onChangeChildren()
-
removeInvalidChildren
protected void removeInvalidChildren()
Helper method to remove invalid children that don't have a corresponding CmsSitemapClientEntry.
-
-