modules/controls/src/main/java/javafx/scene/control/MenuItem.java

Print this page
rev 9240 : 8076423: JEP 253: Prepare JavaFX UI Controls & CSS APIs for Modularization


  32 import javafx.css.CssMetaData;
  33 import javafx.beans.property.BooleanProperty;
  34 import javafx.beans.property.ObjectProperty;
  35 import javafx.beans.property.ObjectPropertyBase;
  36 import javafx.beans.property.SimpleBooleanProperty;
  37 import javafx.beans.property.SimpleObjectProperty;
  38 import javafx.beans.property.SimpleStringProperty;
  39 import javafx.beans.property.StringProperty;
  40 import javafx.collections.FXCollections;
  41 import javafx.collections.ObservableList;
  42 import javafx.event.ActionEvent;
  43 import javafx.event.Event;
  44 import javafx.event.EventDispatchChain;
  45 import javafx.event.EventHandler;
  46 import javafx.event.EventTarget;
  47 import javafx.event.EventType;
  48 import javafx.scene.Node;
  49 import javafx.scene.input.KeyCombination;
  50 
  51 import com.sun.javafx.event.EventHandlerManager;
  52 import com.sun.javafx.scene.control.skin.ContextMenuContent;
  53 import com.sun.javafx.scene.control.skin.ContextMenuSkin;
  54 import java.util.Collections;
  55 import java.util.HashMap;
  56 import java.util.List;
  57 
  58 import javafx.beans.property.ReadOnlyObjectProperty;
  59 import javafx.beans.property.ReadOnlyObjectWrapper;
  60 import javafx.collections.ObservableMap;
  61 import javafx.scene.Parent;
  62 
  63 /**
  64  * <p>
  65  * MenuItem is intended to be used in conjunction with {@link Menu} to provide
  66  * options to users. MenuItem serves as the base class for the bulk of JavaFX menus
  67  * API.
  68  * It has a display {@link #getText() text} property, as well as an optional {@link #getGraphic() graphic} node
  69  * that can be set on it. 
  70  * The {@link #getAccelerator() accelerator} property enables accessing the
  71  * associated action in one keystroke. Also, as with the {@link Button} control,
  72  * by using the {@link #setOnAction} method, you can have an instance of MenuItem
  73  * perform any action you wish.




  32 import javafx.css.CssMetaData;
  33 import javafx.beans.property.BooleanProperty;
  34 import javafx.beans.property.ObjectProperty;
  35 import javafx.beans.property.ObjectPropertyBase;
  36 import javafx.beans.property.SimpleBooleanProperty;
  37 import javafx.beans.property.SimpleObjectProperty;
  38 import javafx.beans.property.SimpleStringProperty;
  39 import javafx.beans.property.StringProperty;
  40 import javafx.collections.FXCollections;
  41 import javafx.collections.ObservableList;
  42 import javafx.event.ActionEvent;
  43 import javafx.event.Event;
  44 import javafx.event.EventDispatchChain;
  45 import javafx.event.EventHandler;
  46 import javafx.event.EventTarget;
  47 import javafx.event.EventType;
  48 import javafx.scene.Node;
  49 import javafx.scene.input.KeyCombination;
  50 
  51 import com.sun.javafx.event.EventHandlerManager;
  52 import com.sun.javafx.scene.control.ContextMenuContent;
  53 import javafx.scene.control.skin.ContextMenuSkin;
  54 import java.util.Collections;
  55 import java.util.HashMap;
  56 import java.util.List;
  57 
  58 import javafx.beans.property.ReadOnlyObjectProperty;
  59 import javafx.beans.property.ReadOnlyObjectWrapper;
  60 import javafx.collections.ObservableMap;
  61 import javafx.scene.Parent;
  62 
  63 /**
  64  * <p>
  65  * MenuItem is intended to be used in conjunction with {@link Menu} to provide
  66  * options to users. MenuItem serves as the base class for the bulk of JavaFX menus
  67  * API.
  68  * It has a display {@link #getText() text} property, as well as an optional {@link #getGraphic() graphic} node
  69  * that can be set on it. 
  70  * The {@link #getAccelerator() accelerator} property enables accessing the
  71  * associated action in one keystroke. Also, as with the {@link Button} control,
  72  * by using the {@link #setOnAction} method, you can have an instance of MenuItem
  73  * perform any action you wish.