com.sibvisions.rad.ui.web.impl.menu
Class WebMenu

java.lang.Object
  extended by com.sibvisions.rad.ui.web.impl.WebResource
      extended by com.sibvisions.rad.ui.web.impl.WebComponent
          extended by com.sibvisions.rad.ui.web.impl.WebContainer
              extended by com.sibvisions.rad.ui.web.impl.menu.WebMenu
All Implemented Interfaces:
IActionComponent, IIcon, ILabel, IAlignmentConstants, IComponent, IContainer, IResource, IMenu, IMenuItem

public class WebMenu
extends WebContainer
implements IMenu

Web server implementation of IMenu.


Field Summary
 
Fields inherited from class com.sibvisions.rad.ui.web.impl.WebContainer
components
 
Fields inherited from class com.sibvisions.rad.ui.web.impl.WebComponent
componentId
 
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
WebMenu()
          Creates a new instance of WebMenu.
 
Method Summary
 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()
          The EventHandler for the action event.
 Key getAccelerator()
          Returns the Key which serves as an accelerator for the button.
 String getActionCommand()
          Returns the command name of the action event fired by this action component.
 WebImage getImage()
          Returns the default image.
 WebInsets getMargins()
          Returns the margin between the component's border and the text.
 String getText()
          Returns the text string that the label displays.
 void setAccelerator(Key pAccelerator)
          Sets the key combination which invokes the component's action listeners without selecting.
 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 pMargins)
          Sets space for margin between the button's border and the text.
 void setText(String pText)
          Defines the single line of text this component will display.
 
Methods inherited from class com.sibvisions.rad.ui.web.impl.WebContainer
add, add, add, add, getComponent, getComponentCount, getLayout, indexOf, remove, remove, removeAll, setLayout
 
Methods inherited from class com.sibvisions.rad.ui.web.impl.WebComponent
capture, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, finalize, getAsString, getBackground, getBounds, getChangedProperties, getComponentId, getComponentName, getConstraints, getCursor, getFactory, getFont, getForeground, getHorizontalAlignment, getLocation, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getProperty, getSize, getToolTipText, getVerticalAlignment, isBackgroundSet, isChanged, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isVisible, requestFocus, setBackground, setBounds, setComponentId, setConstraints, setCursor, setEnabled, setFactory, setFocusable, setFont, setForeground, setHorizontalAlignment, setLocation, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setProperty, setProperty, setSize, setToolTipText, setVerticalAlignment, setVisible
 
Methods inherited from class com.sibvisions.rad.ui.web.impl.WebResource
getNullableAsString, getResource, setAsString, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, 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
 

Constructor Detail

WebMenu

public WebMenu()
Creates a new instance of WebMenu.

See Also:
IMenu
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

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)

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

getImage

public WebImage getImage()
Returns the default image.

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

setImage

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

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

getAccelerator

public Key getAccelerator()
Returns the Key which serves as an accelerator for the button.

Specified by:
getAccelerator in interface IActionComponent
Returns:
a Key object identifying the accelerator key

setAccelerator

public void setAccelerator(Key pAccelerator)
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:
pAccelerator - the Key which will serve as an accelerator

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.

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

getMargins

public WebInsets 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)

setMargins

public void setMargins(IInsets pMargins)
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:
pMargins - the space between the border and the test

eventAction

public ActionHandler eventAction()
The EventHandler for the action event.

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


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.