public void releaseResources() { while (childrenNum() > 0) { MAGComponentInterface comp = getChild(childrenNum() - 1); comp.releaseResources(); removeChild(comp); } super.releaseResources(); }
public boolean fromJSON(JSONObject o) { try { if (!super.fromJSON(o)) { return false; } if (!checkMandatory(o, "_content")) { return false; } JSONArray content = o.getJSONArray("_content"); for (int i = 0; i < content.length(); i++) { MAGComponent.parseJSON(this, content.getJSONObject(i)); } return true; } catch (final JSONException e) { LOG.error(this, "fromJSON", e); } return false; }
private void scanNamedChildren() { if (_childrenhash == null) { _childrenhash = new Hashtable<String, MAGComponentInterface>(); } for (int i = 0; _children != null && i < _children.size(); i++) { MAGComponent child = (MAGComponent) _children.elementAt(i); if (child.id() != null && child.id().length() > 0) { if (_childrenhash.containsKey(child.id())) { EasyDialog.remind( getContext(), "ID:" + child.id() + " " + getContext().getString(R.string.mag_component_same_id)); } else { _childrenhash.put(child.id(), child); } } } }