Class UIMenuItem

    • Constructor Detail

      • UIMenuItem

        public UIMenuItem()
        Creates the component without a name. The name must be set in all cases using the setPropertyAtom call.
      • UIMenuItem

        public UIMenuItem​(Atom propertyAtom)
        Creates the component with the specified name. All system-reserved names for components begins with "$".
        Parameters:
        propertyAtom - the name of the component, unique within it's parent.
      • UIMenuItem

        public UIMenuItem​(Atom propertyAtom,
                          GProp<?>[] newValue)
                   throws PropException
        Creates the component with the specified name, initialized to contain the GProp items. All system-reserved names for components begins with "$".
        Parameters:
        propertyAtom - The name of the component, unique within it's parent.
        newValue - The array of all properties the component should have.
        Throws:
        PropException - when at least one of the properties to initialize the component with is invalid.
    • Method Detail

      • getDeviceType

        public final int getDeviceType()
        Gets the device type: -1=mobile, 0=both, 1=desktop.
        Specified by:
        getDeviceType in interface IUIComp
      • canRequestFocus

        public java.lang.String canRequestFocus()
        Returns if this component can receive focus. Focus capable components may override to return null for success, or other error message.
        Specified by:
        canRequestFocus in interface IPropCnr
        Overrides:
        canRequestFocus in class UIComp
        Returns:
        "Menu item not focusable" always.
      • couldRequestFocusIfVirtualized

        public java.lang.String couldRequestFocusIfVirtualized​(boolean ignoreStates)
        Returns if this component could receive focus if it would be virtualized. Focus capable components may override to return null for success, or other error message.
        Specified by:
        couldRequestFocusIfVirtualized in interface IPropCnr
        Parameters:
        ignoreStates - Flag indicating that states should be ignored, such as visible or enabled. If false, hidden or disabled components return an error message.
        Returns:
        "Menu item not focusable" always.
      • getApproximateSize

        public Size getApproximateSize()
        Returns the size of the component in pixels. The size is a calculation and does not exactly reflect the real size that may be different due to additional styles not taken into account by this method. The size is calculated from the font of the component and default or defined values (such as character length or number of lines for text area).
        Specified by:
        getApproximateSize in class UIComp
        Returns:
        The size of the component: 0x0 (none).