summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/codegenerators/javacodegenerationpolicypage.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbd9e6617827818fd043452c08c606f07b78014a0 (patch)
tree425bb4c3168f9c02f10150f235d2cb998dcc6108 /umbrello/umbrello/codegenerators/javacodegenerationpolicypage.cpp
downloadtdesdk-bd9e6617827818fd043452c08c606f07b78014a0.tar.gz
tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'umbrello/umbrello/codegenerators/javacodegenerationpolicypage.cpp')
-rw-r--r--umbrello/umbrello/codegenerators/javacodegenerationpolicypage.cpp84
1 files changed, 84 insertions, 0 deletions
diff --git a/umbrello/umbrello/codegenerators/javacodegenerationpolicypage.cpp b/umbrello/umbrello/codegenerators/javacodegenerationpolicypage.cpp
new file mode 100644
index 00000000..fd6d2ae3
--- /dev/null
+++ b/umbrello/umbrello/codegenerators/javacodegenerationpolicypage.cpp
@@ -0,0 +1,84 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * copyright (C) 2004-2006 *
+ * Umbrello UML Modeller Authors <uml-devel@uml.sf.net> *
+ ***************************************************************************/
+
+/* This code generated by:
+ * Author : thomas
+ * Date : Wed Jul 30 2003
+ */
+
+// own header
+#include "javacodegenerationpolicypage.h"
+// qt/kde includes
+#include <qlabel.h>
+#include <qcombobox.h>
+#include <qcheckbox.h>
+#include <kdebug.h>
+#include <klocale.h>
+// app includes
+#include "javacodegenerationformbase.h"
+#include "../uml.h"
+
+JavaCodeGenerationPolicyPage::JavaCodeGenerationPolicyPage( QWidget *parent, const char *name, JavaCodeGenerationPolicy * policy )
+ : CodeGenerationPolicyPage(parent, name, policy)
+{
+ CodeGenerationPolicy *commonPolicy = UMLApp::app()->getCommonPolicy();
+ form = new JavaCodeGenerationFormBase(this);
+ form->m_SelectCommentStyle->setCurrentItem((int)(commonPolicy->getCommentStyle()));
+ form->m_generateConstructors->setChecked(commonPolicy->getAutoGenerateConstructors());
+ form->m_generateAttribAccessors->setChecked(policy->getAutoGenerateAttribAccessors());
+ form->m_generateAssocAccessors->setChecked(policy->getAutoGenerateAssocAccessors());
+ form->m_accessorScopeCB->setCurrentItem(commonPolicy->getAttributeAccessorScope() - 200);
+ form->m_assocFieldScopeCB->setCurrentItem(commonPolicy->getAssociationFieldScope() - 200);
+
+ /**
+ * @todo unclean - CreateANTBuildFile attribute should be in java policy
+ CodeGenerator *codegen = UMLApp::app()->getGenerator();
+ JavaCodeGenerator *javacodegen = dynamic_cast<JavaCodeGenerator*>(codegen);
+ if (javacodegen)
+ form->m_makeANTDocumentCheckBox->setChecked(javacodegen->getCreateANTBuildFile());
+ */
+}
+
+JavaCodeGenerationPolicyPage::~JavaCodeGenerationPolicyPage()
+{
+}
+
+void JavaCodeGenerationPolicyPage::apply()
+{
+ CodeGenerationPolicy *commonPolicy = UMLApp::app()->getCommonPolicy();
+ JavaCodeGenerationPolicy * parent = (JavaCodeGenerationPolicy*) m_parentPolicy;
+
+ // block signals so we don't cause too many update content calls to code documents
+ commonPolicy->blockSignals(true);
+
+ commonPolicy->setCommentStyle((CodeGenerationPolicy::CommentStyle ) form->m_SelectCommentStyle->currentItem());
+ commonPolicy->setAttributeAccessorScope((CodeGenerationPolicy::ScopePolicy) (form->m_accessorScopeCB->currentItem()+200));
+ commonPolicy->setAssociationFieldScope((CodeGenerationPolicy::ScopePolicy) (form->m_assocFieldScopeCB->currentItem()+200));
+ commonPolicy->setAutoGenerateConstructors(form->m_generateConstructors->isChecked());
+ parent->setAutoGenerateAttribAccessors(form->m_generateAttribAccessors->isChecked());
+ parent->setAutoGenerateAssocAccessors(form->m_generateAssocAccessors->isChecked());
+
+ /**
+ * @todo unclean - CreateANTBuildFile attribute should be in java policy
+ CodeGenerator *codegen = UMLApp::app()->getGenerator();
+ JavaCodeGenerator *javacodegen = dynamic_cast<JavaCodeGenerator*>(codegen);
+ if (javacodegen)
+ javacodegen->setCreateANTBuildFile(form->m_makeANTDocumentCheckBox->isChecked());
+ */
+ commonPolicy->blockSignals(false);
+
+ // now send out modified code content signal
+ commonPolicy->emitModifiedCodeContentSig();
+
+}
+
+
+#include "javacodegenerationpolicypage.moc"