Class ContextMenuContent

java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
com.sun.javafx.scene.control.ContextMenuContent
All Implemented Interfaces:
LayoutMeasurable, LayoutMeasurableMixin, HasBackgroundProperty, HasBlendModeProperty, HasBorderProperty, HasClipProperty, HasEffectProperty, HasHeightProperty, HasLayoutXProperty, HasLayoutYProperty, HasManagedProperty, HasMaxHeightProperty, HasMaxWidthProperty, HasMinHeightProperty, HasMinWidthProperty, HasMouseTransparentProperty, HasOnMouseClickedProperty, HasOpacityProperty, HasPaddingProperty, HasParentProperty, HasPrefHeightProperty, HasPrefWidthProperty, HasSnapToPixelProperty, HasVisibleProperty, HasWidthProperty, Styleable, EventTarget, INode, PreferenceResizableNode

public class ContextMenuContent extends Region
This is a the SkinBase for ContextMenu based controls so that the CSS parts work right, because otherwise we would have to copy the Keys from there to here.
  • Constructor Details

    • ContextMenuContent

      public ContextMenuContent(ContextMenu popupMenu)
      Constructors
  • Method Details

    • dispose

      public void dispose()
      Can be called by Skins when they need to clean up the content of any ContextMenu instances they might have created. This ensures that contents of submenus if any, also get cleaned up.
    • disposeContextMenu

      public void disposeContextMenu(ContextMenu menu)
    • layoutChildren

      protected void layoutChildren()
      Description copied from class: Parent
      Invoked during the layout pass to layout the children in this Parent. By default it will only set the size of managed, resizable content to their preferred sizes and does not do any node positioning.

      Subclasses should override this function to layout content as needed.

      Overrides:
      layoutChildren in class Parent
    • computePrefWidth

      protected double computePrefWidth(double height)
      Description copied from class: Region
      Computes the preferred width of this region for the given height. Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a VERTICAL content bias, then the height parameter can be ignored.
      Overrides:
      computePrefWidth in class Region
      Parameters:
      height - the height that should be used if preferred width depends on it
      Returns:
      the computed preferred width for this region
    • computePrefHeight

      protected double computePrefHeight(double width)
      Description copied from class: Region
      Computes the preferred height of this region for the given width; Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.
      Overrides:
      computePrefHeight in class Region
      Parameters:
      width - the width that should be used if preferred height depends on it
      Returns:
      the computed preferred height for this region
    • computeMinHeight

      protected double computeMinHeight(double width)
      Description copied from class: Region
      Computes the minimum height of this region. Returns the sum of the top and bottom insets by default. Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.
      Overrides:
      computeMinHeight in class Region
      Parameters:
      width - the width that should be used if min height depends on it
      Returns:
      the computed minimum height for this region
    • computeMaxHeight

      protected double computeMaxHeight(double height)
      Description copied from class: Region
      Computes the maximum height of this region. Returns Double.MAX_VALUE by default. Region subclasses may override this method to return a different value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.
      Overrides:
      computeMaxHeight in class Region
      Returns:
      the computed maximum height for this region
    • getItems

      protected ObservableList<MenuItem> getItems()
    • requestFocusOnIndex

      public void requestFocusOnIndex(int index)
    • getMenuYOffset

      public double getMenuYOffset(int menuIndex)
    • getLabelAt

      public Label getLabelAt(int index)