use of net.drewke.tdme.gui.nodes.GUIParentNode in project tdme by andreasdr.
the class LevelEditorScreenController method setObjectPresetIds.
/**
* Set up object property preset ids
* @param object property preset ids
*/
public void setObjectPresetIds(Collection<String> objectPresetIds) {
// model properties presets inner
GUIParentNode objectPropertiesPresetsInnerNode = (GUIParentNode) (objectPropertiesPresets.getScreenNode().getNodeById(objectPropertiesPresets.getId() + "_inner"));
// construct XML for sub nodes
int idx = 0;
String objectPropertiesPresetsInnerNodeSubNodesXML = "";
objectPropertiesPresetsInnerNodeSubNodesXML += "<scrollarea-vertical id=\"" + objectPropertiesPresets.getId() + "_inner_scrollarea\" width=\"100%\" height=\"100\">\n";
for (String modelPresetId : objectPresetIds) {
objectPropertiesPresetsInnerNodeSubNodesXML += "<dropdown-option text=\"" + GUIParser.escapeQuotes(modelPresetId) + "\" value=\"" + GUIParser.escapeQuotes(modelPresetId) + "\" " + (idx == 0 ? "selected=\"true\" " : "") + " />\n";
idx++;
}
objectPropertiesPresetsInnerNodeSubNodesXML += "</scrollarea-vertical>\n";
// inject sub nodes
try {
objectPropertiesPresetsInnerNode.replaceSubNodes(objectPropertiesPresetsInnerNodeSubNodesXML, true);
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations