Search in sources :

Example 1 with TextAreaSkin

use of com.sun.javafx.scene.control.skin.TextAreaSkin in project jabref by JabRef.

the class EditorTextArea method addToContextMenu.

/**
     * Adds the given list of menu items to the context menu.
     */
public void addToContextMenu(List<MenuItem> items) {
    TextAreaSkin customContextSkin = new TextAreaSkin(this) {

        @Override
        public void populateContextMenu(ContextMenu contextMenu) {
            super.populateContextMenu(contextMenu);
            contextMenu.getItems().addAll(0, items);
        }
    };
    setSkin(customContextSkin);
}
Also used : TextAreaSkin(com.sun.javafx.scene.control.skin.TextAreaSkin) ContextMenu(javafx.scene.control.ContextMenu)

Aggregations

TextAreaSkin (com.sun.javafx.scene.control.skin.TextAreaSkin)1 ContextMenu (javafx.scene.control.ContextMenu)1