TextBlock Class Reference
class TextBlock The fundemental unit of text within an output file containing code. More...
#include <textblock.h>
Inheritance diagram for TextBlock:

Public Member Functions | |
| TextBlock (CodeDocument *parent, const QString &text="") | |
| Constructors. | |
| void | setText (const QString &new_var) |
| Set the value of m_text The actual text of this code block. | |
| void | appendText (const QString &new_text) |
| Add text to this object. | |
| QString | getText () const |
| Get the value of m_text The actual text of this code block. | |
| QString | getTag () const |
| Get the tag of this text block. | |
| void | setTag (const QString &value) |
| Set the tag of this text block. | |
| CodeDocument * | getParentDocument () |
| Get the value of m_parentDoc. | |
| void | setWriteOutText (bool new_var) |
| Set the value of m_writeOutText Whether or not to include the text of this TextBlock into a file. | |
| bool | getWriteOutText () |
| Get the value of m_writeOutText Whether or not to include the text of this TextBlock into a file. | |
| void | setIndentationLevel (int level) |
| Set how many times to indent this text block. | |
| int | getIndentationLevel () |
| Get how many times to indent this text block. | |
| QString | getIndentationString (int level=0) |
| Get the actual amount of indentation for a given level of indentation. | |
| QString | getIndentation () |
| Get how much a single "level" of indentation will actually indent. | |
| QString | getNewLineEndingChars () |
| QString | formatMultiLineText (const QString &text, const QString &linePrefix, const QString &breakStr, bool alwaysAddBreak=true, bool lastLineHasBreak=true) |
| Format a long text string to be more readable. | |
| virtual QString | unformatText (const QString &text, const QString &indent="") |
| UnFormat a long text string. | |
| virtual QString | toString () |
| virtual void | saveToXMI (QDomDocument &doc, QDomElement &root)=0 |
| Save the XMI representation of this object. | |
| virtual void | loadFromXMI (QDomElement &root)=0 |
| load params from the appropriate XMI element node. | |
| bool | canDelete () |
| Determine if its OK to delete this textblock from the document. | |
| virtual void | setAttributesFromObject (TextBlock *obj) |
| set the class attributes from a passed object | |
| virtual QString | getNewEditorLine (int indentAmount=0) |
| Used by the CodeEditor. | |
| virtual int | firstEditableLine () |
| Ush. | |
| virtual int | lastEditableLine () |
Static Public Member Functions | |
| static QString | encodeText (const QString &text, const QString &endChars) |
| encode text for XML storage we simply convert all types of newLines to the "\n" or 
 entity. | |
| static QString | decodeText (const QString &text, const QString &endChars) |
| decode text from XML storage We simply convert all newLine entity 
 to chosen line ending. | |
