Ejemplo n.º 1
0
/**
 * Set attributes of the node that represents this class
 * in the XMI document.
 * @param doc            the xmi document
 * @param blockElement   the xmi element holding the attributes
 */
void TextBlock::setAttributesOnNode(QDomDocument & doc, QDomElement & blockElement)
{
    Q_UNUSED(doc);

    QString endLine = UMLApp::app()->commonPolicy()->getNewLineEndingChars();

    blockElement.setAttribute("tag",getTag());

    // only write these if different from defaults
    if (getIndentationLevel())
        blockElement.setAttribute("indentLevel", QString::number(getIndentationLevel()));
    if (!m_text.isEmpty())
        blockElement.setAttribute("text", encodeText(m_text, endLine));
    if (!getWriteOutText())
        blockElement.setAttribute("writeOutText", getWriteOutText()?"true":"false");
    if (!canDelete())
        blockElement.setAttribute("canDelete", canDelete()?"true":"false");
}
Ejemplo n.º 2
0
/**
 * @return      QString
 */
QString CPPCodeComment::toString ( )
{

    QString output = "";

    // simple output method
    if(getWriteOutText())
    {
        QString indent = getIndentationString();
        QString endLine = getNewLineEndingChars();
        output.append(formatMultiLineText (getText()+endLine, indent +"// ", endLine));
    }

    return output;
}
Ejemplo n.º 3
0
QString DCodeComment::toString () const
{
    QString output;

    // simple output method
    if(getWriteOutText())
    {
        QString indent = getIndentationString();
        QString endLine = getNewLineEndingChars();
        QString body = getText();

        // check the need for multiline comments
        if (body.indexOf(QRegExp(endLine)) >= 0) {
            output += indent + QLatin1String("/**") + endLine;
            output += formatMultiLineText (body, indent + QLatin1String(" * "), endLine);
            output += indent + QLatin1String(" */") + endLine;
        } else {
            output += formatMultiLineText (body, indent + QLatin1String("// "), endLine);
        }
    }

    return output;
}