use of org.whole.lang.xml.model.Element in project whole by wholeplatform.
the class ElementOutlinePart method getModelSpecificChildren.
protected List<IEntity> getModelSpecificChildren() {
Element entity = getModelEntity();
List<IEntity> list = new ArrayList<IEntity>(3);
list.add(entity.getTag());
list.add(entity.getAttributes());
list.add(entity.getContent());
return list;
}
use of org.whole.lang.xml.model.Element in project whole by wholeplatform.
the class ElementOutlinePart method createFigure.
protected IFigure createFigure() {
Element entity = getModelEntity();
IContent content = entity.getContent();
boolean startOpened = !EntityUtils.isResolver(content) && !(EntityUtils.isComposite(content) && content.wIsEmpty());
return new ElementOutlineFigure(startOpened);
}
use of org.whole.lang.xml.model.Element in project whole by wholeplatform.
the class ElementPart method getModelSpecificChildren.
protected List<IEntity> getModelSpecificChildren() {
List<IEntity> list = new ArrayList<IEntity>(4);
Element element = getModelEntity();
list.add(element.getTag());
list.add(element.getAttributes());
list.add(element.getContent());
// FIXME
list.add(element.getTag());
return list;
}
use of org.whole.lang.xml.model.Element in project whole by wholeplatform.
the class GrammarsUtilsTest method testUnparseXmlElement.
@Test
public void testUnparseXmlElement() {
XmlEntityFactory xf = XmlEntityFactory.instance;
Element e = xf.createElement(xf.createQualifiedName(xf.createNameSpace("ns"), xf.createName("tag")), xf.createAttributes(xf.createAttribute(xf.createName("attr"), xf.createValue("val")), xf.createAttribute(xf.createName("attr2"), xf.createValue("val2"))), xf.createCharData("test"));
StringBuilder sb = new StringBuilder();
GrammarsUtils.unparse(e, sb, xmlGrammarURI);
Assert.assertEquals("<ns:tag attr=\"val\" attr2=\"val2\">test</ns:tag>", sb.toString());
}
Aggregations