public class TreeImpl<E> extends AbstractComponent<JmixTree<E>> implements Tree<E>, LookupComponent.LookupSelectionChangeNotifier<E>, SecuredActionsHolder, HasInnerComponents, org.springframework.beans.factory.InitializingBean, TreeSourceEventsDelegate<E>
Modifier and Type | Class and Description |
---|---|
protected class |
TreeImpl.EmptyTreeDataProvider<T> |
protected class |
TreeImpl.TreeComposition |
Tree.CollapseEvent<E>, Tree.ExpandEvent<E>, Tree.SelectionEvent<E>, Tree.SelectionMode
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper
HasContextHelp.ContextHelpIconClickEvent
LookupComponent.LookupSelectionChangeEvent<T>, LookupComponent.LookupSelectionChangeNotifier<T>
Modifier and Type | Field and Description |
---|---|
protected io.jmix.core.AccessManager |
accessManager |
protected java.util.List<Action> |
actionList |
protected Actions |
actions |
protected ActionsPermissions |
actionsPermissions |
protected ButtonsPanel |
buttonsPanel |
protected com.vaadin.shared.Registration |
collapseListener |
protected TreeImpl.TreeComposition |
componentComposition |
protected TreeContextMenu<E> |
contextMenu |
protected java.util.List<AbstractDataGrid.ActionMenuItemWrapper> |
contextMenuItems |
protected TreeDataProvider<E> |
dataBinding |
protected java.util.function.Function<? super E,java.lang.String> |
descriptionProvider |
protected java.util.function.Function<E,Component> |
detailsGenerator |
protected Action |
doubleClickAction |
protected Action |
enterPressAction |
protected com.vaadin.shared.Registration |
expandListener |
protected java.lang.String |
hierarchyProperty |
protected java.util.function.Function<? super E,java.lang.String> |
iconProvider |
protected IconResolver |
iconResolver |
protected java.util.List<java.lang.String> |
internalStyles |
protected java.util.function.Function<? super E,java.lang.String> |
itemCaptionProvider |
protected com.vaadin.shared.Registration |
itemClickListener |
protected io.jmix.core.Metadata |
metadata |
protected io.jmix.core.MetadataTools |
metadataTools |
protected Tree.SelectionMode |
selectionMode |
protected ShortcutsDelegate<com.vaadin.event.ShortcutListener> |
shortcutsDelegate |
protected boolean |
showIconsForPopupMenuActions |
protected com.vaadin.ui.StyleGenerator<E> |
styleGenerator |
protected java.util.List<java.util.function.Function<? super E,java.lang.String>> |
styleProviders |
protected com.vaadin.ui.HorizontalLayout |
topPanel |
protected UiTestIdsSupport |
uiTestIdsSupport |
alignment, applicationContext, component, contextHelpIconClickHandler, contextHelpIconClickListener, descriptionAsHtml, element, frame, htmlSanitizerEnabled, icon, ICON_STYLE, id, parent
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
Constructor and Description |
---|
TreeImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addAction(Action action)
Add an action to the component
|
void |
addAction(Action action,
int index)
Add an action to the component with index.
|
io.jmix.core.common.event.Subscription |
addCollapseListener(java.util.function.Consumer<Tree.CollapseEvent<E>> listener)
Registers a new collapse listener.
|
io.jmix.core.common.event.Subscription |
addExpandListener(java.util.function.Consumer<Tree.ExpandEvent<E>> listener)
Registers a new expand listener.
|
io.jmix.core.common.event.Subscription |
addLookupValueChangeListener(java.util.function.Consumer<LookupComponent.LookupSelectionChangeEvent<E>> listener)
Adds a listener that invoked when lookup selected items set is changed.
|
io.jmix.core.common.event.Subscription |
addSelectionListener(java.util.function.Consumer<Tree.SelectionEvent<E>> listener)
Registers a new selection listener.
|
void |
addStyleProvider(java.util.function.Function<? super E,java.lang.String> styleProvider)
Adds a style provider for tree items.
|
void |
afterPropertiesSet() |
protected void |
attachAction(Action action) |
void |
collapse(E item)
Collapses all tree nodes that are lower in level than a given item.
|
void |
collapseTree()
Collapses tree nodes.
|
protected JmixTree<E> |
createComponent() |
protected TreeImpl.TreeComposition |
createComponentComposition() |
protected AbstractDataGrid.ActionMenuItemWrapper |
createContextMenuItem(Action action) |
protected TreeDataProvider<E> |
createDataGridDataProvider(TreeItems<E> treeItems) |
protected com.vaadin.data.provider.DataProvider<E,?> |
createEmptyDataProvider() |
protected ShortcutListenerDelegate |
createEnterShortcutListener() |
protected ShortcutsDelegate<com.vaadin.event.ShortcutListener> |
createShortcutsDelegate() |
protected com.vaadin.ui.HorizontalLayout |
createTopPanel() |
void |
expand(E item)
Expands all tree nodes that are higher in level that a given item.
|
void |
expandTree()
Expands all tree nodes.
|
void |
expandUpTo(int level)
Expands tree including specified level
|
protected void |
fireSelectionEvent(com.vaadin.event.selection.SelectionEvent<E> e) |
void |
focus()
Sets focus to this component
|
protected java.lang.String |
generateItemCaption(E item) |
Action |
getAction(java.lang.String id) |
java.util.Collection<Action> |
getActions() |
ActionsPermissions |
getActionsPermissions() |
ButtonsPanel |
getButtonsPanel() |
java.lang.String |
getCaption() |
com.vaadin.ui.Component |
getComposition() |
ContentMode |
getContentMode() |
java.lang.String |
getDescription() |
java.util.function.Function<E,java.lang.String> |
getDescriptionProvider()
Gets the item description generator.
|
java.util.function.Function<E,Component> |
getDetailsGenerator() |
Action |
getEnterPressAction() |
protected java.lang.String |
getGeneratedStyle(E item) |
java.lang.String |
getHierarchyProperty() |
java.util.Collection<Component> |
getInnerComponents() |
java.util.function.Function<? super E,java.lang.String> |
getItemCaptionProvider() |
Action |
getItemClickAction() |
protected com.vaadin.ui.Component |
getItemDetails(E entity) |
protected com.vaadin.server.Resource |
getItemIcon(E item) |
TreeItems<E> |
getItems() |
java.util.Collection<E> |
getLookupSelectedItems() |
protected java.lang.String |
getRowDescription(E item) |
java.util.Set<E> |
getSelected()
Returns a set of entity instances corresponding to the selected rows of the list component.
|
Tree.SelectionMode |
getSelectionMode() |
E |
getSingleSelected()
Returns an instance of entity corresponding to the selected row of the list component.
|
java.lang.String |
getStyleName()
Styles implementation is client-type-specific.
|
int |
getTabIndex()
Gets the tabulator index of the
HasTabIndex component. |
protected void |
handleClickAction() |
protected void |
initComponent(JmixTree<E> component) |
protected void |
initComponentComposition(TreeImpl.TreeComposition composition) |
protected void |
initContextMenu() |
boolean |
isCaptionAsHtml() |
boolean |
isContextMenuEnabled() |
boolean |
isDetailsVisible(E entity)
Checks whether details are visible for the given item.
|
boolean |
isExpanded(java.lang.Object itemId)
Returns whether an item with given itemId is expanded or collapsed.
|
boolean |
isMultiSelect() |
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 |
refreshActionsState() |
void |
removeAction(Action action)
Remove the action from the component
|
void |
removeAction(java.lang.String id)
Remove the action by its ID.
|
void |
removeAllActions()
Remove all actions from the component
|
void |
removeStyleProvider(java.util.function.Function<? super E,java.lang.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(io.jmix.core.AccessManager accessManager) |
void |
setActions(Actions actions) |
void |
setButtonsPanel(ButtonsPanel panel)
Sets a
ButtonsPanel component. |
void |
setCaption(java.lang.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(java.lang.String id)
INTERNAL.
|
void |
setDescription(java.lang.String description)
Sets the component's description.
|
void |
setDescriptionProvider(java.util.function.Function<? super E,java.lang.String> provider)
Sets the description generator that is used for generating tooltip descriptions for items.
|
void |
setDescriptionProvider(java.util.function.Function<? super E,java.lang.String> provider,
ContentMode contentMode)
Sets the description generator that is used for generating HTML tooltip descriptions for items.
|
void |
setDetailsGenerator(java.util.function.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(java.util.function.Function<? super E,java.lang.String> iconProvider)
Sets the icon provider for the tree.
|
void |
setIconResolver(IconResolver iconResolver) |
void |
setId(java.lang.String id)
Set component ID
|
void |
setItemCaptionProvider(java.util.function.Function<? super E,java.lang.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 |
setItems(TreeItems<E> treeItems)
Sets a
DataUnit supported by the Tree. |
void |
setLookupSelectHandler(java.util.function.Consumer<java.util.Collection<E>> selectHandler) |
void |
setMetadata(io.jmix.core.Metadata metadata) |
void |
setMetadataTools(io.jmix.core.MetadataTools metadataTools) |
void |
setRowHeight(double rowHeight)
Sets the height of a row.
|
void |
setSelected(java.util.Collection<E> items)
Selects the rows of the list component for a given collection of entity instances.
|
void |
setSelected(E item)
Selects a row of the list component for a given entity instance.
|
protected void |
setSelectedInternal(java.util.Collection<E> items) |
void |
setSelectionMode(Tree.SelectionMode selectionMode)
Sets the Tree's selection mode.
|
void |
setStyleName(java.lang.String name)
Sets one or more style names of the component, replacing any
previous styles.
|
void |
setStyleProvider(java.util.function.Function<? super E,java.lang.String> styleProvider)
Sets a single style provider for tree items.
|
void |
setTabIndex(int tabIndex)
Sets the tabulator index of the
Focusable component. |
void |
setThemeConstantsManager(ThemeConstantsManager themeConstantsManager) |
protected void |
setUiTestId(TreeItems<E> items) |
void |
setUiTestIdsSupport(UiTestIdsSupport uiTestIdsSupport) |
void |
treeSourceItemSetChanged(TreeItems.ItemSetChangeEvent<E> event) |
void |
treeSourcePropertyValueChanged(TreeItems.ValueChangeEvent<E> event) |
void |
treeSourceSelectedItemChanged(TreeItems.SelectedItemChangeEvent<E> event) |
void |
treeSourceStateChanged(DataUnit.StateChangeEvent event) |
protected void |
updateCompositionStylesTopPanelVisible() |
protected void |
updateStyleGenerator() |
addAttachListener, addDetachListener, addStyleName, assignDebugId, attached, detached, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFrame, setFrame
getActionNN, getSubPart
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
getIcon, setIcon, setIconFromSet
isFocusable, setFocusable
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled
isDescriptionAsHtml, setDescriptionAsHtml
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
protected java.util.List<java.lang.String> internalStyles
protected java.util.List<java.util.function.Function<? super E,java.lang.String>> styleProviders
protected com.vaadin.ui.StyleGenerator<E> styleGenerator
protected TreeContextMenu<E> contextMenu
protected final java.util.List<AbstractDataGrid.ActionMenuItemWrapper> contextMenuItems
protected ButtonsPanel buttonsPanel
protected com.vaadin.ui.HorizontalLayout topPanel
protected TreeImpl.TreeComposition componentComposition
protected Action enterPressAction
protected java.util.function.Function<? super E,java.lang.String> iconProvider
protected io.jmix.core.Metadata metadata
protected io.jmix.core.AccessManager accessManager
protected IconResolver iconResolver
protected io.jmix.core.MetadataTools metadataTools
protected Actions actions
protected UiTestIdsSupport uiTestIdsSupport
protected Tree.SelectionMode selectionMode
protected Action doubleClickAction
protected com.vaadin.shared.Registration itemClickListener
protected final java.util.List<Action> actionList
protected final ShortcutsDelegate<com.vaadin.event.ShortcutListener> shortcutsDelegate
protected final ActionsPermissions actionsPermissions
protected boolean showIconsForPopupMenuActions
protected java.lang.String hierarchyProperty
protected TreeDataProvider<E> dataBinding
protected java.util.function.Function<? super E,java.lang.String> itemCaptionProvider
protected java.util.function.Function<? super E,java.lang.String> descriptionProvider
protected com.vaadin.shared.Registration expandListener
protected com.vaadin.shared.Registration collapseListener
protected ShortcutsDelegate<com.vaadin.event.ShortcutListener> createShortcutsDelegate()
public void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
protected void initComponentComposition(TreeImpl.TreeComposition composition)
protected TreeImpl.TreeComposition createComponentComposition()
protected ShortcutListenerDelegate createEnterShortcutListener()
protected java.lang.String generateItemCaption(E item)
protected void initContextMenu()
@Autowired public void setAccessManager(io.jmix.core.AccessManager accessManager)
@Autowired public void setIconResolver(IconResolver iconResolver)
@Autowired public void setMetadata(io.jmix.core.Metadata metadata)
@Autowired public void setMetadataTools(io.jmix.core.MetadataTools metadataTools)
@Autowired public void setThemeConstantsManager(ThemeConstantsManager themeConstantsManager)
@Autowired public void setActions(Actions actions)
@Autowired public void setUiTestIdsSupport(UiTestIdsSupport uiTestIdsSupport)
public void setItems(@Nullable TreeItems<E> treeItems)
Tree
DataUnit
supported by the Tree.public void setDebugId(@Nullable java.lang.String id)
HasDebugId
setDebugId
in interface HasDebugId
setDebugId
in class AbstractComponent<JmixTree<E>>
public void setId(@Nullable java.lang.String id)
Component
protected com.vaadin.data.provider.DataProvider<E,?> createEmptyDataProvider()
public java.lang.String getHierarchyProperty()
getHierarchyProperty
in interface Tree<E>
@Nullable public Action getItemClickAction()
getItemClickAction
in interface Tree<E>
public void setItemClickAction(@Nullable Action action)
Tree
setItemClickAction
in interface Tree<E>
action
- a new actionprotected void onItemClick(com.vaadin.ui.Tree.ItemClick<E> event)
public void setItemCaptionProvider(@Nullable java.util.function.Function<? super E,java.lang.String> itemCaptionProvider)
HasItemCaptionProvider
setItemCaptionProvider
in interface HasItemCaptionProvider<E>
itemCaptionProvider
- caption provider for item@Nullable public java.util.function.Function<? super E,java.lang.String> getItemCaptionProvider()
getItemCaptionProvider
in interface HasItemCaptionProvider<E>
protected void refreshActionsState()
protected TreeDataProvider<E> createDataGridDataProvider(TreeItems<E> treeItems)
public void addAction(Action action)
ActionsHolder
addAction
in interface ActionsHolder
public void addAction(Action action, int index)
ActionsHolder
addAction
in interface ActionsHolder
protected AbstractDataGrid.ActionMenuItemWrapper createContextMenuItem(Action action)
protected void attachAction(Action action)
public void removeAction(Action action)
ActionsHolder
removeAction
in interface ActionsHolder
public void removeAction(java.lang.String id)
ActionsHolder
removeAction
in interface ActionsHolder
public void removeAllActions()
ActionsHolder
removeAllActions
in interface ActionsHolder
public java.util.Collection<Action> getActions()
getActions
in interface ActionsHolder
@Nullable public Action getAction(java.lang.String id)
getAction
in interface ActionsHolder
public ActionsPermissions getActionsPermissions()
getActionsPermissions
in interface SecuredActionsHolder
public void treeSourceItemSetChanged(TreeItems.ItemSetChangeEvent<E> event)
treeSourceItemSetChanged
in interface TreeSourceEventsDelegate<E>
public void treeSourcePropertyValueChanged(TreeItems.ValueChangeEvent<E> event)
treeSourcePropertyValueChanged
in interface TreeSourceEventsDelegate<E>
public void treeSourceStateChanged(DataUnit.StateChangeEvent event)
treeSourceStateChanged
in interface TreeSourceEventsDelegate<E>
public void treeSourceSelectedItemChanged(TreeItems.SelectedItemChangeEvent<E> event)
treeSourceSelectedItemChanged
in interface TreeSourceEventsDelegate<E>
public void collapseTree()
Tree
collapseTree
in interface Tree<E>
public void expandTree()
Tree
expandTree
in interface Tree<E>
public void collapse(E item)
Tree
public void expand(E item)
Tree
public void expandUpTo(int level)
Tree
expandUpTo
in interface Tree<E>
level
- level of Tree nodes to expand, if passed level = 1 then root items will be expandedpublic boolean isExpanded(java.lang.Object itemId)
Tree
isExpanded
in interface Tree<E>
itemId
- item id to check@Nullable public java.lang.String getCaption()
getCaption
in interface Component.HasCaption
getCaption
in class AbstractComponent<JmixTree<E>>
public void setCaption(@Nullable java.lang.String caption)
Component.HasCaption
setCaption
in interface Component.HasCaption
setCaption
in class AbstractComponent<JmixTree<E>>
caption
- the new component's captionpublic boolean isCaptionAsHtml()
isCaptionAsHtml
in interface HasHtmlCaption
isCaptionAsHtml
in class AbstractComponent<JmixTree<E>>
true
if the caption is rendered as HTML,
false
if rendered as plain textpublic void setCaptionAsHtml(boolean captionAsHtml)
HasHtmlCaption
setCaptionAsHtml
in interface HasHtmlCaption
setCaptionAsHtml
in class AbstractComponent<JmixTree<E>>
captionAsHtml
- true
if the caption is rendered as HTML,
false
if rendered as plain textComponent.HasCaption.setCaption(String)
@Nullable public java.lang.String getDescription()
getDescription
in interface Component.HasDescription
getDescription
in class AbstractComponent<JmixTree<E>>
public void setDescription(@Nullable java.lang.String description)
Component.HasDescription
setDescription
in interface Component.HasDescription
setDescription
in class AbstractComponent<JmixTree<E>>
description
- the new description to setpublic java.util.Collection<Component> getInnerComponents()
getInnerComponents
in interface HasInnerComponents
@Nullable public ButtonsPanel getButtonsPanel()
getButtonsPanel
in interface HasButtonsPanel
public com.vaadin.ui.Component getComposition()
getComposition
in interface Component.Wrapper
getComposition
in class AbstractComponent<JmixTree<E>>
public void setButtonsPanel(@Nullable ButtonsPanel panel)
HasButtonsPanel
ButtonsPanel
component.setButtonsPanel
in interface HasButtonsPanel
panel
- a buttons panel componentprotected com.vaadin.ui.HorizontalLayout createTopPanel()
protected void updateCompositionStylesTopPanelVisible()
protected void handleClickAction()
public void setLookupSelectHandler(java.util.function.Consumer<java.util.Collection<E>> selectHandler)
setLookupSelectHandler
in interface LookupComponent<E>
selectHandler
- handler that should be executed when a user select an item in the lookup screenpublic java.util.Collection<E> getLookupSelectedItems()
getLookupSelectedItems
in interface LookupComponent<E>
public void setStyleName(@Nullable java.lang.String name)
Component
setStyleName
in interface Component
setStyleName
in class AbstractComponent<JmixTree<E>>
name
- one or more style names separated by space.public java.lang.String getStyleName()
Component
getStyleName
in interface Component
getStyleName
in class AbstractComponent<JmixTree<E>>
public void setStyleProvider(@Nullable java.util.function.Function<? super E,java.lang.String> styleProvider)
Tree
setStyleProvider
in interface Tree<E>
styleProvider
- a style provider to setpublic void addStyleProvider(java.util.function.Function<? super E,java.lang.String> styleProvider)
Tree
addStyleProvider
in interface Tree<E>
styleProvider
- a style provider to addpublic void removeStyleProvider(java.util.function.Function<? super E,java.lang.String> styleProvider)
Tree
removeStyleProvider
in interface Tree<E>
styleProvider
- a style provider to removeprotected void updateStyleGenerator()
@Nullable protected java.lang.String getGeneratedStyle(E item)
public void repaint()
Tree
public void setIconProvider(@Nullable java.util.function.Function<? super E,java.lang.String> iconProvider)
Tree
setIconProvider
in interface Tree<E>
iconProvider
- an icon provider to set@Nullable protected com.vaadin.server.Resource getItemIcon(@Nullable E item)
public void setEnterPressAction(@Nullable Action action)
Tree
setEnterPressAction
in interface Tree<E>
action
- a new action@Nullable public Action getEnterPressAction()
getEnterPressAction
in interface Tree<E>
public boolean isContextMenuEnabled()
isContextMenuEnabled
in interface Tree<E>
true
if context menu is enabled, false
otherwisepublic void setContextMenuEnabled(boolean contextMenuEnabled)
Tree
true
.setContextMenuEnabled
in interface Tree<E>
contextMenuEnabled
- specifies whether context menu is enabledpublic int getTabIndex()
Component.Focusable
HasTabIndex
component.getTabIndex
in interface Component.Focusable
HasTabIndex
componentpublic void setTabIndex(int tabIndex)
Component.Focusable
Focusable
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.setTabIndex
in interface Component.Focusable
tabIndex
- tab indexpublic Tree.SelectionMode getSelectionMode()
getSelectionMode
in interface Tree<E>
Tree.SelectionMode
public void setSelectionMode(Tree.SelectionMode selectionMode)
Tree
setSelectionMode
in interface Tree<E>
selectionMode
- the selection mode to usepublic void setRowHeight(double rowHeight)
Tree
setRowHeight
in interface Tree<E>
rowHeight
- The height of a row in pixels or -1 for automatic calculationpublic void setDescriptionProvider(@Nullable java.util.function.Function<? super E,java.lang.String> provider)
Tree
setDescriptionProvider
in interface Tree<E>
provider
- the description generator to use or null
to remove a
previously set provider if anypublic void setDescriptionProvider(@Nullable java.util.function.Function<? super E,java.lang.String> provider, ContentMode contentMode)
Tree
setDescriptionProvider
in interface Tree<E>
provider
- the description generator to use or null
to remove a
previously set provider if anycontentMode
- the content mode for row tooltips@Nullable protected java.lang.String getRowDescription(E item)
@Nullable public java.util.function.Function<E,java.lang.String> getDescriptionProvider()
Tree
getDescriptionProvider
in interface Tree<E>
public ContentMode getContentMode()
getContentMode
in interface Tree<E>
public void setContentMode(ContentMode contentMode)
Tree
setContentMode
in interface Tree<E>
contentMode
- the content mode@Nullable public java.util.function.Function<E,Component> getDetailsGenerator()
getDetailsGenerator
in interface Tree<E>
null
if not setpublic void setDetailsGenerator(@Nullable java.util.function.Function<E,Component> generator)
Tree
The currently opened item details will be re-rendered.
setDetailsGenerator
in interface Tree<E>
generator
- the details generator to set@Nullable protected com.vaadin.ui.Component getItemDetails(E entity)
public boolean isDetailsVisible(E entity)
Tree
isDetailsVisible
in interface Tree<E>
entity
- the item for which to check details visibilitytrue
if the details are visiblepublic void setDetailsVisible(E entity, boolean visible)
Tree
setDetailsVisible
in interface Tree<E>
entity
- the item for which to set details visibilityvisible
- true
to show the details, or false
to hide thempublic io.jmix.core.common.event.Subscription addExpandListener(java.util.function.Consumer<Tree.ExpandEvent<E>> listener)
Tree
addExpandListener
in interface Tree<E>
listener
- the listener to be addedprotected void onItemExpand(com.vaadin.event.ExpandEvent<E> e)
public io.jmix.core.common.event.Subscription addCollapseListener(java.util.function.Consumer<Tree.CollapseEvent<E>> listener)
Tree
addCollapseListener
in interface Tree<E>
listener
- the listener to be addedprotected void onItemCollapse(com.vaadin.event.CollapseEvent<E> e)
protected void onSelectionChange(com.vaadin.event.selection.SelectionEvent<E> event)
protected void fireSelectionEvent(com.vaadin.event.selection.SelectionEvent<E> e)
public boolean isMultiSelect()
isMultiSelect
in interface ListComponent<E>
@Nullable public E getSingleSelected()
ListComponent
null
. If multiple selection mode is enabled, returns the first selected instance.getSingleSelected
in interface ListComponent<E>
public java.util.Set<E> getSelected()
ListComponent
Collections.emptySet()
.getSelected
in interface ListComponent<E>
public void setSelected(@Nullable E item)
ListComponent
setSelected
in interface ListComponent<E>
item
- entity instance to select the row, null
to reset the selectionpublic void setSelected(java.util.Collection<E> items)
ListComponent
setSelected
in interface ListComponent<E>
items
- collection of entity instances to select rowsprotected void setSelectedInternal(java.util.Collection<E> items)
public io.jmix.core.common.event.Subscription addSelectionListener(java.util.function.Consumer<Tree.SelectionEvent<E>> listener)
Tree
addSelectionListener
in interface Tree<E>
listener
- the listener to registerpublic io.jmix.core.common.event.Subscription addLookupValueChangeListener(java.util.function.Consumer<LookupComponent.LookupSelectionChangeEvent<E>> listener)
LookupComponent.LookupSelectionChangeNotifier
addLookupValueChangeListener
in interface LookupComponent.LookupSelectionChangeNotifier<E>
listener
- a listener to addSubscription
public void focus()
Component.Focusable
focus
in interface Component.Focusable