org.kalmeo.kuix.widget
Class FocusableWidget

java.lang.Object
  extended by org.kalmeo.kuix.widget.Widget
      extended by org.kalmeo.kuix.widget.FocusableWidget
Direct Known Subclasses:
ActionWidget, Gauge, TextWidget

public class FocusableWidget
extends Widget

This class is base for all focusable widgets.

For further informations, visit the Kuix widgets reference page.

Author:
bbeaulant

Nested Class Summary
 
Nested classes/interfaces inherited from class org.kalmeo.kuix.widget.Widget
Widget.BindInstruction
 
Field Summary
static java.lang.String DISABLED_PSEUDO_CLASS
           
protected  boolean enabled
           
protected  boolean focusable
           
protected  boolean focused
           
static java.lang.String HOVER_PSEUDO_CLASS
           
protected static java.lang.String[] PSEUDO_CLASSES
           
 
Fields inherited from class org.kalmeo.kuix.widget.Widget
bindInstructions, DEFAULT_ALIGN, DEFAULT_BACKGROUND_ALIGN, DEFAULT_BACKGROUND_REPEAT, DEFAULT_BORDER, DEFAULT_GAP, DEFAULT_MARGIN, DEFAULT_MIN_SIZE, DEFAULT_PADDING, DEFAULT_SPAN, DEFAULT_WEIGHT, next, parent, previous
 
Constructor Summary
FocusableWidget()
          Construct a FocusableWidget
FocusableWidget(java.lang.String tag)
          Construct a FocusableWidget
 
Method Summary
 java.lang.Object getAttribute(java.lang.String name)
          Returns the value of the specified attribute
 java.lang.String[] getAvailablePseudoClasses()
          Retuns the list of available pseudo classes.
 java.lang.String getOnFocus()
           
 java.lang.String getOnLostFocus()
           
 void giveFocusToNearestWidget()
          Give the focus to the nearest focusable widget.
 boolean isEnabled()
           
 boolean isFocusable()
          Check if this Widget is focusable.
 boolean isFocused()
          Check if this Widget is focused.
 boolean isPseudoClassCompatible(java.lang.String pseudoClass)
           
protected  void onAdded(Widget parent)
          Event called when the widjet is added to parent.
 boolean processFocusEvent(byte type)
          Process a focus event
 boolean processPointerEvent(byte type, int x, int y)
          Process a pointer event
 void remove()
          Remove the current Widget from its parent.
 void requestFocus()
          Requests the focus of this Widget.
 boolean setAttribute(java.lang.String name, java.lang.String value)
          Set the value to the specified attribute representing by the name
 void setEnabled(boolean enabled)
           
 void setFocusable(boolean focusable)
           
 void setOnFocus(java.lang.String onFocus)
           
 void setOnLostFocus(java.lang.String onLostFocus)
           
 void setVisible(boolean visible)
          Set the widget's visibility state.
 
Methods inherited from class org.kalmeo.kuix.widget.Widget
add, add, bringNear, bringToFront, catchChildrenFrom, cleanUp, cleanUpChildren, clearCachedStyle, doLayout, getAlign, getAuthorStyle, getBackgroundAlign, getBackgroundColor, getBackgroundImage, getBackgroundRepeat, getBorder, getBorderAlign, getBorderColor, getBorderImage, getBorderStroke, getCachedMetrics, getChild, getColor, getDataProvider, getDefaultStylePropertyValue, getDesktop, getDisplayX, getDisplayY, getFocusManager, getGap, getGrayedColor, getHeight, getId, getInheritedTag, getInnerHeight, getInnerWidth, getInsets, getInternalChildInstance, getLastChild, getLayout, getLayoutData, getMargin, getMinSize, getOtherFocus, getPadding, getPreferredSize, getSpan, getStyleClasses, getStylePropertyValue, getStyles, getTag, getWeight, getWidget, getWidgetAt, getWidgetAt, getWidth, getX, getY, hasBindInstruction, hasShortcutKeyCodes, hasShortcuts, invalidate, invalidate, invalidateAppearance, invalidateAppearanceRegion, invalidateStylePropertiesCache, isFocusWidgetChild, isIndividualyVisible, isInvalidated, isInWidgetTree, isObjectAttribute, isShortcutKeyCodeCompatible, isVisible, markAsValidate, needToComputePreferredSize, onChildAdded, onChildRemoved, onFocus, onLostFocus, onRemoved, paint, paintBackground, paintBorder, paintChildrenImpl, paintImpl, paintMosaicImage, parseAuthorStyle, processActionEvent, processDataBindEvent, processItemsModelUpdateEvent, processKeyEvent, processModelUpdateEvent, processShortcutKeyEvent, propagateFocusEvent, removeAll, removeAttributeBindInstruction, requestBackwardFocus, requestForwardFocus, sendToBack, setAttributeBindInstruction, setAuthorStyle, setBounds, setDataProvider, setId, setObjectAttribute, setShortcutKeyCodes, setShortcuts, setStyleClass, setStyleClasses
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HOVER_PSEUDO_CLASS

