use of org.eclipse.sapphire.modeling.xml.XmlElement in project liferay-ide by liferay.
the class BeforeAfterFilterNameBinding method read.
@Override
public String read() {
String retval = null;
XmlElement filterElement = null;
XmlElement xmlElement = xml();
BeforeAfterFilterType filterType = _getFilterType();
String filterTypeText = filterType.getText();
filterElement = xmlElement.getChildElement(filterTypeText, false);
if (filterElement != null) {
retval = filterElement.getText();
}
return retval;
}
use of org.eclipse.sapphire.modeling.xml.XmlElement in project liferay-ide by liferay.
the class BeforeAfterFilterNameBinding method write.
@Override
public void write(String value) {
XmlElement xmlElement = xml();
BeforeAfterFilterType filterType = _getFilterType();
String filterTypeText = filterType.getText();
XmlElement filterElement = xmlElement.getChildElement(filterTypeText, true);
filterElement.setText(value);
}
use of org.eclipse.sapphire.modeling.xml.XmlElement in project liferay-ide by liferay.
the class BeforeAfterFilterTypeBinding method read.
@Override
public String read() {
// check for existence of before-filter or after-filter elements, if neither
// exist, then return default value
XmlElement xmlElement = xml();
XmlElement beforeFilterElement = xmlElement.getChildElement(BeforeAfterFilterType.BEFORE_FILTER.getText(), false);
if (beforeFilterElement != null) {
return BeforeAfterFilterType.BEFORE_FILTER.getText();
}
XmlElement afterFilterElement = xmlElement.getChildElement(BeforeAfterFilterType.AFTER_FILTER.getText(), false);
if (afterFilterElement != null) {
return BeforeAfterFilterType.AFTER_FILTER.getText();
}
if (_localValue != null) {
return _localValue;
}
return _defaultValueText;
}
use of org.eclipse.sapphire.modeling.xml.XmlElement in project liferay-ide by liferay.
the class BeforeAfterFilterTypeBinding method write.
@Override
public void write(String value) {
XmlElement xmlElement = xml();
XmlElement filterElement = xmlElement.getChildElement(BeforeAfterFilterType.BEFORE_FILTER.getText(), false);
if (filterElement == null) {
filterElement = xmlElement.getChildElement(BeforeAfterFilterType.AFTER_FILTER.getText(), false);
}
String existingFilterValue = null;
if (filterElement != null) {
existingFilterValue = filterElement.getText();
filterElement.remove();
XmlElement newElement = xmlElement.getChildElement(value, true);
newElement.setText(existingFilterValue);
} else {
_localValue = value;
}
}
use of org.eclipse.sapphire.modeling.xml.XmlElement in project liferay-ide by liferay.
the class TextNodeValueBinding method read.
/*
* (non-Javadoc)
*
* @see org.eclipse.sapphire.modeling.ValuePropertyBinding#read()
*/
@Override
public String read() {
String value = null;
final XmlElement element = xml(false);
if (element != null) {
value = xml(true).getText();
if (value != null) {
value = value.trim();
}
}
return value;
}
Aggregations