enumliteral.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "enumliteral.h"
00013
00014 #include <kinputdialog.h>
00015 #include <kdebug.h>
00016 #include <klocale.h>
00017
00018 UMLEnumLiteral::UMLEnumLiteral(const UMLObject *parent,
00019 const QString& name, Uml::IDType id)
00020 : UMLClassifierListItem(parent, name, id) {
00021 m_BaseType = Uml::ot_EnumLiteral;
00022 }
00023
00024 UMLEnumLiteral::UMLEnumLiteral(const UMLObject *parent) : UMLClassifierListItem(parent) {
00025 m_BaseType = Uml::ot_EnumLiteral;
00026 }
00027
00028 UMLEnumLiteral::~UMLEnumLiteral() { }
00029
00030 bool UMLEnumLiteral::operator==(UMLEnumLiteral& rhs) {
00031 if ( this == &rhs ) {
00032 return true;
00033 }
00034 if ( !UMLObject::operator==( rhs ) ) {
00035 return false;
00036 }
00037 return true;
00038 }
00039
00040 void UMLEnumLiteral::copyInto(UMLEnumLiteral *rhs) const
00041 {
00042 UMLClassifierListItem::copyInto(rhs);
00043 }
00044
00045 UMLObject* UMLEnumLiteral::clone() const
00046 {
00047 UMLEnumLiteral *clone = new UMLEnumLiteral((UMLObject *) parent());
00048 copyInto(clone);
00049
00050 return clone;
00051 }
00052
00053
00054 void UMLEnumLiteral::saveToXMI(QDomDocument& qDoc, QDomElement& qElement) {
00055 QDomElement attributeElement = UMLObject::save("UML:EnumerationLiteral", qDoc);
00056 qElement.appendChild( attributeElement );
00057 }
00058
00059 bool UMLEnumLiteral::load(QDomElement& ) {
00060 return true;
00061 }
00062
00063 bool UMLEnumLiteral::showPropertiesDialog(QWidget* parent) {
00064 bool ok;
00065 QString name = KInputDialog::getText(i18n("Name"), i18n("Enter name:"), getName(), &ok, parent);
00066 if ( ok && !name.isEmpty() ) {
00067 setName(name);
00068 return true;
00069 } else {
00070 return false;
00071 }
00072 }
00073
00074
This file is part of the documentation for umbrello Version 3.1.0.