public static final java.lang.String HOVER_PSEUDO_CLASS
See Also:
Constant Field Values

DISABLED_PSEUDO_CLASS

public static final java.lang.String DISABLED_PSEUDO_CLASS
See Also:
Constant Field Values

PSEUDO_CLASSES

protected static final java.lang.String[] PSEUDO_CLASSES

focusable

protected boolean focusable

focused

protected boolean focused

enabled

protected boolean enabled
Constructor Detail

FocusableWidget

public FocusableWidget()
Construct a FocusableWidget


FocusableWidget

public FocusableWidget(java.lang.String tag)
Construct a FocusableWidget

Parameters:
tag -
Method Detail

setAttribute

public boolean setAttribute(java.lang.String name,
                            java.lang.String value)
Description copied from class: Widget
Set the value to the specified attribute representing by the name

Overrides:
setAttribute in class Widget
Returns:
true if the attribute exists

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Description copied from class: Widget
Returns the value of the specified attribute

Overrides:
getAttribute in class Widget
Returns:
The value of the specified attribute

setFocusable

public void setFocusable(boolean focusable)
Parameters:
focusable - the focusable to set

isFocusable

public boolean isFocusable()
Description copied from class: Widget
Check if this Widget is focusable.

Overrides:
isFocusable in class Widget
Returns:
true if the widget is focusable

isFocused

public boolean isFocused()
Description copied from class: Widget
Check if this Widget is focused.

Overrides:
isFocused in class Widget
Returns:
true is the widget is focused

isEnabled

public boolean isEnabled()
Returns:
the enabled

setEnabled

public void setEnabled(boolean enabled)
Parameters:
enabled - the enabled to set

setVisible

public void setVisible(boolean visible)
Description copied from class: Widget
Set the widget's visibility state. An invisible widget is ignore from layout and paint process.

Overrides:
setVisible in class Widget
Parameters:
visible - the visible to set

getOnFocus

public java.lang.String getOnFocus()
Returns:
the onFocus

setOnFocus

public void setOnFocus(java.lang.String onFocus)
Parameters:
onFocus - the onFocus to set

getOnLostFocus

public java.lang.String getOnLostFocus()
Returns:
the onLostFocus

setOnLostFocus

public void setOnLostFocus(java.lang.String onLostFocus)
Parameters:
onLostFocus - the onLostFocus to set

getAvailablePseudoClasses

public java.lang.String[] getAvailablePseudoClasses()
Description copied from class: Widget
Retuns the list of available pseudo classes. (i.e hover, selected, ...).

Overrides:
getAvailablePseudoClasses in class Widget
Returns:
the pseudoClasses list

isPseudoClassCompatible

public boolean isPseudoClassCompatible(java.lang.String pseudoClass)
Overrides:
isPseudoClassCompatible in class Widget
Returns:
true if this widget is compatible with peudo class

giveFocusToNearestWidget

public void giveFocusToNearestWidget()
Give the focus to the nearest focusable widget.


remove

public void remove()
Description copied from class: Widget
Remove the current Widget from its parent.
Caution : this method do NOT cleanUp the widgets. It only remove widget from widget tree.

Overrides:
remove in class Widget

requestFocus

public void requestFocus()
Description copied from class: Widget
Requests the focus of this Widget.

Overrides:
requestFocus in class Widget

processFocusEvent

public boolean processFocusEvent(byte type)
Description copied from class: Widget
Process a focus event

Overrides:
processFocusEvent in class Widget
Returns:
true if the event is treated by the widget

processPointerEvent

public boolean processPointerEvent(byte type,
                                   int x,
                                   int y)
Description copied from class: Widget
Process a pointer event

Overrides:
processPointerEvent in class Widget
Returns:
true if the event is treated by the widget

onAdded

protected void onAdded(Widget parent)
Description copied from class: Widget
Event called when the widjet is added to parent.

Overrides:
onAdded in class Widget


Copyright © 2007-2008 Kalmeo. All Rights Reserved.