Interface ITreeToolBarBuilder<V,R,Y>

Type Parameters:
V - type of the tree elements
R - this builder
Y - builder returned by end
All Known Subinterfaces:
EmfTreePageBuilder.ToolBarBuilder<V,R>

public interface ITreeToolBarBuilder<V,R,Y>
Builder of the toolbar above a tree; the buttons go in the order of the calls. There is one button of each kind, and a second call replaces it in the same place; separator and customAction add a new item on every call.
Author:
Ionov Ivan
  • Method Details

    • defaultCreateElementAction

      R defaultCreateElementAction(Supplier<V> createNewElement)
      Adds a button that creates an element with createNewElement; the tree adds the element and selects it.
      Parameters:
      createNewElement - creates a new element
      Returns:
      this builder
    • customCreateElementAction

      R customCreateElementAction(Function<Tree<V>,V> customAction)
      Adds a button that calls customAction to create an element; the tree selects the element it returns.
      Parameters:
      customAction - gets the tree and returns the new element, or null
      Returns:
      this builder
    • defaultRemoveElementAction

      R defaultRemoveElementAction()
      Adds a button that removes the selected elements; the Delete key in the tree does the same.
      Returns:
      this builder
    • customRemoveElementAction

      R customRemoveElementAction(BiConsumer<Tree<V>,List<V>> customRemoveElementsAction)
      Adds a button that removes the selected elements with customRemoveElementsAction; the Delete key in the tree does the same.
      Parameters:
      customRemoveElementsAction - gets the tree and the selected elements
      Returns:
      this builder
    • defaultMoveUpElementAction

      R defaultMoveUpElementAction()
      Adds a button that moves the selected element one place up among the elements of the same parent.
      Returns:
      this builder
    • customMoveUpElementAction

      R customMoveUpElementAction(BiConsumer<Tree<V>,V> customMoveUpElementAction)
      Adds a button that moves the selected element up with customMoveUpElementAction.
      Parameters:
      customMoveUpElementAction - gets the tree and the selected element
      Returns:
      this builder
    • defaultMoveDownElementAction

      R defaultMoveDownElementAction()
      Adds a button that moves the selected element one place down among the elements of the same parent.
      Returns:
      this builder
    • customMoveDownElementAction

      R customMoveDownElementAction(BiConsumer<Tree<V>,V> customMoveDownElementAction)
      Adds a button that moves the selected element down with customMoveDownElementAction.
      Parameters:
      customMoveDownElementAction - gets the tree and the selected element
      Returns:
      this builder
    • defaultRefreshTreeAction

      R defaultRefreshTreeAction()
      Adds a button that refreshes the tree.
      Returns:
      this builder
    • customRefreshTreeAction

      R customRefreshTreeAction(Consumer<Tree<V>> customRefreshAction)
      Adds a button that refreshes the tree with customRefreshAction.
      Parameters:
      customRefreshAction - gets the tree
      Returns:
      this builder
    • expandAllAction

      R expandAllAction()
      Adds a button that expands all nodes of the tree.
      Returns:
      this builder
    • collapseAllAction

      R collapseAllAction()
      Adds a button that collapses all nodes of the tree.
      Returns:
      this builder
    • customAction

      R customAction(TreeCustomToolItemProperties<V> customToolItemProperties)
      Adds a custom button; its handler gets the tree and the selected elements.
      Parameters:
      customToolItemProperties - icon, text, tooltip and handler of the button
      Returns:
      this builder
    • separator

      R separator()
      Adds a separator after the buttons added before.
      Returns:
      this builder
    • showTextAndIcon

      R showTextAndIcon()
      Shows the text next to the icon on all buttons.
      Returns:
      this builder
    • end

      Y end()
      Ends the toolbar.
      Returns:
      the builder the toolbar was started from