else if (parentNode instanceof ApplicationNode) {
allRepresentations = ((ApplicationNode) parentNode).getAllRepresentations();
}
Iterator allRepresentationsIterator = allRepresentations.iterator();
while (allRepresentationsIterator.hasNext()) {
RepresentationNode representation = (RepresentationNode) allRepresentationsIterator.next();
RepresentationItem representationItem = new RepresentationItem(representation, parentNode, parentTreeItem);
TreeItem representationTreeItem = new TreeItem(representationItem);
representationTreeItem.setUserObject(WadlXml.representationNode);
parentTreeItem.addItem(representationTreeItem);
if (representation.getHref() == null) {
String requestString = "";
if (representation.getApplication() != null) {
requestString = representation.getApplication().getAnalyzer().getRequestString();
}
ParamItem.listParams(
representation,
representationTreeItem,
requestString);
// close representation item
GenericClosingItem representationCloseItem = new GenericClosingItem(WadlXml.representationNode);
TreeItem representationCloseTreeItem = new TreeItem(representationCloseItem);
representationCloseTreeItem.setUserObject(WadlXml.representationNode);
parentTreeItem.addItem(representationCloseTreeItem);
}
}
if (!WadlTreeRoot.containsButton(buttonTreeItems, ApplicationItem.button + WadlXml.representationNode)) {
// add representation button
HorizontalPanel addRepresentationPanel = new HorizontalPanel();
Button addRepresentationButton = new Button(GuiFactory.strings.addRepresentation());
addRepresentationButton.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
if (parentNode instanceof RequestNode) {
((RequestNode) parentNode).addRepresentation(new RepresentationNode(GuiFactory.strings.newRepresentation(), application_xml, (GenericNode) parentNode, ((GenericNode) parentNode).getApplication()));
}
else if (parentNode instanceof ResponseNode) {
((ResponseNode) parentNode).addRepresentation(new RepresentationNode(GuiFactory.strings.newRepresentation(), application_xml, (GenericNode) parentNode, ((GenericNode) parentNode).getApplication()));
}
else if (parentNode instanceof ApplicationNode) {
RepresentationNode representation = new RepresentationNode(GuiFactory.strings.newRepresentation(), application_xml, (GenericNode) parentNode, ((GenericNode) parentNode).getApplication());
representation.setId(GuiFactory.strings.newId());
((ApplicationNode) parentNode).addRepresentation(representation);
}
listRepresentations(parentNode, parentTreeItem);
}
});