Exemple #1
0
void DOMTreeView::initializeOptionsFromCData(const DOM::CharacterData &cdata)
{
  contentEditor->setText(cdata.data().string());

  DOM::Text text = cdata;
  contentEditor->setEnabled(!text.isNull());

  nodeInfoStack->raiseWidget(CDataPanel);
}
void DOMTreeView::initializeDOMInfoFromCData(const DOM::CharacterData &cdata)
{
  contentEditor->setText(cdata.data().string());

  DOM::Text text = cdata;
  contentEditor->setEnabled(!text.isNull());

  nodeInfoStack->setCurrentIndex(CDataPanel);
}
KJSO DOMCharacterData::tryGet(const UString &p) const
{
  DOM::CharacterData data = static_cast<DOM::CharacterData>(node);
  if (p == "data")
    return String(data.data());
  else if (p == "length")
    return Number(data.length());
  else if (p == "substringData")
    return new DOMCharacterDataFunction(data, DOMCharacterDataFunction::SubstringData);
  else if (p == "appendData")
    return new DOMCharacterDataFunction(data, DOMCharacterDataFunction::AppendData);
  else if (p == "insertData")
    return new DOMCharacterDataFunction(data, DOMCharacterDataFunction::InsertData);
  else if (p == "deleteData")
    return new DOMCharacterDataFunction(data, DOMCharacterDataFunction::DeleteData);
  else if (p == "replaceData")
    return new DOMCharacterDataFunction(data, DOMCharacterDataFunction::ReplaceData);
  else
    return DOMNode::tryGet(p);
}