com.sibvisions.rad.ui.qt.impl.menu
Class QtMenu

java.lang.Object
  extended by com.sibvisions.rad.ui.qt.impl.QtResource<C>
      extended by com.sibvisions.rad.ui.qt.impl.QtComponentBase<C>
          extended by com.sibvisions.rad.ui.qt.impl.QtComponent<C>
              extended by com.sibvisions.rad.ui.qt.impl.QtContainer<QMenu>
                  extended by com.sibvisions.rad.ui.qt.impl.menu.QtMenu
All Implemented Interfaces:
IActionComponent, IIcon, ILabel, IAlignmentConstants, IComponent, IContainer, IResource, IMenu, IMenuItem
Direct Known Subclasses:
QtPopupMenu

public class QtMenu
extends QtContainer<QMenu>
implements IMenu

The QtMenu is the IMenu implementation for QT.

See Also:
QMenu, IMenu

Field Summary
protected  IImage image
          the image.
 
Fields inherited from class com.sibvisions.rad.ui.qt.impl.QtComponent
parent
 
Fields inherited from class com.sibvisions.rad.ui.qt.impl.QtComponentBase
factory
 
Fields inherited from class com.sibvisions.rad.ui.qt.impl.QtResource
resource
 
Fields inherited from interface javax.rad.ui.IAlignmentConstants
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_STRETCH, ALIGN_TOP
 
Fields inherited from interface javax.rad.ui.IAlignmentConstants
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_STRETCH, ALIGN_TOP
 
Constructor Summary
QtMenu()
          Creates a new instance of QtMenu.
 
Method Summary
protected  void addIntern(IComponent pComponent, Object pConstraints, int pIndex)
          Internal function, for adding physical component and supporting layers.
 void addSeparator()
          Appends a new separator at the end of the menu.
 void addSeparator(int pIndex)
          Inserts a separator at the specified position.
 ActionHandler eventAction()
          Not supported.
 Key getAccelerator()
          Not supported.
 String getActionCommand()
          Returns the command name of the action event fired by this action component.
 IImage getImage()
          Returns the default image.
 IInsets getMargins()
          Returns the margin between the component's border and the text.
 String getText()
          Returns the text string that the label displays.
protected  void removeIntern(IComponent pComponent)
          Internal function, for adding physical component and supporting layers.
 void setAccelerator(Key pKey)
          Not supported.
 void setActionCommand(String pActionCommand)
          Sets the command name for the action event fired by this action component.
 void setImage(IImage pImage)
          Sets the default image.
 void setMargins(IInsets pInsets)
          Sets space for margin between the button's border and the text.
protected  void setResourceVisible(boolean pVisible)
          Sets the visibility of the internal resource.
 void setText(String pText)
          Defines the single line of text this component will display.
 
Methods inherited from class com.sibvisions.rad.ui.qt.impl.QtContainer
add, add, add, add, checkAdd, getComponent, getComponentCount, getLayout, indexOf, remove, remove, removeAll, setLayout, setLayoutIntern
 
Methods inherited from class com.sibvisions.rad.ui.qt.impl.QtComponent
addStyle, capture, getBackground, getBounds, getCursor, getFont, getForeground, getHorizontalAlignment, getLocation, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getStyleSheet, getToolTipText, getVerticalAlignment, isBackgroundSet, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, requestFocus, setBackground, setBounds, setCursor, setEnabled, setFocusable, setFont, setForeground, setHorizontalAlignment, setLocation, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setSize, setToolTipText, setVerticalAlignment
 
Methods inherited from class com.sibvisions.rad.ui.qt.impl.QtComponentBase
eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getFactory, isVisible, setFactory, setVisible
 
Methods inherited from class com.sibvisions.rad.ui.qt.impl.QtResource
equals, getResource, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.rad.ui.IComponent
capture, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getCursor, getFactory, getFont, getForeground, getLocation, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getToolTipText, isBackgroundSet, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isVisible, requestFocus, setBackground, setBounds, setCursor, setEnabled, setFocusable, setFont, setForeground, setLocation, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setSize, setToolTipText, setVisible
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 
Methods inherited from interface javax.rad.ui.IAlignmentConstants
getHorizontalAlignment, getVerticalAlignment, setHorizontalAlignment, setVerticalAlignment
 
