javax.rad.genui.component
Class AbstractUIActionComponent<C extends IActionComponent>

java.lang.Object
  extended by javax.rad.genui.UIResource<C>
      extended by javax.rad.genui.UIComponent<C>
          extended by javax.rad.genui.component.AbstractUILabeledIcon<C>
              extended by javax.rad.genui.component.AbstractUIActionComponent<C>
Type Parameters:
C - instance of IActionComponent
All Implemented Interfaces:
ITranslatable, IActionComponent, IIcon, ILabel, ILabeledIcon, IAlignmentConstants, IComponent, IResource, INamedObject, ITranslator
Direct Known Subclasses:
AbstractUIButton, AbstractUIMenuItem

public abstract class AbstractUIActionComponent<C extends IActionComponent>
extends AbstractUILabeledIcon<C>
implements IActionComponent

Platform and technology independent action component. It is designed for use with AWT, Swing, SWT, JSP, JSF, ... .


Field Summary
 
Fields inherited from class javax.rad.genui.UIComponent
bTranslate, lLastTranslationModified, parent, popupMenu
 
Fields inherited from class javax.rad.genui.UIResource
uiResource
 
Fields inherited from interface javax.rad.ui.IAlignmentConstants
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_STRETCH, ALIGN_TOP
 
Constructor Summary
protected AbstractUIActionComponent(C pActionComponent)
          Creates a new instance of AbstractUIActionComponent.
 
Method Summary
protected  String createComponentName()
          Creates a name for this UIComponent.
 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.
 IInsets getMargins()
          Returns the margin between the component's border and the text.
 void setAccelerator(Key pKey)
          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 setMargins(IInsets pMargins)
          Sets space for margin between the button's border and the text.
 void setMargins(int pTop, int pLeft, int pBottom, int pRight)
          Sets the insets with primitive types.
 
Methods inherited from class javax.rad.genui.component.AbstractUILabeledIcon
getHorizontalAlignment, getImage, getText, getVerticalAlignment, isPreserveAspectRatio, setHorizontalAlignment, setImage, setPreserveAspectRatio, setText, setVerticalAlignment, updateTranslation
 
Methods inherited from class javax.rad.genui.UIComponent
addNotify, beforeAddNotify, capture, createComponentNamePrefix, createSimplifiedClassName, debug, doEventKey, doTriggerPopMenu, equals, error, eventComponentMoved, eventComponentResized, eventFocusGained, eventFocusLost, eventKey, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getComponentUIResource, getCurrentTranslation, getCursor, getDefaultName, getEventSource, getExistingNames, getFactory, getFont, getForeground, getLocation, getLocationOffset, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPopupMenu, getPreferredSize, getResource, getRootName, getSize, getStyle, getTabIndex, getToolTipText, getTranslation, getUIComponent, hashCode, incrementNameIfExists, info, invokeAndWait, invokeAndWait, invokeInThread, invokeInThread, invokeLater, invokeLater, isBackgroundSet, isBeforeNotified, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isNotified, isPreferredSizeSet, isTranslationChanged, isTranslationEnabled, isVisible, removeNotify, requestFocus, setBackground, setBounds, setBounds, setCursor, setDefaultName, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocation, setLocationRelativeTo, setMaximumSize, setMaximumSize, setMinimumSize, setMinimumSize, setName, setParent, setPopupMenu, setPreferredSize, setPreferredSize, setRootName, setSize, setSize, setStyle, setTabIndex, setToolTipText, setTranslation, setTranslationEnabled, setUIComponent, setVisible, translate
 
Methods inherited from class javax.rad.genui.UIResource
eventResourceChanged, eventResourceChanged, fireResourceChanged, getObject, getObjectNames, getUIResource, hasResourceHandler, putObject, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.rad.ui.component.IIcon
getImage, isPreserveAspectRatio, setImage, setPreserveAspectRatio
 
Methods inherited from interface javax.rad.ui.component.ILabel
getText, setText
 
Methods inherited from interface javax.rad.ui.IComponent
capture, eventComponentMoved, eventComponentResized, eventFocusGained, eventFocusLost, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getCursor, getEventSource, getFactory, getFont, getForeground, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getStyle, getTabIndex, getToolTipText, isBackgroundSet, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isVisible, requestFocus, setBackground, setBounds, setCursor, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocationRelativeTo, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setSize, setStyle, setTabIndex, 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

AbstractUIActionComponent

protected AbstractUIActionComponent(C pActionComponent)
Creates a new instance of AbstractUIActionComponent.

Parameters:
pActionComponent - the IActionComponent.
See Also:
IActionComponent
Method Detail

setAccelerator

public void setAccelerator(Key pKey)
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()
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

getActionCommand

public String getActionCommand()
Returns the command name of the action event fired by this action component.

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.

Specified by:
setActionCommand in interface IActionComponent
Parameters:
pActionCommand - a string used to set the action command.
See Also:
ActionEvent

eventAction

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

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

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)

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

createComponentName

protected String createComponentName()
Creates a name for this UIComponent. The returned name needs to be unique in the current root/workscreen and is ideally, but not necessarily, prefixed with the UIComponent.sRootName, if there is any. Overriding classes should be aware that this method will be called in UIComponent.addNotify() and the returned name will only be assigned to the UIComponent if there isn't already a name set. Also UIComponent.stExistingNames can be used to find out if a name has already been assigned, and UIComponent.sRootName to get the root name. In rare cases UIComponent.stExistingNames and/or UIComponent.sRootName might be null when this method is called.

Overrides:
createComponentName in class UIComponent<C extends IActionComponent>
Returns:
a unique name for this UIComponent.
See Also:
UIComponent.createSimplifiedClassName(), UIComponent.getExistingNames(), UIComponent.getRootName(), UIComponent.incrementNameIfExists(String, Set, boolean)

setMargins

public void setMargins(int pTop,
                       int pLeft,
                       int pBottom,
                       int pRight)
Sets the insets with primitive types.

Parameters:
pTop - the top insets.
pLeft - the left insets.
pBottom - the bottom insets.
pRight - the right insets.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.