Methods Summary |
---|
public void | commit()
UiElementNode parent = getUiParent();
if (parent != null && isValid() && isDirty()) {
String value = getTextWidgetValue();
if (parent.commitAttributeToXml(this, value)) {
mCurrentValue = value;
setDirty(false);
}
}
|
public final java.lang.String | getCurrentValue()Returns the current value of the node.
return mCurrentValue;
|
public abstract java.lang.String | getTextWidgetValue()Returns the text value present in the UI.
|
protected final boolean | isInInternalTextModification()
return mInternalTextModification;
|
public abstract boolean | isValid()Returns if the attribute node is valid, and its UI has been created.
|
public final void | setCurrentValue(java.lang.String value)Sets the current value of the node. Cannot be null (use an empty string).
mCurrentValue = value;
|
protected final void | setInInternalTextModification(boolean internalTextModification)
mInternalTextModification = internalTextModification;
|
public abstract void | setTextWidgetValue(java.lang.String value)Sets the text value to be displayed in the UI.
|
public void | updateValue(org.w3c.dom.Node xml_attribute_node)Updates the current text field's value when the XML has changed.
The caller doesn't really know if attributes have changed,
so it will call this to refresh the attribute anyway. The value
is only set if it has changed.
This also resets the "dirty" flag.
mCurrentValue = DEFAULT_VALUE;
if (xml_attribute_node != null) {
mCurrentValue = xml_attribute_node.getNodeValue();
}
if (isValid() && !getTextWidgetValue().equals(mCurrentValue)) {
try {
mInternalTextModification = true;
setTextWidgetValue(mCurrentValue);
setDirty(false);
} finally {
mInternalTextModification = false;
}
}
|