Package io.jmix.ui.component.impl
Class TreeImpl<E>
- All Implemented Interfaces:
ActionsHolder
,AttachNotifier
,Component
,Component.BelongToFrame
,Component.Focusable
,Component.HasCaption
,Component.HasDescription
,Component.HasIcon
,Component.HasXmlDescriptor
,Component.Wrapper
,HasButtonsPanel
,HasContextHelp
,HasDebugId
,HasHtmlCaption
,HasHtmlDescription
,HasHtmlSanitizer
,HasInnerComponents
,HasItemCaptionProvider<E>
,HasSubParts
,ListComponent<E>
,LookupComponent<E>
,LookupComponent.LookupSelectionChangeNotifier<E>
,SecuredActionsHolder
,Tree<E>
,TreeSourceEventsDelegate<E>
,org.springframework.beans.factory.InitializingBean
public class TreeImpl<E>
extends AbstractComponent<JmixTree<E>>
implements Tree<E>, LookupComponent.LookupSelectionChangeNotifier<E>, SecuredActionsHolder, HasInnerComponents, org.springframework.beans.factory.InitializingBean, TreeSourceEventsDelegate<E>
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
protected class
Nested classes/interfaces inherited from interface io.jmix.ui.component.Component
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper
Nested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEvent
Nested classes/interfaces inherited from interface io.jmix.ui.component.LookupComponent
LookupComponent.LookupSelectionChangeEvent<T>, LookupComponent.LookupSelectionChangeNotifier<T>
Nested classes/interfaces inherited from interface io.jmix.ui.component.Tree
Tree.CollapseEvent<E>, Tree.ExpandEvent<E>, Tree.SelectionEvent<E>, Tree.SelectionMode
-
Field Summary
Modifier and TypeFieldDescriptionprotected AccessManager
protected Actions
protected final ActionsPermissions
protected ButtonsPanel
protected com.vaadin.shared.Registration
protected TreeImpl<E>.TreeComposition
protected TreeContextMenu<E>
protected final List<AbstractDataGrid.ActionMenuItemWrapper>
protected TreeDataProvider<E>
protected Action
protected Action
protected com.vaadin.shared.Registration
protected String
protected IconResolver
protected com.vaadin.shared.Registration
protected Metadata
protected MetadataTools
protected Tree.SelectionMode
protected final ShortcutsDelegate<com.vaadin.event.ShortcutListener>
protected boolean
protected com.vaadin.ui.StyleGenerator<E>
protected com.vaadin.ui.HorizontalLayout
protected UiTestIdsSupport
Fields inherited from class io.jmix.ui.component.impl.AbstractComponent
alignment, applicationContext, component, contextHelpIconClickHandler, contextHelpIconClickListener, descriptionAsHtml, element, frame, htmlSanitizerEnabled, icon, ICON_STYLE, id, parent
Fields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add an action to the componentvoid
Add an action to the component with index.addCollapseListener
(Consumer<Tree.CollapseEvent<E>> listener) Registers a new collapse listener.addExpandListener
(Consumer<Tree.ExpandEvent<E>> listener) Registers a new expand listener.Adds a listener that invoked when lookup selected items set is changed.addSelectionListener
(Consumer<Tree.SelectionEvent<E>> listener) Registers a new selection listener.void
addStyleProvider
(Function<? super E, String> styleProvider) Adds a style provider for tree items.void
protected void
attachAction
(Action action) void
attached()
Notifies all listeners that component has been attached.void
Collapses all tree nodes that are lower in level than a given item.void
Collapses tree nodes.protected TreeImpl<E>.TreeComposition
protected AbstractDataGrid.ActionMenuItemWrapper
createContextMenuItem
(Action action) protected TreeDataProvider<E>
createDataGridDataProvider
(TreeItems<E> treeItems) protected com.vaadin.data.provider.DataProvider<E,
?> protected ShortcutListenerDelegate
protected ShortcutsDelegate<com.vaadin.event.ShortcutListener>
protected com.vaadin.ui.HorizontalLayout
void
detached()
Notifies all listeners that component has been detached.void
Expands all tree nodes that are higher in level that a given item.void
Expands all tree nodes.void
expandUpTo
(int level) Expands tree including specified levelprotected void
fireSelectionEvent
(com.vaadin.event.selection.SelectionEvent<E> e) void
focus()
Sets focus to this componentprotected String
generateItemCaption
(E item) com.vaadin.ui.Component
Gets the item description generator.protected String
getGeneratedStyle
(E item) protected com.vaadin.ui.Component
getItemDetails
(E entity) protected com.vaadin.server.Resource
getItemIcon
(E item) getItems()
protected String
getRowDescription
(E item) Returns a set of entity instances corresponding to the selected rows of the list component.Returns an instance of entity corresponding to the selected row of the list component.Styles implementation is client-type-specific.int
Gets the tabulator index of theHasTabIndex
component.protected void
protected void
initComponent
(JmixTree<E> component) protected void
initComponentComposition
(TreeImpl<E>.TreeComposition composition) protected void
boolean
boolean
boolean
isDetailsVisible
(E entity) Checks whether details are visible for the given item.boolean
isExpanded
(Object itemId) Returns whether an item with given itemId is expanded or collapsed.boolean
protected void
onItemClick
(com.vaadin.ui.Tree.ItemClick<E> event) protected void
onItemCollapse
(com.vaadin.event.CollapseEvent<E> e) protected void
onItemExpand
(com.vaadin.event.ExpandEvent<E> e) protected void
onSelectionChange
(com.vaadin.event.selection.SelectionEvent<E> event) protected void
void
removeAction
(Action action) Remove the action from the componentvoid
removeAction
(String id) Remove the action by its ID.void
Remove all actions from the componentvoid
removeStyleProvider
(Function<? super E, String> styleProvider) Removes a previously added style provider.void
repaint()
Repaints UI representation of the tree including style providers and icon providers without refreshing the tree data.void
setAccessManager
(AccessManager accessManager) void
setActions
(Actions actions) void
setButtonsPanel
(ButtonsPanel panel) Sets aButtonsPanel
component.void
setCaption
(String caption) Sets the component's caption.void
setCaptionAsHtml
(boolean captionAsHtml) Sets whether the caption is rendered as HTML.void
setContentMode
(ContentMode contentMode) Sets the content mode of the item captions.void
setContextMenuEnabled
(boolean contextMenuEnabled) Sets whether or not context menu is enabled.void
setDebugId
(String id) INTERNAL.void
setDescription
(String description) Sets the component's description.void
setDescriptionProvider
(Function<? super E, String> provider) Sets the description generator that is used for generating tooltip descriptions for items.void
setDescriptionProvider
(Function<? super E, String> provider, ContentMode contentMode) Sets the description generator that is used for generating HTML tooltip descriptions for items.void
setDetailsGenerator
(Function<E, Component> generator) Sets a new details generator for item details.void
setDetailsVisible
(E entity, boolean visible) Shows or hides the details for a specific item.void
setEnterPressAction
(Action action) Sets the action to be executed on Enter key press.void
setIconProvider
(Function<? super E, String> iconProvider) Sets the icon provider for the tree.void
setIconResolver
(IconResolver iconResolver) void
Set component IDvoid
setItemCaptionProvider
(Function<? super E, String> itemCaptionProvider) Sets function that provides caption for component item.void
setItemClickAction
(Action action) Sets the action to be executed when double-clicking inside a tree node.void
Sets aDataUnit
supported by the Tree.void
setLookupSelectHandler
(Consumer<Collection<E>> selectHandler) void
setMetadata
(Metadata metadata) void
setMetadataTools
(MetadataTools metadataTools) void
setRowHeight
(double rowHeight) Sets the height of a row.void
setSelected
(E item) Selects a row of the list component for a given entity instance.void
setSelected
(Collection<E> items) Selects the rows of the list component for a given collection of entity instances.protected void
setSelectedInternal
(Collection<E> items) void
setSelectionMode
(Tree.SelectionMode selectionMode) Sets the Tree's selection mode.void
setStyleName
(String name) Sets one or more style names of the component, replacing any previous styles.void
setStyleProvider
(Function<? super E, String> styleProvider) Sets a single style provider for tree items.void
setTabIndex
(int tabIndex) Sets the tabulator index of theFocusable
component.void
setThemeConstantsManager
(ThemeConstantsManager themeConstantsManager) protected void
setUiTestId
(TreeItems<E> items) void
setUiTestIdsSupport
(UiTestIdsSupport uiTestIdsSupport) void
void
void
void
protected void
protected void
Methods inherited from class io.jmix.ui.component.impl.AbstractComponent
addAttachListener, addDetachListener, addStyleName, assignDebugId, getAlignment, getComponent, getContextHelpIconClickHandler, getContextHelpText, getDebugId, getEventHub, getFrame, getHeight, getHeightSizeUnit, getHtmlSanitizer, getIcon, getIconName, getIconResource, getId, getParent, getUiComponentProperties, getUiProperties, getWidth, getWidthSizeUnit, getXmlDescriptor, hasSubscriptions, hasValidationError, isAttached, isContextHelpTextHtmlEnabled, isDescriptionAsHtml, isEnabled, isEnabledRecursive, isHtmlSanitizerEnabled, isResponsive, isVisible, isVisibleRecursive, onContextHelpIconClick, publish, removeStyleName, sanitize, setAlignment, setApplicationContext, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled, setDescriptionAsHtml, setEnabled, setFrame, setHeight, setHtmlSanitizerEnabled, setIcon, setIconFromSet, setParent, setResponsive, setValidationError, setVisible, setWidth, setXmlDescriptor, unsubscribe, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.jmix.ui.component.ActionsHolder
getActionNN, getSubPart
Methods inherited from interface io.jmix.ui.component.Component
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getId, getParent, getWidth, getWidthSizeUnit, isEnabled, isEnabledRecursive, isResponsive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setParent, setResponsive, setSizeAuto, setSizeFull, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
Methods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrame
Methods inherited from interface io.jmix.ui.component.Component.Focusable
isFocusable, setFocusable
Methods inherited from interface io.jmix.ui.component.Component.HasIcon
getIcon, setIcon, setIconFromSet
Methods inherited from interface io.jmix.ui.component.HasContextHelp
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled
Methods inherited from interface io.jmix.ui.component.HasHtmlDescription
isDescriptionAsHtml, setDescriptionAsHtml
Methods inherited from interface io.jmix.ui.component.HasHtmlSanitizer
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
-
Field Details
-
internalStyles
-
styleProviders
-
styleGenerator
-
contextMenu
-
contextMenuItems
-
buttonsPanel
-
topPanel
protected com.vaadin.ui.HorizontalLayout topPanel -
componentComposition
-
enterPressAction
-
iconProvider
-
metadata
-
accessManager
-
iconResolver
-
metadataTools
-
actions
-
uiTestIdsSupport
-
selectionMode
-
doubleClickAction
-
itemClickListener
protected com.vaadin.shared.Registration itemClickListener -
actionList
-
shortcutsDelegate
-
actionsPermissions
-
showIconsForPopupMenuActions
protected boolean showIconsForPopupMenuActions -
hierarchyProperty
-
dataBinding
-
itemCaptionProvider
-
descriptionProvider
-
detailsGenerator
-
expandListener
protected com.vaadin.shared.Registration expandListener -
collapseListener
protected com.vaadin.shared.Registration collapseListener
-
-
Constructor Details
-
TreeImpl
public TreeImpl()
-
-
Method Details
-
createComponent
-
createShortcutsDelegate
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
initComponentComposition
-
initComponent
-
createComponentComposition
-
createEnterShortcutListener
-
generateItemCaption
-
initContextMenu
protected void initContextMenu() -
setAccessManager
-
setIconResolver
-
setMetadata
-
setMetadataTools
-
setThemeConstantsManager
-
setActions
-
setUiTestIdsSupport
-
getItems
-
setItems
Description copied from interface:Tree
Sets aDataUnit
supported by the Tree. -
setUiTestId
-
setDebugId
Description copied from interface:HasDebugId
INTERNAL. Managed by debug Id system.- Specified by:
setDebugId
in interfaceHasDebugId
- Overrides:
setDebugId
in classAbstractComponent<JmixTree<E>>
-
setId
Description copied from interface:Component
Set component ID -
createEmptyDataProvider
-
getHierarchyProperty
- Specified by:
getHierarchyProperty
in interfaceTree<E>
- Returns:
- the name of the property which forms the hierarchy
-
getItemClickAction
- Specified by:
getItemClickAction
in interfaceTree<E>
- Returns:
- an item double-click action
-
setItemClickAction
Description copied from interface:Tree
Sets the action to be executed when double-clicking inside a tree node.- Specified by:
setItemClickAction
in interfaceTree<E>
- Parameters:
action
- a new action
-
onItemClick
-
setItemCaptionProvider
Description copied from interface:HasItemCaptionProvider
Sets function that provides caption for component item.- Specified by:
setItemCaptionProvider
in interfaceHasItemCaptionProvider<E>
- Parameters:
itemCaptionProvider
- caption provider for item
-
getItemCaptionProvider
- Specified by:
getItemCaptionProvider
in interfaceHasItemCaptionProvider<E>
- Returns:
- caption provider for item
-
refreshActionsState
protected void refreshActionsState() -
createDataGridDataProvider
-
addAction
Description copied from interface:ActionsHolder
Add an action to the component- Specified by:
addAction
in interfaceActionsHolder
-
addAction
Description copied from interface:ActionsHolder
Add an action to the component with index.- Specified by:
addAction
in interfaceActionsHolder
-
createContextMenuItem
-
attachAction
-
removeAction
Description copied from interface:ActionsHolder
Remove the action from the component- Specified by:
removeAction
in interfaceActionsHolder
-
removeAction
Description copied from interface:ActionsHolder
Remove the action by its ID. If there is no action with that ID, nothing happens.- Specified by:
removeAction
in interfaceActionsHolder
-
removeAllActions
public void removeAllActions()Description copied from interface:ActionsHolder
Remove all actions from the component- Specified by:
removeAllActions
in interfaceActionsHolder
-
getActions
- Specified by:
getActions
in interfaceActionsHolder
- Returns:
- unmodifiable collection of actions
-
getAction
- Specified by:
getAction
in interfaceActionsHolder
- Returns:
- an action by its ID, or null if not found
-
getActionsPermissions
- Specified by:
getActionsPermissions
in interfaceSecuredActionsHolder
- Returns:
- permissions container
-
treeSourceItemSetChanged
- Specified by:
treeSourceItemSetChanged
in interfaceTreeSourceEventsDelegate<E>
-
treeSourcePropertyValueChanged
- Specified by:
treeSourcePropertyValueChanged
in interfaceTreeSourceEventsDelegate<E>
-
treeSourceStateChanged
- Specified by:
treeSourceStateChanged
in interfaceTreeSourceEventsDelegate<E>
-
treeSourceSelectedItemChanged
- Specified by:
treeSourceSelectedItemChanged
in interfaceTreeSourceEventsDelegate<E>
-
collapseTree
public void collapseTree()Description copied from interface:Tree
Collapses tree nodes.- Specified by:
collapseTree
in interfaceTree<E>
-
expandTree
public void expandTree()Description copied from interface:Tree
Expands all tree nodes.- Specified by:
expandTree
in interfaceTree<E>
-
collapse
Description copied from interface:Tree
Collapses all tree nodes that are lower in level than a given item. -
expand
Description copied from interface:Tree
Expands all tree nodes that are higher in level that a given item. -
expandUpTo
public void expandUpTo(int level) Description copied from interface:Tree
Expands tree including specified level- Specified by:
expandUpTo
in interfaceTree<E>
- Parameters:
level
- level of Tree nodes to expand, if passed level = 1 then root items will be expanded
-
isExpanded
Description copied from interface:Tree
Returns whether an item with given itemId is expanded or collapsed.- Specified by:
isExpanded
in interfaceTree<E>
- Parameters:
itemId
- item id to check- Returns:
- true if the item with itemId is expanded, false if collapsed
-
getCaption
- Specified by:
getCaption
in interfaceComponent.HasCaption
- Overrides:
getCaption
in classAbstractComponent<JmixTree<E>>
- Returns:
- the caption of the component
-
setCaption
Description copied from interface:Component.HasCaption
Sets the component's caption.- Specified by:
setCaption
in interfaceComponent.HasCaption
- Overrides:
setCaption
in classAbstractComponent<JmixTree<E>>
- Parameters:
caption
- the new component's caption
-
isCaptionAsHtml
public boolean isCaptionAsHtml()- Specified by:
isCaptionAsHtml
in interfaceHasHtmlCaption
- Overrides:
isCaptionAsHtml
in classAbstractComponent<JmixTree<E>>
- Returns:
true
if the caption is rendered as HTML,false
if rendered as plain text
-
setCaptionAsHtml
public void setCaptionAsHtml(boolean captionAsHtml) Description copied from interface:HasHtmlCaption
Sets whether the caption is rendered as HTML.- Specified by:
setCaptionAsHtml
in interfaceHasHtmlCaption
- Overrides:
setCaptionAsHtml
in classAbstractComponent<JmixTree<E>>
- Parameters:
captionAsHtml
-true
if the caption is rendered as HTML,false
if rendered as plain text- See Also:
-
getDescription
- Specified by:
getDescription
in interfaceComponent.HasDescription
- Overrides:
getDescription
in classAbstractComponent<JmixTree<E>>
- Returns:
- the components description, used in tooltips
-
setDescription
Description copied from interface:Component.HasDescription
Sets the component's description.- Specified by:
setDescription
in interfaceComponent.HasDescription
- Overrides:
setDescription
in classAbstractComponent<JmixTree<E>>
- Parameters:
description
- the new description to set
-
getInnerComponents
- Specified by:
getInnerComponents
in interfaceHasInnerComponents
-
getButtonsPanel
- Specified by:
getButtonsPanel
in interfaceHasButtonsPanel
- Returns:
- a buttons panel component.
-
getComposition
public com.vaadin.ui.Component getComposition()- Specified by:
getComposition
in interfaceComponent.Wrapper
- Overrides:
getComposition
in classAbstractComponent<JmixTree<E>>
-
setButtonsPanel
Description copied from interface:HasButtonsPanel
Sets aButtonsPanel
component.- Specified by:
setButtonsPanel
in interfaceHasButtonsPanel
- Parameters:
panel
- a buttons panel component
-
createTopPanel
protected com.vaadin.ui.HorizontalLayout createTopPanel() -
updateCompositionStylesTopPanelVisible
protected void updateCompositionStylesTopPanelVisible() -
handleClickAction
protected void handleClickAction() -
setLookupSelectHandler
- Specified by:
setLookupSelectHandler
in interfaceLookupComponent<E>
- Parameters:
selectHandler
- handler that should be executed when a user select an item in the lookup screen
-
getLookupSelectedItems
- Specified by:
getLookupSelectedItems
in interfaceLookupComponent<E>
- Returns:
- items selected in lookup component
-
setStyleName
Description copied from interface:Component
Sets one or more style names of the component, replacing any previous styles. Multiple styles can be specified as a space-separated list of style names. Styles implementation is client-type-specific.- Specified by:
setStyleName
in interfaceComponent
- Overrides:
setStyleName
in classAbstractComponent<JmixTree<E>>
- Parameters:
name
- one or more style names separated by space.
-
getStyleName
Description copied from interface:Component
Styles implementation is client-type-specific.- Specified by:
getStyleName
in interfaceComponent
- Overrides:
getStyleName
in classAbstractComponent<JmixTree<E>>
- Returns:
- current style name.
-
setStyleProvider
Description copied from interface:Tree
Sets a single style provider for tree items.- Specified by:
setStyleProvider
in interfaceTree<E>
- Parameters:
styleProvider
- a style provider to set
-
addStyleProvider
Description copied from interface:Tree
Adds a style provider for tree items.- Specified by:
addStyleProvider
in interfaceTree<E>
- Parameters:
styleProvider
- a style provider to add
-
removeStyleProvider
Description copied from interface:Tree
Removes a previously added style provider.- Specified by:
removeStyleProvider
in interfaceTree<E>
- Parameters:
styleProvider
- a style provider to remove
-
updateStyleGenerator
protected void updateStyleGenerator() -
getGeneratedStyle
-
repaint
public void repaint()Description copied from interface:Tree
Repaints UI representation of the tree including style providers and icon providers without refreshing the tree data. -
setIconProvider
Description copied from interface:Tree
Sets the icon provider for the tree.- Specified by:
setIconProvider
in interfaceTree<E>
- Parameters:
iconProvider
- an icon provider to set
-
getItemIcon
-
setEnterPressAction
Description copied from interface:Tree
Sets the action to be executed on Enter key press.- Specified by:
setEnterPressAction
in interfaceTree<E>
- Parameters:
action
- a new action
-
getEnterPressAction
- Specified by:
getEnterPressAction
in interfaceTree<E>
- Returns:
- an Enter key press action
-
isContextMenuEnabled
public boolean isContextMenuEnabled()- Specified by:
isContextMenuEnabled
in interfaceTree<E>
- Returns:
true
if context menu is enabled,false
otherwise
-
setContextMenuEnabled
public void setContextMenuEnabled(boolean contextMenuEnabled) Description copied from interface:Tree
Sets whether or not context menu is enabled. Default value istrue
.- Specified by:
setContextMenuEnabled
in interfaceTree<E>
- Parameters:
contextMenuEnabled
- specifies whether context menu is enabled
-
getTabIndex
public int getTabIndex()Description copied from interface:Component.Focusable
Gets the tabulator index of theHasTabIndex
component.- Specified by:
getTabIndex
in interfaceComponent.Focusable
- Returns:
- tab index set for the
HasTabIndex
component
-
setTabIndex
public void setTabIndex(int tabIndex) Description copied from interface:Component.Focusable
Sets the tabulator index of theFocusable
component. The tab index property is used to specify the order in which the fields are focused when the user presses the Tab key. Components with a defined tab index are focused sequentially first, and then the components with no tab index.- Specified by:
setTabIndex
in interfaceComponent.Focusable
- Parameters:
tabIndex
- tab index
-
getSelectionMode
- Specified by:
getSelectionMode
in interfaceTree<E>
- Returns:
- the currently used
Tree.SelectionMode
-
setSelectionMode
Description copied from interface:Tree
Sets the Tree's selection mode.- Specified by:
setSelectionMode
in interfaceTree<E>
- Parameters:
selectionMode
- the selection mode to use
-
setRowHeight
public void setRowHeight(double rowHeight) Description copied from interface:Tree
Sets the height of a row. If -1 (default), the row height is calculated based on the theme for an empty row before the Tree is displayed.- Specified by:
setRowHeight
in interfaceTree<E>
- Parameters:
rowHeight
- The height of a row in pixels or -1 for automatic calculation
-
setDescriptionProvider
Description copied from interface:Tree
Sets the description generator that is used for generating tooltip descriptions for items.- Specified by:
setDescriptionProvider
in interfaceTree<E>
- Parameters:
provider
- the description generator to use ornull
to remove a previously set provider if any
-
setDescriptionProvider
public void setDescriptionProvider(@Nullable Function<? super E, String> provider, ContentMode contentMode) Description copied from interface:Tree
Sets the description generator that is used for generating HTML tooltip descriptions for items.- Specified by:
setDescriptionProvider
in interfaceTree<E>
- Parameters:
provider
- the description generator to use ornull
to remove a previously set provider if anycontentMode
- the content mode for row tooltips
-
getRowDescription
-
getDescriptionProvider
Description copied from interface:Tree
Gets the item description generator.- Specified by:
getDescriptionProvider
in interfaceTree<E>
- Returns:
- the item description generator
-
getContentMode
- Specified by:
getContentMode
in interfaceTree<E>
- Returns:
- the content mode of the item captions
-
setContentMode
Description copied from interface:Tree
Sets the content mode of the item captions.- Specified by:
setContentMode
in interfaceTree<E>
- Parameters:
contentMode
- the content mode
-
getDetailsGenerator
- Specified by:
getDetailsGenerator
in interfaceTree<E>
- Returns:
- the current details generator for item details or
null
if not set
-
setDetailsGenerator
Description copied from interface:Tree
Sets a new details generator for item details.The currently opened item details will be re-rendered.
- Specified by:
setDetailsGenerator
in interfaceTree<E>
- Parameters:
generator
- the details generator to set
-
getItemDetails
-
isDetailsVisible
Description copied from interface:Tree
Checks whether details are visible for the given item.- Specified by:
isDetailsVisible
in interfaceTree<E>
- Parameters:
entity
- the item for which to check details visibility- Returns:
true
if the details are visible
-
setDetailsVisible
Description copied from interface:Tree
Shows or hides the details for a specific item.- Specified by:
setDetailsVisible
in interfaceTree<E>
- Parameters:
entity
- the item for which to set details visibilityvisible
-true
to show the details, orfalse
to hide them
-
addExpandListener
Description copied from interface:Tree
Registers a new expand listener.- Specified by:
addExpandListener
in interfaceTree<E>
- Parameters:
listener
- the listener to be added- Returns:
- a registration object for removing an event listener added to a source
-
onItemExpand
-
addCollapseListener
Description copied from interface:Tree
Registers a new collapse listener.- Specified by:
addCollapseListener
in interfaceTree<E>
- Parameters:
listener
- the listener to be added- Returns:
- a registration object for removing an event listener added to a source
-
onItemCollapse
-
onSelectionChange
-
fireSelectionEvent
-
isMultiSelect
public boolean isMultiSelect()- Specified by:
isMultiSelect
in interfaceListComponent<E>
- Returns:
- true if multiple selection mode is enabled
-
getSingleSelected
Description copied from interface:ListComponent
Returns an instance of entity corresponding to the selected row of the list component. If nothing is selected, the method returnsnull
. If multiple selection mode is enabled, returns the first selected instance.- Specified by:
getSingleSelected
in interfaceListComponent<E>
- Returns:
- an instance of entity corresponding to the selected row of the list component
-
getSelected
Description copied from interface:ListComponent
Returns a set of entity instances corresponding to the selected rows of the list component. If nothing is selected, the method returns aCollections.emptySet()
.- Specified by:
getSelected
in interfaceListComponent<E>
- Returns:
- a set of entity instances corresponding to the selected rows of the list component
-
setSelected
Description copied from interface:ListComponent
Selects a row of the list component for a given entity instance.- Specified by:
setSelected
in interfaceListComponent<E>
- Parameters:
item
- entity instance to select the row,null
to reset the selection
-
setSelected
Description copied from interface:ListComponent
Selects the rows of the list component for a given collection of entity instances.- Specified by:
setSelected
in interfaceListComponent<E>
- Parameters:
items
- collection of entity instances to select rows
-
setSelectedInternal
-
addSelectionListener
Description copied from interface:Tree
Registers a new selection listener.- Specified by:
addSelectionListener
in interfaceTree<E>
- Parameters:
listener
- the listener to register
-
addLookupValueChangeListener
public Subscription addLookupValueChangeListener(Consumer<LookupComponent.LookupSelectionChangeEvent<E>> listener) Description copied from interface:LookupComponent.LookupSelectionChangeNotifier
Adds a listener that invoked when lookup selected items set is changed.- Specified by:
addLookupValueChangeListener
in interfaceLookupComponent.LookupSelectionChangeNotifier<E>
- Parameters:
listener
- a listener to add- Returns:
Subscription
-
focus
public void focus()Description copied from interface:Component.Focusable
Sets focus to this component- Specified by:
focus
in interfaceComponent.Focusable
-
attached
public void attached()Description copied from interface:AttachNotifier
Notifies all listeners that component has been attached.- Specified by:
attached
in interfaceAttachNotifier
- Overrides:
attached
in classAbstractComponent<JmixTree<E>>
-
detached
public void detached()Description copied from interface:AttachNotifier
Notifies all listeners that component has been detached.- Specified by:
detached
in interfaceAttachNotifier
- Overrides:
detached
in classAbstractComponent<JmixTree<E>>
-