com.sibvisions.rad.ui.web.impl.component
Class WebButton

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.component.AbstractWebActionComponent
              extended by com.sibvisions.rad.ui.web.impl.component.WebButton
All Implemented Interfaces:
IActionComponent, IButton, IIcon, ILabel, IAlignmentConstants, IComponent, IResource
Direct Known Subclasses:
WebToggleButton

public class WebButton
extends AbstractWebActionComponent
implements IButton

Web server implementation of IButton.


Field Summary
 
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
WebButton()
          Creates a new instance of WebButton.
 
Method Summary
 int getHorizontalTextPosition()
          Returns the horizontal position of the text relative to the icon.
 int getImageTextGap()
          Returns the amount of space between the text and the icon displayed in this button.
 WebImage getMouseOverImage()
          Gets the image for the button when the mouse is over.
 WebImage getPressedImage()
          Gets the image for the button when the button is pressed.
 int getVerticalTextPosition()
          Returns the vertical position of the text relative to the icon.
 boolean isBorderOnMouseEntered()
          Gets, if the border should only be shown on mouse entered.
 boolean isBorderPainted()
          Gets whether the border will be painted.
 boolean isDefaultButton()
          Gets the value of the defaultButton property, which if true means that this button is the current default button.
 void setBorderOnMouseEntered(boolean pBorderOnMouseEntered)
          Sets, if the border should only be shown on mouse entered.
 void setBorderPainted(boolean pBorderPainted)
          Sets whether the border will be painted.
 void setDefaultButton(boolean pDefaultButton)
          Sets the defaultButton property.
 void setHorizontalTextPosition(int pHorizontalTextPosition)
          Sets the horizontal position of the text relative to the icon.
 void setImageTextGap(int pImageTextGap)
          If both the icon and text properties are set, this property defines the space between them.
 void setMouseOverImage(IImage pMouseOverImage)
          Sets the image for the button when the mouse is over.
 void setPressedImage(IImage pMousePressedImage)
          Sets the image for the button when the button is pressed.
 void setVerticalTextPosition(int pVerticalTextPosition)
          Sets the vertical position of the text relative to the icon.
 
Methods inherited from class com.sibvisions.rad.ui.web.impl.component.AbstractWebActionComponent
eventAction, getAccelerator, getActionCommand, getImage, getMargins, getText, setAccelerator, setActionCommand, setImage, setMargins, setText
 
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.component.IActionComponent
eventAction, getAccelerator, getActionCommand, getMargins, setAccelerator, setActionCommand, setMargins
 
Methods inherited from interface javax.rad.ui.component.IIcon
getImage, setImage
 
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.component.ILabel
getText, setText
 
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
 

Constructor Detail

WebButton

public WebButton()
Creates a new instance of WebButton.

See Also:
IButton
Method Detail

getImageTextGap

public int getImageTextGap()
Returns the amount of space between the text and the icon displayed in this button.

Specified by:
getImageTextGap in interface IButton
Returns:
an int equal to the number of pixels between the text and the icon.
See Also:
IButton.setImageTextGap(int)

setImageTextGap

public void setImageTextGap(int pImageTextGap)
If both the icon and text properties are set, this property defines the space between them.

The default value of this property is 4 pixels.

This is a JavaBeans bound property.

Specified by:
setImageTextGap in interface IButton
Parameters:
pImageTextGap - the image gap
See Also:
IButton.getImageTextGap()

getVerticalTextPosition

public int getVerticalTextPosition()
Returns the vertical position of the text relative to the icon.

Specified by:
getVerticalTextPosition in interface IButton
Returns:
one of the following values:
  • IAlignmentConstants.CENTER
  • IAlignmentConstants.TOP
  • IAlignmentConstants.BOTTOM

setVerticalTextPosition

public void setVerticalTextPosition(int pVerticalTextPosition)
Sets the vertical position of the text relative to the icon.

Specified by:
setVerticalTextPosition in interface IButton
Parameters:
pVerticalTextPosition - one of the following values:
  • IAlignmentConstants.CENTER
  • IAlignmentConstants.TOP
  • IAlignmentConstants.BOTTOM

getHorizontalTextPosition

public int getHorizontalTextPosition()
Returns the horizontal position of the text relative to the icon.

Specified by:
getHorizontalTextPosition in interface IButton
Returns:
one of the following values:
  • IAlignmentConstants.CENTER
  • IAlignmentConstants.LEFT
  • IAlignmentConstants.RIGHT

setHorizontalTextPosition

public void setHorizontalTextPosition(int pHorizontalTextPosition)
Sets the horizontal position of the text relative to the icon.

Specified by:
setHorizontalTextPosition in interface IButton
Parameters:
pHorizontalTextPosition - one of the following values:
  • IAlignmentConstants.CENTER
  • IAlignmentConstants.LEFT
  • IAlignmentConstants.RIGHT

isBorderOnMouseEntered

public boolean isBorderOnMouseEntered()
Gets, if the border should only be shown on mouse entered.

Specified by:
isBorderOnMouseEntered in interface IButton
Returns:
true, if the border should only be shown on mouse entered.

setBorderOnMouseEntered

public void setBorderOnMouseEntered(boolean pBorderOnMouseEntered)
Sets, if the border should only be shown on mouse entered.

Specified by:
setBorderOnMouseEntered in interface IButton
Parameters:
pBorderOnMouseEntered - true, if the border should only be shown on mouse entered.

isBorderPainted

public boolean isBorderPainted()
Gets whether the border will be painted.

Specified by:
isBorderPainted in interface IButton
Returns:
true when the border will be painted, otherwise false

setBorderPainted

public void setBorderPainted(boolean pBorderPainted)
Sets whether the border will be painted. If true, the border will be painted. The default value is that the border will be painted.

Specified by:
setBorderPainted in interface IButton
Parameters:
pBorderPainted - true to paint the border, otherwise false

getMouseOverImage

public WebImage getMouseOverImage()
Gets the image for the button when the mouse is over.

Specified by:
getMouseOverImage in interface IButton
Returns:
the mouse over image

setMouseOverImage

public void setMouseOverImage(IImage pMouseOverImage)
Sets the image for the button when the mouse is over.

Specified by:
setMouseOverImage in interface IButton
Parameters:
pMouseOverImage - the mouse over image

getPressedImage

public WebImage getPressedImage()
Gets the image for the button when the button is pressed.

Specified by:
getPressedImage in interface IButton
Returns:
the mouse pressed image

setPressedImage

public void setPressedImage(IImage pMousePressedImage)
Sets the image for the button when the button is pressed.

Specified by:
setPressedImage in interface IButton
Parameters:
pMousePressedImage - the mouse pressed image

isDefaultButton

public boolean isDefaultButton()
Gets the value of the defaultButton property, which if true means that this button is the current default button.

Specified by:
isDefaultButton in interface IButton
Returns:
true if this button is defined as default button, otherwise false
See Also:
IButton.setDefaultButton(boolean)

setDefaultButton

public void setDefaultButton(boolean pDefaultButton)
Sets the defaultButton property. The default button is the button which will be activated when a UI-defined activation event (typically the Enter key) occurs, regardless of whether or not the button has keyboard focus (unless there is another component within which consumes the activation event) For default activation to work, the button must be enabled.

Specified by:
setDefaultButton in interface IButton
Parameters:
pDefaultButton - true to set this button as default button, otherwise false
See Also:
IButton.isDefaultButton()


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.