Methods inherited from interface javax.rad.ui.IComponent
capture, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getCursor, getFactory, getFont, getForeground, getLocation, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getToolTipText, isBackgroundSet, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isVisible, requestFocus, setBackground, setBounds, setCursor, setEnabled, setFocusable, setFont, setForeground, setLocation, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setSize, setToolTipText, setVisible
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 
Methods inherited from interface javax.rad.ui.IAlignmentConstants
getHorizontalAlignment, getVerticalAlignment, setHorizontalAlignment, setVerticalAlignment
 
Methods inherited from interface javax.rad.ui.IContainer
add, add, add, add, getComponent, getComponentCount, getLayout, indexOf, remove, remove, removeAll, setLayout
 

Field Detail

image

protected IImage image
the image.

Constructor Detail

QtMenu

public QtMenu()
Creates a new instance of QtMenu.

Method Detail

addSeparator

public void addSeparator()
Appends a new separator at the end of the menu.

Specified by:
addSeparator in interface IMenu

addSeparator

public void addSeparator(int pIndex)
Inserts a separator at the specified position.

Specified by:
addSeparator in interface IMenu
Parameters:
pIndex - an integer specifying the position at which to insert the menu separator

setAccelerator

public void setAccelerator(Key pKey)
Not supported.

Sets the key combination which invokes the component's action listeners without selecting. It is the UI's responsibility to install the correct action.

Specified by:
setAccelerator in interface IActionComponent
Parameters:
pKey - the Key which will serve as an accelerator

getAccelerator

public Key getAccelerator()
Not supported.

Specified by:
getAccelerator in interface IActionComponent
Returns:
null
See Also:
IActionComponent.getAccelerator()

eventAction

public ActionHandler eventAction()
Not supported.

The EventHandler for the action event.

Specified by:
eventAction in interface IActionComponent
Returns:
the EventHandler for the action event.

setActionCommand

public void setActionCommand(String pActionCommand)
Sets the command name for the action event fired by this action component. By default this action command is set to match the label of the button.

Specified by:
setActionCommand in interface IActionComponent
Parameters:
pActionCommand - a string used to set the action command. If the string is null then the action command is set to match the text of the action component.
See Also:
ActionEvent

getActionCommand

public String getActionCommand()
Returns the command name of the action event fired by this action component. If the command name is null (default) then this method returns the label of the button.

Specified by:
getActionCommand in interface IActionComponent
Returns:
the action command.

setImage

public void setImage(IImage pImage)
Sets the default image.

Specified by:
setImage in interface IIcon
Parameters:
pImage - the image
See Also:
IIcon.getImage()

getImage

public IImage getImage()
Returns the default image.

Specified by:
getImage in interface IIcon
Returns:
the default image
See Also:
IIcon.setImage(IImage)

setText

public void setText(String pText)
Defines the single line of text this component will display. If the value of text is null or empty string, nothing is displayed.

Specified by:
setText in interface ILabel
Parameters:
pText - the text

getText

public String getText()
Returns the text string that the label displays.

Specified by:
getText in interface ILabel
Returns:
a String
See Also:
ILabel.setText(java.lang.String)

setMargins

public void setMargins(IInsets pInsets)
Sets space for margin between the button's border and the text. Setting to null will cause the action component to use the default margin.

Specified by:
setMargins in interface IActionComponent
Parameters:
pInsets - the space between the border and the test

getMargins

public IInsets getMargins()
Returns the margin between the component's border and the text.

Specified by:
getMargins in interface IActionComponent
Returns:
an IInsets object specifying the margin between the component's border and the text
See Also:
IActionComponent.setMargins(IInsets)

setResourceVisible

protected void setResourceVisible(boolean pVisible)
Sets the visibility of the internal resource.

Overrides:
setResourceVisible in class QtComponent<QMenu>
Parameters:
pVisible - true to set visible, otherwise false

addIntern

protected void addIntern(IComponent pComponent,
                         Object pConstraints,
                         int pIndex)
Internal function, for adding physical component and supporting layers.

Overrides:
addIntern in class QtContainer<QMenu>
Parameters:
pComponent - the Component to be added
pConstraints - an object expressing layout contraints for this
pIndex - the position in the container's list at which to insert the Component; -1 means insert at the end component
See Also:
QtContainer.add(IComponent, Object, int)

removeIntern

protected void removeIntern(IComponent pComponent)
Internal function, for adding physical component and supporting layers.

Overrides:
removeIntern in class QtContainer<QMenu>
Parameters:
pComponent - the Component to be removed
See Also:
QtContainer.remove(int)


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.