org.kalmeo.kuix.widget
Class TextWidget

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

public abstract class TextWidget
extends FocusableWidget

This class is base for all text 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
protected  java.lang.String text
           
 
Fields inherited from class org.kalmeo.kuix.widget.FocusableWidget
DISABLED_PSEUDO_CLASS, enabled, focusable, focused, HOVER_PSEUDO_CLASS, 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
TextWidget(java.lang.String tag)
          Construct a TextWidget
 
Method Summary
 void clearCachedStyle(boolean propagateToChildren)
          Clear the cachedStyle.
 java.lang.Object getAttribute(java.lang.String name)
          Returns the value of the specified attribute
protected  java.lang.Object getDefaultStylePropertyValue(java.lang.String name)
          Returns the de default style property value for name property, or null.
protected  java.lang.String getDisplayedText()
          Returns the displayed text.
protected  Font getFont()
           
 java.lang.String getText()
          Returns the text value.
 boolean isFocusable()
          Check if this Widget is focusable.
 boolean setAttribute(java.lang.String name, java.lang.String value)
          Set the value to the specified attribute representing by the name
 void setDefaultFontFace(int defaultFontFace)
           
 void setDefaultFontSize(int defaultFontSize)
           
 void setDefaultFontStyle(int defaultFontStyle)
           
 TextWidget setText(java.lang.String text)
          Returns the instance of this TextWidget Useful in this case : AbstractTextWidget text = new Text().setText("message");
 
Methods inherited from class org.kalmeo.kuix.widget.FocusableWidget
getAvailablePseudoClasses, getOnFocus, getOnLostFocus, giveFocusToNearestWidget, isEnabled, isFocused, isPseudoClassCompatible, onAdded, processFocusEvent, processPointerEvent, remove, requestFocus, setEnabled, setFocusable, setOnFocus, setOnLostFocus, setVisible
 
Methods inherited from class org.kalmeo.kuix.widget.Widget
add, add, bringNear, bringToFront, catchChildrenFrom, cleanUp, cleanUpChildren, doLayout, getAlign, getAuthorStyle, getBackgroundAlign, getBackgroundColor, getBackgroundImage, getBackgroundRepeat, getBorder, getBorderAlign, getBorderColor, getBorderImage, getBorderStroke, getCachedMetrics, getChild, getColor, getDataProvider, 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

text

protected java.lang.String text
Constructor Detail

TextWidget

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

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 FocusableWidget
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 FocusableWidget
Returns:
The value of the specified attribute

isFocusable

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

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

setDefaultFontFace

public void setDefaultFontFace(int defaultFontFace)
Parameters:
defaultFontFace - the defaultFontFace to set

setDefaultFontStyle

public void setDefaultFontStyle(int defaultFontStyle)
Parameters:
defaultFontStyle - the defaultFontStyle to set

setDefaultFontSize

public void setDefaultFontSize(int defaultFontSize)
Parameters:
defaultFontSize - the defaultFontSize to set

getText

public java.lang.String getText()
Returns the text value.

Returns:
the text

getDisplayedText

protected java.lang.String getDisplayedText()
Returns the displayed text. By default displayed text is the text value.

Returns:
the displayed text

setText

public TextWidget setText(java.lang.String text)
Returns the instance of this TextWidget Useful in this case : AbstractTextWidget text = new Text().setText("message");

Parameters:
text - the text to set

getFont

protected Font getFont()
Returns:
The font of this Text

getDefaultStylePropertyValue

protected java.lang.Object getDefaultStylePropertyValue(java.lang.String name)
Description copied from class: Widget
Returns the de default style property value for name property, or null.

Overrides:
getDefaultStylePropertyValue in class Widget
Returns:
The de default style property value for name property

clearCachedStyle

public void clearCachedStyle(boolean propagateToChildren)
Description copied from class: Widget
Clear the cachedStyle.

Overrides:
clearCachedStyle in class Widget


Copyright © 2007-2008 Kalmeo. All Rights Reserved.