Protected Member Functions | |
| virtual void | release () |
| causes the text block to release all of its connections and any other text blocks that it 'owns'. | |
| void | setParentDocument (CodeDocument *new_var) |
| Set the value of m_parentDocument. | |
| virtual void | setAttributesOnNode (QDomDocument &doc, QDomElement &blockElement) |
| set attributes of the node that represents this class in the XMI document. | |
| virtual void | setAttributesFromNode (QDomElement &element) |
| set the class attributes of this object from the passed element node. | |
Protected Attributes | |
| bool | m_canDelete |
Friends | |
| class | CodeGenObjectWithTextBlocks |
| class | ClassifierCodeDocument |
Detailed Description
class TextBlock The fundemental unit of text within an output file containing code.
Definition at line 32 of file textblock.h.
Constructor & Destructor Documentation
|
||||||||||||
|
Constructors.
Definition at line 33 of file textblock.cpp. References setText(). |
Member Function Documentation
|
|
Set the value of m_text The actual text of this code block.
Definition at line 76 of file textblock.cpp. Referenced by CodeGenObjectWithTextBlocks::addOrUpdateTaggedCodeBlockWithComments(), CodeGenObjectWithTextBlocks::addOrUpdateTaggedCodeComment(), CodeGenObjectWithTextBlocks::getCodeBlockWithComments(), setAttributesFromNode(), setAttributesFromObject(), CodeParameter::syncToParent(), and TextBlock(). |
|
|
Add text to this object.
Definition at line 84 of file textblock.cpp. |
|
|
Get the value of m_text The actual text of this code block.
Definition at line 93 of file textblock.cpp. Referenced by XMLCodeComment::toString(), RubyCodeDocumentation::toString(), RubyCodeComment::toString(), JavaCodeDocumentation::toString(), JavaCodeComment::toString(), CPPCodeDocumentation::toString(), CPPCodeComment::toString(), CodeMethodBlock::toString(), and CodeBlockWithComments::toString(). |
|
|
Get the tag of this text block. This tag may be used to find this text block in the code document to which it belongs. Definition at line 102 of file textblock.cpp. Referenced by CodeGenObjectWithTextBlocks::addTextBlock(), CodeDocument::insertTextBlock(), CodeBlockWithComments::setAttributesFromNode(), and setAttributesOnNode(). |
|
|
Set the tag of this text block. This tag may be used to find this text block in the code document to which it belongs. Definition at line 111 of file textblock.cpp. Referenced by CodeGenObjectWithTextBlocks::addOrUpdateTaggedCodeBlockWithComments(), CodeGenObjectWithTextBlocks::addOrUpdateTaggedCodeComment(), CodeGenObjectWithTextBlocks::addTextBlock(), CodeGenObjectWithTextBlocks::getCodeBlockWithComments(), CodeDocument::insertTextBlock(), and setAttributesFromNode(). |
|
|
Get the value of m_parentDoc.
Definition at line 67 of file textblock.cpp. Referenced by CodeGenObjectWithTextBlocks::addTextBlock(). |
|
|
Set the value of m_writeOutText Whether or not to include the text of this TextBlock into a file.
Definition at line 120 of file textblock.cpp. Referenced by CodeGenObjectWithTextBlocks::addOrUpdateTaggedCodeBlockWithComments(), CodeGenObjectWithTextBlocks::addOrUpdateTaggedCodeComment(), CodeGenObjectWithTextBlocks::getCodeBlockWithComments(), setAttributesFromNode(), setAttributesFromObject(), and CPPHeaderCodeDocument::updateContent(). |
|
|
Get the value of m_writeOutText Whether or not to include the text of this TextBlock into a file.
Definition at line 129 of file textblock.cpp. Referenced by setAttributesOnNode(), XMLCodeComment::toString(), RubyCodeDocumentation::toString(), RubyCodeComment::toString(), JavaCodeDocumentation::toString(), JavaCodeComment::toString(), CPPCodeDocumentation::toString(), CPPCodeComment::toString(), CodeMethodBlock::toString(), and CodeBlockWithComments::toString(). |
|
|
Set how many times to indent this text block. The amount of each indenatation is determined from the parent codedocument codegeneration policy. Definition at line 135 of file textblock.cpp. Referenced by CodeGenObjectWithTextBlocks::addOrUpdateTaggedCodeComment(), setAttributesFromNode(), setAttributesFromObject(), and CodeBlockWithComments::setOverallIndentationLevel(). |
|
|
Get how many times to indent this text block. The amount of each indenatation is determined from the parent codedocument codegeneration policy. Definition at line 143 of file textblock.cpp. Referenced by setAttributesOnNode(), and CodeMethodBlock::toString(). |
|
|
Get the actual amount of indentation for a given level of indentation.
Definition at line 157 of file textblock.cpp. References getIndentation(). Referenced by getNewEditorLine(), RubyCodeDocumentation::getNewEditorLine(), RubyCodeComment::getNewEditorLine(), JavaCodeDocumentation::getNewEditorLine(), JavaCodeComment::getNewEditorLine(), CPPCodeDocumentation::getNewEditorLine(), CPPCodeComment::getNewEditorLine(), XMLCodeComment::toString(), toString(), RubyCodeDocumentation::toString(), RubyCodeComment::toString(), JavaCodeDocumentation::toString(), JavaCodeComment::toString(), CPPCodeDocumentation::toString(), CPPCodeComment::toString(), CodeMethodBlock::toString(), CodeBlockWithComments::toString(), and unformatText(). |
|
|
Get how much a single "level" of indentation will actually indent.
Definition at line 152 of file textblock.cpp. References UMLApp::getCommonPolicy(), and CodeGenerationPolicy::getIndentation(). Referenced by getIndentationString(). |
|
||||||||||||||||||||||||
|
Format a long text string to be more readable.
Definition at line 203 of file textblock.cpp. Referenced by toString(), RubyCodeComment::toString(), CodeMethodBlock::toString(), and CodeBlockWithComments::toString(). |
|
||||||||||||
|
UnFormat a long text string. Typically, this means removing the indentaion (linePrefix) and/or newline chars from each line. If an indentation isnt specified, then the current indentation is used. Reimplemented in CPPCodeComment, CPPCodeDocumentation, JavaCodeComment, JavaCodeDocumentation, RubyCodeComment, and RubyCodeDocumentation. Definition at line 185 of file textblock.cpp. References getIndentationString(). Referenced by RubyCodeDocumentation::unformatText(), RubyCodeComment::unformatText(), JavaCodeDocumentation::unformatText(), JavaCodeComment::unformatText(), CPPCodeDocumentation::unformatText(), and CPPCodeComment::unformatText(). |
|
|
Reimplemented in CodeBlockWithComments, CPPCodeComment, CPPCodeDocumentation, JavaCodeComment, JavaCodeDocumentation, RubyCodeComment, RubyCodeDocumentation, XMLCodeComment, and CodeMethodBlock. Definition at line 299 of file textblock.cpp. References formatMultiLineText(), UMLApp::getCommonPolicy(), getIndentationString(), and CodeGenerationPolicy::getNewLineEndingChars(). Referenced by CodeMethodBlock::toString(), CodeDocument::toString(), and CodeBlockWithComments::toString(). |
|
||||||||||||
|
encode text for XML storage we simply convert all types of newLines to the "\n" or 
 entity.
Definition at line 281 of file textblock.cpp. Referenced by setAttributesOnNode(), and CodeMethodBlock::setAttributesOnNode(). |
|
||||||||||||
|
decode text from XML storage We simply convert all newLine entity 
 to chosen line ending.
Definition at line 290 of file textblock.cpp. Referenced by setAttributesFromNode(), and CodeMethodBlock::setAttributesFromNode(). |
|
||||||||||||
|
Save the XMI representation of this object.
Implemented in CodeBlock, CodeBlockWithComments, CodeClassFieldDeclarationBlock, CodeComment, CPPCodeComment, CPPCodeDocumentation, JavaCodeDocumentation, RubyCodeDocumentation, and OwnedHierarchicalCodeBlock. Referenced by CodeGenObjectWithTextBlocks::setAttributesOnNode(). |
|
|
load params from the appropriate XMI element node.
Implemented in CodeBlock, CodeBlockWithComments, CodeClassFieldDeclarationBlock, CodeComment, and OwnedHierarchicalCodeBlock. |
|
|
Determine if its OK to delete this textblock from the document. Used by the text editor to know if deletion could cause a crash of the program. Definition at line 59 of file textblock.cpp. Referenced by setAttributesOnNode(). |
|
|
set the class attributes from a passed object
Reimplemented in CodeBlock, CodeBlockWithComments, CodeClassFieldDeclarationBlock, CodeMethodBlock, and OwnedHierarchicalCodeBlock. Definition at line 255 of file textblock.cpp. References setIndentationLevel(), setText(), and setWriteOutText(). Referenced by CodeBlockWithComments::setAttributesFromObject(), and CodeBlock::setAttributesFromObject(). |
|
|
Used by the CodeEditor. It provides it with an appropriate starting string for a new line of text within the given textblock (for example a string with the proper indentation). If the indentation amount is '0' the current indentationString will be used. Reimplemented in CPPCodeComment, CPPCodeDocumentation, JavaCodeComment, JavaCodeDocumentation, RubyCodeComment, and RubyCodeDocumentation. Definition at line 180 of file textblock.cpp. References getIndentationString(). |
|
|
Ush. These are terrifically bad and must one day go away. Both methods indicate the range of lines in this textblock which may be edited by the codeeditor (assuming that any are actually editable). The default case is no lines are editable. The line numbering starts with '0' and a '-1' means no line qualifies. Reimplemented in CPPCodeDocumentation, JavaCodeDocumentation, and RubyCodeDocumentation. Definition at line 177 of file textblock.cpp. |
|
|
causes the text block to release all of its connections and any other text blocks that it 'owns'. needed to be called prior to deletion of the textblock. Reimplemented in CodeClassFieldDeclarationBlock, CodeMethodBlock, and OwnedHierarchicalCodeBlock. Definition at line 198 of file textblock.cpp. Referenced by CodeMethodBlock::release(). |
|
|
Set the value of m_parentDocument.
Definition at line 55 of file textblock.cpp. |
|
||||||||||||
|
set attributes of the node that represents this class in the XMI document.
Reimplemented in CodeBlock, CodeBlockWithComments, CodeClassFieldDeclarationBlock, CodeMethodBlock, and OwnedHierarchicalCodeBlock. Definition at line 232 of file textblock.cpp. References canDelete(), encodeText(), UMLApp::getCommonPolicy(), getIndentationLevel(), CodeGenerationPolicy::getNewLineEndingChars(), getTag(), and getWriteOutText(). Referenced by RubyCodeDocumentation::saveToXMI(), JavaCodeDocumentation::saveToXMI(), CPPCodeDocumentation::saveToXMI(), CPPCodeComment::saveToXMI(), CodeComment::saveToXMI(), and CodeBlock::setAttributesOnNode(). |
|
|
set the class attributes of this object from the passed element node.
Reimplemented in CodeBlock, CodeBlockWithComments, CodeClassFieldDeclarationBlock, CodeMethodBlock, and OwnedHierarchicalCodeBlock. Definition at line 266 of file textblock.cpp. References decodeText(), UMLApp::getCommonPolicy(), CodeGenerationPolicy::getNewLineEndingChars(), setIndentationLevel(), setTag(), setText(), and setWriteOutText(). Referenced by CodeComment::loadFromXMI(), and CodeBlock::setAttributesFromNode(). |
The documentation for this class was generated from the following files:
