Index: src/Actions/SelectionAction/AllAtomsAction.cpp
===================================================================
--- src/Actions/SelectionAction/AllAtomsAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/AllAtomsAction.cpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/SelectionAction/AllAtomsAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "Descriptors/AtomDescriptor.hpp"
 #include "atom.hpp"
@@ -33,48 +31,18 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/SelectionAction/AllAtomsAction.hpp"
 
+// and construct the stuff
+#include "AllAtomsAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+Action::state_ptr SelectionAllAtomsAction::performCall() {
+  // obtain information
+  getParametersfromValueStorage();
 
-// memento to remember the state when undoing
-
-class SelectionAllAtomsState : public ActionState {
-public:
-  SelectionAllAtomsState(std::vector<atom*> _selectedAtoms) :
-    selectedAtoms(_selectedAtoms)
-  {}
-  std::vector<atom*> selectedAtoms;
-};
-
-const char SelectionAllAtomsAction::NAME[] = "select-all-atoms";
-
-SelectionAllAtomsAction::SelectionAllAtomsAction() :
-  Action(NAME)
-{}
-
-SelectionAllAtomsAction::~SelectionAllAtomsAction()
-{}
-
-void SelectionAllAtoms() {
-  ActionRegistry::getInstance().getActionByName(SelectionAllAtomsAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionAllAtomsAction::getParametersfromValueStorage()
-{};
-
-Dialog* SelectionAllAtomsAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME));
-
-  return dialog;
-}
-
-Action::state_ptr SelectionAllAtomsAction::performCall() {
   std::vector<atom *> selectedAtoms = World::getInstance().getSelectedAtoms();
   DoLog(1) && (Log() << Verbose(1) << "Selecting all atoms." << endl);
   World::getInstance().selectAllAtoms(AllAtoms());
-  return Action::state_ptr(new SelectionAllAtomsState(selectedAtoms));
+  return Action::state_ptr(new SelectionAllAtomsState(selectedAtoms,params));
 }
 
@@ -86,13 +54,13 @@
     World::getInstance().selectAtom(*iter);
 
-  return Action::state_ptr(new SelectionAllAtomsState(state->selectedAtoms));
+  return Action::state_ptr(_state);
 }
 
 Action::state_ptr SelectionAllAtomsAction::performRedo(Action::state_ptr _state){
-  SelectionAllAtomsState *state = assert_cast<SelectionAllAtomsState*>(_state.get());
+  //SelectionAllAtomsState *state = assert_cast<SelectionAllAtomsState*>(_state.get());
 
   World::getInstance().selectAllAtoms(AllAtoms());
 
-  return Action::state_ptr(new SelectionAllAtomsState(state->selectedAtoms));
+  return Action::state_ptr(_state);
 }
 
@@ -108,2 +76,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/AllAtomsAction.def
===================================================================
--- src/Actions/SelectionAction/AllAtomsAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
+++ src/Actions/SelectionAction/AllAtomsAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -0,0 +1,25 @@
+/*
+ * AllAtomsAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#undef paramtypes
+#undef paramtokens
+#undef paramreferences
+
+#define statetypes (std::vector<atom*>)
+#define statereferences (selectedAtoms)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define ACTIONNAME AllAtoms
+#define TOKEN "select-all-atoms"
+
Index: src/Actions/SelectionAction/AllAtomsAction.hpp
===================================================================
--- src/Actions/SelectionAction/AllAtomsAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/AllAtomsAction.hpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -11,27 +11,6 @@
 #include "Actions/Action.hpp"
 
-void SelectionAllAtoms();
-
-class SelectionAllAtomsAction : public Action {
-  friend void SelectionAllAtoms();
-
-public:
-  SelectionAllAtomsAction();
-  virtual ~SelectionAllAtomsAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog *dialog);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "AllAtomsAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* ALLATOMSACTION_HPP_ */
Index: src/Actions/SelectionAction/AllAtomsInsideCuboidAction.cpp
===================================================================
--- src/Actions/SelectionAction/AllAtomsInsideCuboidAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/AllAtomsInsideCuboidAction.cpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/SelectionAction/AllAtomsInsideCuboidAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "Descriptors/AtomDescriptor.hpp"
 #include "Descriptors/AtomShapeDescriptor.hpp"
@@ -39,89 +37,23 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/SelectionAction/AllAtomsInsideCuboidAction.hpp"
 
-
-// memento to remember the state when undoing
-
-class SelectionAllAtomsInsideCuboidState : public ActionState {
-public:
-  SelectionAllAtomsInsideCuboidState(std::vector<atom*> _selectedAtoms, const Vector &_position, const Vector &_extension, const double _Xangle, const double _Yangle, const double _Zangle) :
-    selectedAtoms(_selectedAtoms),
-    position(_position),
-    extension(_extension),
-    Xangle(_Xangle),
-    Yangle(_Yangle),
-    Zangle(_Zangle)
-  {}
-  std::vector<atom*> selectedAtoms;
-  Vector position;
-  Vector extension;
-  double Xangle;
-  double Yangle;
-  double Zangle;
-};
-
-const char SelectionAllAtomsInsideCuboidAction::NAME[] = "select-atoms-inside-cuboid";
-
-SelectionAllAtomsInsideCuboidAction::SelectionAllAtomsInsideCuboidAction() :
-  Action(NAME)
-{}
-
-SelectionAllAtomsInsideCuboidAction::~SelectionAllAtomsInsideCuboidAction()
-{}
-
-void SelectionAllAtomsInsideCuboid(const Vector &position, const Vector &extension) {
-  ValueStorage::getInstance().setCurrentValue(SelectionAllAtomsInsideCuboidAction::NAME, extension);
-  ValueStorage::getInstance().setCurrentValue("position", position);
-  ActionRegistry::getInstance().getActionByName(SelectionAllAtomsInsideCuboidAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionAllAtomsInsideCuboid(const Vector &position, const Vector &extension, const double Xangle, const double Yangle, const double Zangle) {
-  ValueStorage::getInstance().setCurrentValue(SelectionAllAtomsInsideCuboidAction::NAME, extension);
-  ValueStorage::getInstance().setCurrentValue("position", position);
-  ValueStorage::getInstance().setCurrentValue("angle-x", Xangle);
-  ValueStorage::getInstance().setCurrentValue("angle-y", Yangle);
-  ValueStorage::getInstance().setCurrentValue("angle-z", Zangle);
-  ActionRegistry::getInstance().getActionByName(SelectionAllAtomsInsideCuboidAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionAllAtomsInsideCuboidAction::getParametersfromValueStorage()
-{};
-
-Dialog* SelectionAllAtomsInsideCuboidAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryVector(NAME, false, ValueStorage::getInstance().getDescription(NAME));
-  dialog->queryVector("position", false, ValueStorage::getInstance().getDescription("position"));
-
-  return dialog;
-}
-
+// and construct the stuff
+#include "AllAtomsInsideCuboidAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
 Action::state_ptr SelectionAllAtomsInsideCuboidAction::performCall() {
   std::vector<atom *> selectedAtoms = World::getInstance().getSelectedAtoms();
-  Vector position;
-  Vector extension;
-  double Xangle = 0.;
-  double Yangle = 0.;
-  double Zangle = 0.;
   Matrix RotationMatrix;
 
-  ValueStorage::getInstance().queryCurrentValue("position", position);
-  ValueStorage::getInstance().queryCurrentValue(NAME, extension);
-  // check whether a rotation is given.
-  if (ValueStorage::getInstance().queryCurrentValue("angle-x", Xangle, true))
-    Xangle = 0.;
-  if (ValueStorage::getInstance().queryCurrentValue("angle-y", Yangle, true))
-    Yangle = 0.;
-  if (ValueStorage::getInstance().queryCurrentValue("angle-z", Zangle, true))
-    Zangle = 0.;
-  RotationMatrix.rotation(Xangle, Yangle, Zangle);
+  // obtain information
+  getParametersfromValueStorage();
 
-  DoLog(1) && (Log() << Verbose(1) << "Selecting all atoms inside a rotated " << RotationMatrix << " cuboid at " << position << " and extension of " << extension << "." << endl);
-  Shape s = translate(transform(stretch(Cuboid(),extension),RotationMatrix),position);
+  RotationMatrix.rotation(params.Xangle, params.Yangle, params.Zangle);
+
+  DoLog(1) && (Log() << Verbose(1) << "Selecting all atoms inside a rotated " << RotationMatrix << " cuboid at " << params.position << " and extension of " << params.extension << "." << endl);
+  Shape s = translate(transform(stretch(Cuboid(),params.extension),RotationMatrix),params.position);
   World::getInstance().selectAllAtoms(AtomByShape(s));
-  return Action::state_ptr(new SelectionAllAtomsInsideCuboidState(selectedAtoms, position, extension, Xangle, Yangle, Zangle));
+  return Action::state_ptr(new SelectionAllAtomsInsideCuboidState(selectedAtoms, params));
 }
 
@@ -140,6 +72,6 @@
   Matrix RotationMatrix;
 
-  RotationMatrix.rotation(state->Xangle, state->Yangle, state->Zangle);
-  Shape s = translate(transform(stretch(Cuboid(),state->extension),RotationMatrix),state->position);
+  RotationMatrix.rotation(state->params.Xangle, state->params.Yangle, state->params.Zangle);
+  Shape s = translate(transform(stretch(Cuboid(),state->params.extension),RotationMatrix),state->params.position);
   World::getInstance().selectAllAtoms(AtomByShape(s));
 
@@ -158,2 +90,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/AllAtomsInsideCuboidAction.def
===================================================================
--- src/Actions/SelectionAction/AllAtomsInsideCuboidAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
+++ src/Actions/SelectionAction/AllAtomsInsideCuboidAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -0,0 +1,25 @@
+/*
+ * AllAtomsInsideCuboidAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+class Vector;
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#define paramtypes (Vector) (Vector) (double) (double) (double)
+#define paramtokens (SelectionAllAtomsInsideCuboidAction::NAME) ("position") ("angle-x") ("angle-y") ("angle-z")
+#define paramreferences (extension) (position) (Xangle) (Yangle) (Zangle)
+
+#define statetypes (std::vector<atom*>)
+#define statereferences (selectedAtoms)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define ACTIONNAME AllAtomsInsideCuboid
+#define TOKEN "select-atoms-inside-cuboid"
+
Index: src/Actions/SelectionAction/AllAtomsInsideCuboidAction.hpp
===================================================================
--- src/Actions/SelectionAction/AllAtomsInsideCuboidAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/AllAtomsInsideCuboidAction.hpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -11,30 +11,6 @@
 #include "Actions/Action.hpp"
 
-class Vector;
-
-void SelectionAllAtomsInsideCuboid();
-
-class SelectionAllAtomsInsideCuboidAction : public Action {
-  friend void SelectionAllAtomsInsideCuboid(const Vector &position, const Vector &extension);
-  friend void SelectionAllAtomsInsideCuboid(const Vector &position, const Vector &extension, const double Xangle, const double Yangle, const double Zangle);
-
-public:
-  SelectionAllAtomsInsideCuboidAction();
-  virtual ~SelectionAllAtomsInsideCuboidAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog *dialog);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "AllAtomsInsideCuboidAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* ALLATOMSINSIDECUBOIDACTION_HPP_ */
Index: src/Actions/SelectionAction/AllAtomsInsideSphereAction.cpp
===================================================================
--- src/Actions/SelectionAction/AllAtomsInsideSphereAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/AllAtomsInsideSphereAction.cpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/SelectionAction/AllAtomsInsideSphereAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "Descriptors/AtomDescriptor.hpp"
 #include "Descriptors/AtomShapeDescriptor.hpp"
@@ -38,62 +36,20 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/SelectionAction/AllAtomsInsideSphereAction.hpp"
 
-
-// memento to remember the state when undoing
-
-class SelectionAllAtomsInsideSphereState : public ActionState {
-public:
-  SelectionAllAtomsInsideSphereState(std::vector<atom*> _selectedAtoms, const Vector &_position, const double _radius) :
-    selectedAtoms(_selectedAtoms),
-    position(_position),
-    radius(_radius)
-  {}
-  std::vector<atom*> selectedAtoms;
-  Vector position;
-  double radius;
-};
-
-const char SelectionAllAtomsInsideSphereAction::NAME[] = "select-atoms-inside-sphere";
-
-SelectionAllAtomsInsideSphereAction::SelectionAllAtomsInsideSphereAction() :
-  Action(NAME)
-{}
-
-SelectionAllAtomsInsideSphereAction::~SelectionAllAtomsInsideSphereAction()
-{}
-
-void SelectionAllAtomsInsideSphere(const Vector &position, const double radius) {
-  ValueStorage::getInstance().setCurrentValue(SelectionAllAtomsInsideSphereAction::NAME, radius);
-  ValueStorage::getInstance().setCurrentValue("position", position);
-  ActionRegistry::getInstance().getActionByName(SelectionAllAtomsInsideSphereAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionAllAtomsInsideSphereAction::getParametersfromValueStorage()
-{};
-
-Dialog* SelectionAllAtomsInsideSphereAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryDouble(NAME, ValueStorage::getInstance().getDescription(NAME));
-  dialog->queryVector("position", false, ValueStorage::getInstance().getDescription("position"));
-
-  return dialog;
-}
-
+// and construct the stuff
+#include "AllAtomsInsideSphereAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
 Action::state_ptr SelectionAllAtomsInsideSphereAction::performCall() {
   std::vector<atom *> selectedAtoms = World::getInstance().getSelectedAtoms();
-  double radius = 0.;
-  Vector position;
 
-  ValueStorage::getInstance().queryCurrentValue(NAME, radius);
-  ValueStorage::getInstance().queryCurrentValue("position", position);
+  // obtain information
+  getParametersfromValueStorage();
 
-  DoLog(1) && (Log() << Verbose(1) << "Selecting all atoms inside a sphere at " << position << " with radius " << radius << "." << endl);
-  Shape s = translate(resize(Sphere(),radius),position);
+  DoLog(1) && (Log() << Verbose(1) << "Selecting all atoms inside a sphere at " << params.position << " with radius " << params.radius << "." << endl);
+  Shape s = translate(resize(Sphere(),params.radius),params.position);
   World::getInstance().selectAllAtoms(AtomByShape(s));
-  return Action::state_ptr(new SelectionAllAtomsInsideSphereState(selectedAtoms, position, radius));
+  return Action::state_ptr(new SelectionAllAtomsInsideSphereState(selectedAtoms, params));
 }
 
@@ -105,5 +61,5 @@
     World::getInstance().selectAtom(*iter);
 
-  return Action::state_ptr(new SelectionAllAtomsInsideSphereState(state->selectedAtoms, state->position, state->radius));
+  return Action::state_ptr(_state);
 }
 
@@ -111,8 +67,8 @@
   SelectionAllAtomsInsideSphereState *state = assert_cast<SelectionAllAtomsInsideSphereState*>(_state.get());
 
-  Shape s = translate(resize(Sphere(),state->radius),state->position);
+  Shape s = translate(resize(Sphere(),state->params.radius),state->params.position);
   World::getInstance().selectAllAtoms(AtomByShape(s));
 
-  return Action::state_ptr(new SelectionAllAtomsInsideSphereState(state->selectedAtoms, state->position, state->radius));
+  return Action::state_ptr(_state);
 }
 
@@ -128,2 +84,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/AllAtomsInsideSphereAction.def
===================================================================
--- src/Actions/SelectionAction/AllAtomsInsideSphereAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
+++ src/Actions/SelectionAction/AllAtomsInsideSphereAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -0,0 +1,25 @@
+/*
+ * AllAtomsInsideSphereAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+class Vector;
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#define paramtypes (double) (Vector)
+#define paramtokens (SelectionAllAtomsInsideSphereAction::NAME) ("position")
+#define paramreferences (radius) (position)
+
+#define statetypes (std::vector<atom*>)
+#define statereferences (selectedAtoms)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define ACTIONNAME AllAtomsInsideSphere
+#define TOKEN "select-atoms-inside-sphere"
+
Index: src/Actions/SelectionAction/AllAtomsInsideSphereAction.hpp
===================================================================
--- src/Actions/SelectionAction/AllAtomsInsideSphereAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/AllAtomsInsideSphereAction.hpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -11,29 +11,6 @@
 #include "Actions/Action.hpp"
 
-class Vector;
-
-void SelectionAllAtomsInsideSphere();
-
-class SelectionAllAtomsInsideSphereAction : public Action {
-  friend void SelectionAllAtomsInsideSphere(const Vector &position, const double radius);
-
-public:
-  SelectionAllAtomsInsideSphereAction();
-  virtual ~SelectionAllAtomsInsideSphereAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog *dialog);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "AllAtomsInsideSphereAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* ALLATOMSINSIDESPHEREACTION_HPP_ */
Index: src/Actions/SelectionAction/AllAtomsOfMoleculeAction.cpp
===================================================================
--- src/Actions/SelectionAction/AllAtomsOfMoleculeAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/AllAtomsOfMoleculeAction.cpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/SelectionAction/AllAtomsOfMoleculeAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "Descriptors/AtomDescriptor.hpp"
 #include "atom.hpp"
@@ -34,54 +32,19 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/SelectionAction/AllAtomsOfMoleculeAction.hpp"
 
-
-// memento to remember the state when undoing
-
-class SelectionAllAtomsOfMoleculeState : public ActionState {
-public:
-  SelectionAllAtomsOfMoleculeState(std::vector<atom*> _selectedAtoms, molecule *_mol) :
-    selectedAtoms(_selectedAtoms),
-    mol(_mol)
-  {}
-  std::vector<atom*> selectedAtoms;
-  molecule *mol;
-};
-
-const char SelectionAllAtomsOfMoleculeAction::NAME[] = "select-molecules-atoms";
-
-SelectionAllAtomsOfMoleculeAction::SelectionAllAtomsOfMoleculeAction() :
-  Action(NAME)
-{}
-
-SelectionAllAtomsOfMoleculeAction::~SelectionAllAtomsOfMoleculeAction()
-{}
-
-void SelectionAllAtomsOfMolecule() {
-  ActionRegistry::getInstance().getActionByName(SelectionAllAtomsOfMoleculeAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionAllAtomsOfMoleculeAction::getParametersfromValueStorage()
-{};
-
-Dialog* SelectionAllAtomsOfMoleculeAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryMolecule(NAME, ValueStorage::getInstance().getDescription(NAME));
-
-  return dialog;
-}
-
+// and construct the stuff
+#include "AllAtomsOfMoleculeAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
 Action::state_ptr SelectionAllAtomsOfMoleculeAction::performCall() {
-  molecule *mol = NULL;
   std::vector<atom *> selectedAtoms = World::getInstance().getSelectedAtoms();
 
-  ValueStorage::getInstance().queryCurrentValue(NAME, mol);
+  // obtain information
+  getParametersfromValueStorage();
 
-  DoLog(1) && (Log() << Verbose(1) << "Selecting all atoms of molecule " << mol->getName() << "." << endl);
-  World::getInstance().selectAtomsOfMolecule(mol);
-  return Action::state_ptr(new SelectionAllAtomsOfMoleculeState(selectedAtoms, mol));
+  DoLog(1) && (Log() << Verbose(1) << "Selecting all atoms of molecule " << params.mol->getName() << "." << endl);
+  World::getInstance().selectAtomsOfMolecule(params.mol);
+  return Action::state_ptr(new SelectionAllAtomsOfMoleculeState(selectedAtoms, params));
 }
 
@@ -93,5 +56,5 @@
     World::getInstance().selectAtom(*iter);
 
-  return Action::state_ptr(new SelectionAllAtomsOfMoleculeState(state->selectedAtoms, state->mol));
+  return Action::state_ptr(_state);
 }
 
@@ -99,7 +62,7 @@
   SelectionAllAtomsOfMoleculeState *state = assert_cast<SelectionAllAtomsOfMoleculeState*>(_state.get());
 
-  World::getInstance().selectAtomsOfMolecule(state->mol);
+  World::getInstance().selectAtomsOfMolecule(state->params.mol);
 
-  return Action::state_ptr(new SelectionAllAtomsOfMoleculeState(state->selectedAtoms, state->mol));
+  return Action::state_ptr(_state);
 }
 
@@ -115,2 +78,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/AllAtomsOfMoleculeAction.def
===================================================================
--- src/Actions/SelectionAction/AllAtomsOfMoleculeAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
+++ src/Actions/SelectionAction/AllAtomsOfMoleculeAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -0,0 +1,25 @@
+/*
+ * AllAtomsOfMoleculeAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+class molecule;
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#define paramtypes (molecule *)
+#define paramtokens (SelectionAllAtomsOfMoleculeAction::NAME)
+#define paramreferences (mol)
+
+#define statetypes (std::vector<atom*>)
+#define statereferences (selectedAtoms)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define ACTIONNAME AllAtomsOfMolecule
+#define TOKEN "select-molecules-atoms"
+
Index: src/Actions/SelectionAction/AllAtomsOfMoleculeAction.hpp
===================================================================
--- src/Actions/SelectionAction/AllAtomsOfMoleculeAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/AllAtomsOfMoleculeAction.hpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -11,27 +11,6 @@
 #include "Actions/Action.hpp"
 
-void SelectionAllAtomsOfMolecule();
-
-class SelectionAllAtomsOfMoleculeAction : public Action {
-  friend void SelectionAllAtomsOfMolecule();
-
-public:
-  SelectionAllAtomsOfMoleculeAction();
-  virtual ~SelectionAllAtomsOfMoleculeAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog *dialog);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "AllAtomsOfMoleculeAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* ALLATOMSOFMOLECULEACTION_HPP_ */
Index: src/Actions/SelectionAction/AllMoleculesAction.cpp
===================================================================
--- src/Actions/SelectionAction/AllMoleculesAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/AllMoleculesAction.cpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/SelectionAction/AllMoleculesAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "Descriptors/MoleculeDescriptor.hpp"
 #include "atom.hpp"
@@ -33,48 +31,18 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/SelectionAction/AllMoleculesAction.hpp"
 
+// and construct the stuff
+#include "AllMoleculesAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+Action::state_ptr SelectionAllMoleculesAction::performCall() {
+  // obtain information
+  getParametersfromValueStorage();
 
-// memento to remember the state when undoing
-
-class SelectionAllMoleculesState : public ActionState {
-public:
-  SelectionAllMoleculesState(std::vector<molecule*> selectedMolecules) :
-    selectedMolecules(selectedMolecules)
-  {}
-  std::vector<molecule*> selectedMolecules;
-};
-
-const char SelectionAllMoleculesAction::NAME[] = "select-all-molecules";
-
-SelectionAllMoleculesAction::SelectionAllMoleculesAction() :
-  Action(NAME)
-{}
-
-SelectionAllMoleculesAction::~SelectionAllMoleculesAction()
-{}
-
-void SelectionAllMolecules() {
-  ActionRegistry::getInstance().getActionByName(SelectionAllMoleculesAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionAllMoleculesAction::getParametersfromValueStorage()
-{};
-
-Dialog* SelectionAllMoleculesAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME));
-
-  return dialog;
-}
-
-Action::state_ptr SelectionAllMoleculesAction::performCall() {
   std::vector<molecule *> selectedMolecules = World::getInstance().getSelectedMolecules();
   DoLog(1) && (Log() << Verbose(1) << "Selecting all molecules." << endl);
   World::getInstance().selectAllMolecules(AllMolecules());
-  return Action::state_ptr(new SelectionAllMoleculesState(selectedMolecules));
+  return Action::state_ptr(new SelectionAllMoleculesState(selectedMolecules,params));
 }
 
@@ -86,13 +54,13 @@
     World::getInstance().selectMolecule(*iter);
 
-  return Action::state_ptr(new SelectionAllMoleculesState(state->selectedMolecules));
+  return Action::state_ptr(_state);
 }
 
 Action::state_ptr SelectionAllMoleculesAction::performRedo(Action::state_ptr _state){
-  SelectionAllMoleculesState *state = assert_cast<SelectionAllMoleculesState*>(_state.get());
+  //SelectionAllMoleculesState *state = assert_cast<SelectionAllMoleculesState*>(_state.get());
 
   World::getInstance().selectAllMolecules(AllMolecules());
 
-  return Action::state_ptr(new SelectionAllMoleculesState(state->selectedMolecules));
+  return Action::state_ptr(_state);
 }
 
@@ -108,2 +76,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/AllMoleculesAction.def
===================================================================
--- src/Actions/SelectionAction/AllMoleculesAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
+++ src/Actions/SelectionAction/AllMoleculesAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -0,0 +1,24 @@
+/*
+ * AllMoleculesAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#undef paramtypes
+#undef paramtokens
+#undef paramreferences
+
+#define statetypes (std::vector<molecule*>)
+#define statereferences (selectedMolecules)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define ACTIONNAME AllMolecules
+#define TOKEN "select-all-molecules"
+
Index: src/Actions/SelectionAction/AllMoleculesAction.hpp
===================================================================
--- src/Actions/SelectionAction/AllMoleculesAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/AllMoleculesAction.hpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -2,5 +2,5 @@
  * AllMoleculesAction.hpp
  *
- *  Created on: May 12, 2010
+ *  Created on: Aug 09, 2010
  *      Author: heber
  */
@@ -9,29 +9,9 @@
 #define ALLMOLECULESSACTION_HPP_
 
+
 #include "Actions/Action.hpp"
 
-void SelectionAllMolecules();
-
-class SelectionAllMoleculesAction : public Action {
-  friend void SelectionAllMolecules();
-
-public:
-  SelectionAllMoleculesAction();
-  virtual ~SelectionAllMoleculesAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog *dialog);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "AllMoleculesAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* ALLMOLECULESSACTION_HPP_ */
Index: src/Actions/SelectionAction/AtomByElementAction.cpp
===================================================================
--- src/Actions/SelectionAction/AtomByElementAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/AtomByElementAction.cpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/SelectionAction/AtomByElementAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "Descriptors/AtomTypeDescriptor.hpp"
 #include "atom.hpp"
@@ -34,55 +32,19 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/SelectionAction/AtomByElementAction.hpp"
 
-
-// memento to remember the state when undoing
-
-class SelectionAtomByElementState : public ActionState {
-public:
-  SelectionAtomByElementState(std::vector<atom*> _selectedAtoms, const element *_elemental) :
-    selectedAtoms(_selectedAtoms),
-    elemental(_elemental)
-  {}
-  std::vector<atom*> selectedAtoms;
-  const element *elemental;
-};
-
-const char SelectionAtomByElementAction::NAME[] = "select-atom-by-element";
-
-SelectionAtomByElementAction::SelectionAtomByElementAction() :
-  Action(NAME)
-{}
-
-SelectionAtomByElementAction::~SelectionAtomByElementAction()
-{}
-
-void SelectionAtomByElement(const element &_element) {
-  ValueStorage::getInstance().setCurrentValue(SelectionAtomByElementAction::NAME, _element);
-  ActionRegistry::getInstance().getActionByName(SelectionAtomByElementAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionAtomByElementAction::getParametersfromValueStorage()
-{};
-
-Dialog* SelectionAtomByElementAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryElement(NAME, ValueStorage::getInstance().getDescription(NAME));
-
-  return dialog;
-}
-
+// and construct the stuff
+#include "AtomByElementAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
 Action::state_ptr SelectionAtomByElementAction::performCall() {
-  const element *elemental;
   std::vector<atom *> selectedAtoms = World::getInstance().getSelectedAtoms();
 
-  ValueStorage::getInstance().queryCurrentValue(NAME, elemental);
+  // obtain information
+  getParametersfromValueStorage();
 
-  DoLog(1) && (Log() << Verbose(1) << "Selecting atoms of type " << *elemental << endl);
-  World::getInstance().selectAllAtoms(AtomByType(elemental));
-  return Action::state_ptr(new SelectionAtomByElementState(selectedAtoms,elemental));
+  DoLog(1) && (Log() << Verbose(1) << "Selecting atoms of type " << *params.elemental << endl);
+  World::getInstance().selectAllAtoms(AtomByType(params.elemental));
+  return Action::state_ptr(new SelectionAtomByElementState(selectedAtoms,params));
 }
 
@@ -100,5 +62,5 @@
   SelectionAtomByElementState *state = assert_cast<SelectionAtomByElementState*>(_state.get());
 
-  World::getInstance().selectAllAtoms(AtomByType(state->elemental));
+  World::getInstance().selectAllAtoms(AtomByType(state->params.elemental));
 
   return Action::state_ptr(_state);
@@ -116,2 +78,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/AtomByElementAction.def
===================================================================
--- src/Actions/SelectionAction/AtomByElementAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
+++ src/Actions/SelectionAction/AtomByElementAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -0,0 +1,25 @@
+/*
+ * AtomByElementAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+class element;
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#define paramtypes (const element*)
+#define paramtokens (SelectionAtomByElementAction::NAME)
+#define paramreferences (elemental)
+
+#define statetypes (std::vector<atom*>)
+#define statereferences (selectedAtoms)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define ACTIONNAME AtomByElement
+#define TOKEN "select-atom-by-element"
+
Index: src/Actions/SelectionAction/AtomByElementAction.hpp
===================================================================
--- src/Actions/SelectionAction/AtomByElementAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/AtomByElementAction.hpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -11,29 +11,6 @@
 #include "Actions/Action.hpp"
 
-class element;
-
-void SelectionAtomByElement(const element &_element);
-
-class SelectionAtomByElementAction : public Action {
-  friend void SelectionAtomByElement(const element &_element);
-
-public:
-  SelectionAtomByElementAction();
-  virtual ~SelectionAtomByElementAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog *dialog);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "AtomByElementAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* ATOMBYELEMENTACTION_HPP_ */
Index: src/Actions/SelectionAction/AtomByIdAction.cpp
===================================================================
--- src/Actions/SelectionAction/AtomByIdAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/AtomByIdAction.cpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/SelectionAction/AtomByIdAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "atom.hpp"
 #include "Helpers/Log.hpp"
@@ -32,53 +30,18 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/SelectionAction/AtomByIdAction.hpp"
 
+// and construct the stuff
+#include "AtomByIdAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+Action::state_ptr SelectionAtomByIdAction::performCall() {
+  // obtain information
+  getParametersfromValueStorage();
 
-// memento to remember the state when undoing
-
-class SelectionAtomByIdState : public ActionState {
-public:
-  SelectionAtomByIdState(atom* _walker) :
-    walker(_walker)
-  {}
-  atom* walker;
-};
-
-const char SelectionAtomByIdAction::NAME[] = "select-atom-by-id";
-
-SelectionAtomByIdAction::SelectionAtomByIdAction() :
-  Action(NAME)
-{}
-
-SelectionAtomByIdAction::~SelectionAtomByIdAction()
-{}
-
-void SelectionAtomById(atom *_atom) {
-  ValueStorage::getInstance().setCurrentValue(SelectionAtomByIdAction::NAME, _atom);
-  ActionRegistry::getInstance().getActionByName(SelectionAtomByIdAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionAtomByIdAction::getParametersfromValueStorage()
-{};
-
-Dialog* SelectionAtomByIdAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryAtom(NAME, ValueStorage::getInstance().getDescription(NAME));
-
-  return dialog;
-}
-
-Action::state_ptr SelectionAtomByIdAction::performCall() {
-  atom *Walker = NULL;
-
-  ValueStorage::getInstance().queryCurrentValue(NAME, Walker);
-
-  if (!World::getInstance().isSelected(Walker)) {
-    DoLog(1) && (Log() << Verbose(1) << "Selecting atom " << *Walker << endl);
-    World::getInstance().selectAtom(Walker);
-    return Action::state_ptr(new SelectionAtomByIdState(Walker));
+  if (!World::getInstance().isSelected(params.Walker)) {
+    DoLog(1) && (Log() << Verbose(1) << "Selecting atom " << *params.Walker << endl);
+    World::getInstance().selectAtom(params.Walker);
+    return Action::state_ptr(new SelectionAtomByIdState(params));
   } else {
     return Action::success;
@@ -89,8 +52,8 @@
   SelectionAtomByIdState *state = assert_cast<SelectionAtomByIdState*>(_state.get());
 
-  if (state->walker != NULL)
-    World::getInstance().unselectAtom(state->walker);
+  if (state->params.Walker != NULL)
+    World::getInstance().unselectAtom(state->params.Walker);
 
-  return Action::state_ptr(new SelectionAtomByIdState(state->walker));
+  return Action::state_ptr(_state);
 }
 
@@ -98,8 +61,8 @@
   SelectionAtomByIdState *state = assert_cast<SelectionAtomByIdState*>(_state.get());
 
-  if (state->walker != NULL)
-    World::getInstance().selectAtom(state->walker);
+  if (state->params.Walker != NULL)
+    World::getInstance().selectAtom(state->params.Walker);
 
-  return Action::state_ptr(new SelectionAtomByIdState(state->walker));
+  return Action::state_ptr(_state);
 }
 
@@ -115,2 +78,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/AtomByIdAction.def
===================================================================
--- src/Actions/SelectionAction/AtomByIdAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
+++ src/Actions/SelectionAction/AtomByIdAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -0,0 +1,25 @@
+/*
+ * AtomByIdAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+class atom;
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#define paramtypes (atom*)
+#define paramtokens (SelectionAtomByIdAction::NAME)
+#define paramreferences (Walker)
+
+#undef statetypes
+#undef statereferences
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define ACTIONNAME AtomById
+#define TOKEN "select-atom-by-id"
+
Index: src/Actions/SelectionAction/AtomByIdAction.hpp
===================================================================
--- src/Actions/SelectionAction/AtomByIdAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/AtomByIdAction.hpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -11,29 +11,6 @@
 #include "Actions/Action.hpp"
 
-class atom;
-
-void SelectionAtomById(atom *_atom);
-
-class SelectionAtomByIdAction : public Action {
-  friend void SelectionAtomById(atom *_atom);
-
-public:
-  SelectionAtomByIdAction();
-  virtual ~SelectionAtomByIdAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog *dialog);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "AtomByIdAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* ATOMBYIDACTION_HPP_ */
Index: src/Actions/SelectionAction/ClearAllAtomsAction.cpp
===================================================================
--- src/Actions/SelectionAction/ClearAllAtomsAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/ClearAllAtomsAction.cpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/SelectionAction/ClearAllAtomsAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "Descriptors/AtomDescriptor.hpp"
 #include "atom.hpp"
@@ -33,48 +31,18 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/SelectionAction/ClearAllAtomsAction.hpp"
 
+// and construct the stuff
+#include "ClearAllAtomsAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+Action::state_ptr SelectionClearAllAtomsAction::performCall() {
+  // obtain information
+  getParametersfromValueStorage();
 
-// memento to remember the state when undoing
-
-class SelectionClearAllAtomsState : public ActionState {
-public:
-  SelectionClearAllAtomsState(std::vector<atom*> _selectedAtoms) :
-    selectedAtoms(_selectedAtoms)
-  {}
-  std::vector<atom*> selectedAtoms;
-};
-
-const char SelectionClearAllAtomsAction::NAME[] = "clear-atom-selection";
-
-SelectionClearAllAtomsAction::SelectionClearAllAtomsAction() :
-  Action(NAME)
-{}
-
-SelectionClearAllAtomsAction::~SelectionClearAllAtomsAction()
-{}
-
-void SelectionClearAllAtoms() {
-  ActionRegistry::getInstance().getActionByName(SelectionClearAllAtomsAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionClearAllAtomsAction::getParametersfromValueStorage()
-{};
-
-Dialog* SelectionClearAllAtomsAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME));
-
-  return dialog;
-}
-
-Action::state_ptr SelectionClearAllAtomsAction::performCall() {
   std::vector<atom *> selectedAtoms = World::getInstance().getSelectedAtoms();
   DoLog(1) && (Log() << Verbose(1) << "Clearing atoms selection." << endl);
   World::getInstance().clearAtomSelection();
-  return Action::state_ptr(new SelectionClearAllAtomsState(selectedAtoms));
+  return Action::state_ptr(new SelectionClearAllAtomsState(selectedAtoms, params));
 }
 
@@ -86,13 +54,13 @@
     World::getInstance().selectAtom(*iter);
 
-  return Action::state_ptr(new SelectionClearAllAtomsState(state->selectedAtoms));
+  return Action::state_ptr(_state);
 }
 
 Action::state_ptr SelectionClearAllAtomsAction::performRedo(Action::state_ptr _state){
-  SelectionClearAllAtomsState *state = assert_cast<SelectionClearAllAtomsState*>(_state.get());
+  //SelectionClearAllAtomsState *state = assert_cast<SelectionClearAllAtomsState*>(_state.get());
 
   World::getInstance().clearAtomSelection();
 
-  return Action::state_ptr(new SelectionClearAllAtomsState(state->selectedAtoms));
+  return Action::state_ptr(_state);
 }
 
@@ -108,2 +76,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/ClearAllAtomsAction.def
===================================================================
--- src/Actions/SelectionAction/ClearAllAtomsAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
+++ src/Actions/SelectionAction/ClearAllAtomsAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -0,0 +1,24 @@
+/*
+ * ClearAllAtomsAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#undef paramtypes
+#undef paramtokens
+#undef paramreferences
+
+#define statetypes (std::vector<atom*>)
+#define statereferences (selectedAtoms)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define ACTIONNAME ClearAllAtoms
+#define TOKEN "clear-atom-selection"
+
Index: src/Actions/SelectionAction/ClearAllAtomsAction.hpp
===================================================================
--- src/Actions/SelectionAction/ClearAllAtomsAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/ClearAllAtomsAction.hpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -11,27 +11,6 @@
 #include "Actions/Action.hpp"
 
-void SelectionAllAtoms();
-
-class SelectionClearAllAtomsAction : public Action {
-  friend void SelectionClearAllAtoms();
-
-public:
-  SelectionClearAllAtomsAction();
-  virtual ~SelectionClearAllAtomsAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog *dialog);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "ClearAllAtomsAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* CLEARALLATOMSACTION_HPP_ */
Index: src/Actions/SelectionAction/ClearAllMoleculesAction.cpp
===================================================================
--- src/Actions/SelectionAction/ClearAllMoleculesAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/ClearAllMoleculesAction.cpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/SelectionAction/ClearAllMoleculesAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "Descriptors/MoleculeDescriptor.hpp"
 #include "atom.hpp"
@@ -33,48 +31,18 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/SelectionAction/ClearAllMoleculesAction.hpp"
 
+// and construct the stuff
+#include "ClearAllMoleculesAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+Action::state_ptr SelectionClearAllMoleculesAction::performCall() {
+  // obtain information
+  getParametersfromValueStorage();
 
-// memento to remember the state when undoing
-
-class SelectionClearAllMoleculesState : public ActionState {
-public:
-  SelectionClearAllMoleculesState(std::vector<molecule*> selectedMolecules) :
-    selectedMolecules(selectedMolecules)
-  {}
-  std::vector<molecule*> selectedMolecules;
-};
-
-const char SelectionClearAllMoleculesAction::NAME[] = "clear-molecule-selection";
-
-SelectionClearAllMoleculesAction::SelectionClearAllMoleculesAction() :
-  Action(NAME)
-{}
-
-SelectionClearAllMoleculesAction::~SelectionClearAllMoleculesAction()
-{}
-
-void SelectionClearAllMolecules() {
-  ActionRegistry::getInstance().getActionByName(SelectionClearAllMoleculesAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionClearAllMoleculesAction::getParametersfromValueStorage()
-{};
-
-Dialog* SelectionClearAllMoleculesAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME));
-
-  return dialog;
-}
-
-Action::state_ptr SelectionClearAllMoleculesAction::performCall() {
   std::vector<molecule *> selectedMolecules = World::getInstance().getSelectedMolecules();
   DoLog(1) && (Log() << Verbose(1) << "Clearing molecule selection." << endl);
   World::getInstance().clearMoleculeSelection();
-  return Action::state_ptr(new SelectionClearAllMoleculesState(selectedMolecules));
+  return Action::state_ptr(new SelectionClearAllMoleculesState(selectedMolecules,params));
 }
 
@@ -86,13 +54,13 @@
     World::getInstance().selectMolecule(*iter);
 
-  return Action::state_ptr(new SelectionClearAllMoleculesState(state->selectedMolecules));
+  return Action::state_ptr(_state);
 }
 
 Action::state_ptr SelectionClearAllMoleculesAction::performRedo(Action::state_ptr _state){
-  SelectionClearAllMoleculesState *state = assert_cast<SelectionClearAllMoleculesState*>(_state.get());
+  //SelectionClearAllMoleculesState *state = assert_cast<SelectionClearAllMoleculesState*>(_state.get());
 
   World::getInstance().clearMoleculeSelection();
 
-  return Action::state_ptr(new SelectionClearAllMoleculesState(state->selectedMolecules));
+  return Action::state_ptr(_state);
 }
 
@@ -108,2 +76,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/ClearAllMoleculesAction.def
===================================================================
--- src/Actions/SelectionAction/ClearAllMoleculesAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
+++ src/Actions/SelectionAction/ClearAllMoleculesAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -0,0 +1,24 @@
+/*
+ * ClearAllMoleculesAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#undef paramtypes
+#undef paramtokens
+#undef paramreferences
+
+#define statetypes (std::vector<molecule*>)
+#define statereferences (selectedMolecules)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define ACTIONNAME ClearAllMolecules
+#define TOKEN "clear-molecule-selection"
+
Index: src/Actions/SelectionAction/ClearAllMoleculesAction.hpp
===================================================================
--- src/Actions/SelectionAction/ClearAllMoleculesAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/ClearAllMoleculesAction.hpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -11,27 +11,6 @@
 #include "Actions/Action.hpp"
 
-void SelectionClearAllMolecules();
-
-class SelectionClearAllMoleculesAction : public Action {
-  friend void SelectionClearAllMolecules();
-
-public:
-  SelectionClearAllMoleculesAction();
-  virtual ~SelectionClearAllMoleculesAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog *dialog);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "ClearAllMoleculesAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* CLEARALLMOLECULESSACTION_HPP_ */
Index: src/Actions/SelectionAction/MoleculeByFormulaAction.cpp
===================================================================
--- src/Actions/SelectionAction/MoleculeByFormulaAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/MoleculeByFormulaAction.cpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/SelectionAction/MoleculeByFormulaAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "Descriptors/MoleculeFormulaDescriptor.hpp"
 #include "molecule.hpp"
@@ -33,59 +31,23 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/SelectionAction/MoleculeByFormulaAction.hpp"
 
-
-// memento to remember the state when undoing
-
-class SelectionMoleculeByFormulaState : public ActionState {
-public:
-  SelectionMoleculeByFormulaState(std::vector<molecule*> selectedMolecules, const std::string &_formula) :
-    selectedMolecules(selectedMolecules),
-    formula(_formula)
-  {}
-  std::vector<molecule*> selectedMolecules;
-  std::string formula;
-};
-
-const char SelectionMoleculeByFormulaAction::NAME[] = "select-molecule-by-formula";
-
-SelectionMoleculeByFormulaAction::SelectionMoleculeByFormulaAction() :
-  Action(NAME)
-{}
-
-SelectionMoleculeByFormulaAction::~SelectionMoleculeByFormulaAction()
-{}
-
-void SelectionMoleculeByFormula(const std::string &_formula) {
-  ValueStorage::getInstance().setCurrentValue(SelectionMoleculeByFormulaAction::NAME, _formula);
-  ActionRegistry::getInstance().getActionByName(SelectionMoleculeByFormulaAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionMoleculeByFormulaAction::getParametersfromValueStorage()
-{};
-
-Dialog* SelectionMoleculeByFormulaAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME));
-
-  return dialog;
-}
-
+// and construct the stuff
+#include "MoleculeByFormulaAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
 Action::state_ptr SelectionMoleculeByFormulaAction::performCall() {
-  std::string formula;
   std::vector<molecule *> selectedMolecules = World::getInstance().getSelectedMolecules();
 
-  ValueStorage::getInstance().queryCurrentValue(NAME, formula);
+  // obtain information
+  getParametersfromValueStorage();
 
-  DoLog(1) && (Log() << Verbose(1) << "Selecting molecules with chemical formula " << formula << ":" << endl);
-  std::vector<molecule *> matchingMolecules = World::getInstance().getAllMolecules(MoleculeByFormula(formula));
+  DoLog(1) && (Log() << Verbose(1) << "Selecting molecules with chemical formula " << params.formula << ":" << endl);
+  std::vector<molecule *> matchingMolecules = World::getInstance().getAllMolecules(MoleculeByFormula(params.formula));
   for (std::vector<molecule *>::const_iterator iter = matchingMolecules.begin(); iter != matchingMolecules.end(); ++iter) {
     DoLog(1) && (Log() << Verbose(1) << "\t" << (*iter)->getId() << ", " << (*iter)->getName() << "." << endl);
   }
-  World::getInstance().selectAllMolecules(MoleculeByFormula(formula));
-  return Action::state_ptr(new SelectionMoleculeByFormulaState(selectedMolecules,formula));
+  World::getInstance().selectAllMolecules(MoleculeByFormula(params.formula));
+  return Action::state_ptr(new SelectionMoleculeByFormulaState(selectedMolecules,params));
 }
 
@@ -103,5 +65,5 @@
   SelectionMoleculeByFormulaState *state = assert_cast<SelectionMoleculeByFormulaState*>(_state.get());
 
-  World::getInstance().selectAllMolecules(MoleculeByFormula(state->formula));
+  World::getInstance().selectAllMolecules(MoleculeByFormula(state->params.formula));
 
   return Action::state_ptr(_state);
@@ -119,2 +81,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/MoleculeByFormulaAction.def
===================================================================
--- src/Actions/SelectionAction/MoleculeByFormulaAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
+++ src/Actions/SelectionAction/MoleculeByFormulaAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -0,0 +1,25 @@
+/*
+ * MoleculeByFormulaAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+class molecule;
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#define paramtypes (std::string)
+#define paramtokens (SelectionMoleculeByFormulaAction::NAME)
+#define paramreferences (formula)
+
+#define statetypes (std::vector<molecule*>)
+#define statereferences (selectedMolecules)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define ACTIONNAME MoleculeByFormula
+#define TOKEN "select-molecule-by-formula"
+
Index: src/Actions/SelectionAction/MoleculeByFormulaAction.hpp
===================================================================
--- src/Actions/SelectionAction/MoleculeByFormulaAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/MoleculeByFormulaAction.hpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -11,29 +11,6 @@
 #include "Actions/Action.hpp"
 
-class molecule;
-
-void SelectionMoleculeByFormula(molecule *_mol);
-
-class SelectionMoleculeByFormulaAction : public Action {
-  friend void SelectionMoleculeByFormula(const std::string &_formula);
-
-public:
-  SelectionMoleculeByFormulaAction();
-  virtual ~SelectionMoleculeByFormulaAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog *dialog);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "MoleculeByFormulaAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* MOLECULEBYFORMULAACTION_HPP_ */
Index: src/Actions/SelectionAction/MoleculeByIdAction.cpp
===================================================================
--- src/Actions/SelectionAction/MoleculeByIdAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/MoleculeByIdAction.cpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/SelectionAction/MoleculeByIdAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "molecule.hpp"
 #include "Helpers/Log.hpp"
@@ -32,53 +30,18 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/SelectionAction/MoleculeByIdAction.hpp"
 
+// and construct the stuff
+#include "MoleculeByIdAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+Action::state_ptr SelectionMoleculeByIdAction::performCall() {
+  // obtain information
+  getParametersfromValueStorage();
 
-// memento to remember the state when undoing
-
-class SelectionMoleculeByIdState : public ActionState {
-public:
-  SelectionMoleculeByIdState(molecule* _mol) :
-    mol(_mol)
-  {}
-  molecule* mol;
-};
-
-const char SelectionMoleculeByIdAction::NAME[] = "select-molecule-by-id";
-
-SelectionMoleculeByIdAction::SelectionMoleculeByIdAction() :
-  Action(NAME)
-{}
-
-SelectionMoleculeByIdAction::~SelectionMoleculeByIdAction()
-{}
-
-void SelectionMoleculeById(molecule *_mol) {
-  ValueStorage::getInstance().setCurrentValue(SelectionMoleculeByIdAction::NAME, _mol);
-  ActionRegistry::getInstance().getActionByName(SelectionMoleculeByIdAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionMoleculeByIdAction::getParametersfromValueStorage()
-{};
-
-Dialog* SelectionMoleculeByIdAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryMolecule(NAME, ValueStorage::getInstance().getDescription(NAME));
-
-  return dialog;
-}
-
-Action::state_ptr SelectionMoleculeByIdAction::performCall() {
-  molecule *mol = NULL;
-
-  ValueStorage::getInstance().queryCurrentValue(NAME, mol);
-
-  if (!World::getInstance().isSelected(mol)) {
-    DoLog(1) && (Log() << Verbose(1) << "Selecting molecule " << mol->name << endl);
-    World::getInstance().selectMolecule(mol);
-    return Action::state_ptr(new SelectionMoleculeByIdState(mol));
+  if (!World::getInstance().isSelected(params.mol)) {
+    DoLog(1) && (Log() << Verbose(1) << "Selecting molecule " << params.mol->name << endl);
+    World::getInstance().selectMolecule(params.mol);
+    return Action::state_ptr(new SelectionMoleculeByIdState(params));
   } else {
     return Action::success;
@@ -89,8 +52,8 @@
   SelectionMoleculeByIdState *state = assert_cast<SelectionMoleculeByIdState*>(_state.get());
 
-  if (state->mol != NULL)
-    World::getInstance().unselectMolecule(state->mol);
+  if (state->params.mol != NULL)
+    World::getInstance().unselectMolecule(state->params.mol);
 
-  return Action::state_ptr(new SelectionMoleculeByIdState(state->mol));
+  return Action::state_ptr(_state);
 }
 
@@ -98,8 +61,8 @@
   SelectionMoleculeByIdState *state = assert_cast<SelectionMoleculeByIdState*>(_state.get());
 
-  if (state->mol != NULL)
-    World::getInstance().selectMolecule(state->mol);
+  if (state->params.mol != NULL)
+    World::getInstance().selectMolecule(state->params.mol);
 
-  return Action::state_ptr(new SelectionMoleculeByIdState(state->mol));
+  return Action::state_ptr(state);
 }
 
@@ -115,2 +78,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/MoleculeByIdAction.def
===================================================================
--- src/Actions/SelectionAction/MoleculeByIdAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
+++ src/Actions/SelectionAction/MoleculeByIdAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -0,0 +1,25 @@
+/*
+ * MoleculeByIdAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+class molecule;
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#define paramtypes (molecule*)
+#define paramtokens (SelectionMoleculeByIdAction::NAME)
+#define paramreferences (mol)
+
+#undef statetypes
+#undef statereferences
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define ACTIONNAME MoleculeById
+#define TOKEN "select-molecule-by-id"
+
Index: src/Actions/SelectionAction/MoleculeByIdAction.hpp
===================================================================
--- src/Actions/SelectionAction/MoleculeByIdAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/MoleculeByIdAction.hpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -11,29 +11,6 @@
 #include "Actions/Action.hpp"
 
-class molecule;
-
-void SelectionMoleculeById(molecule *_mol);
-
-class SelectionMoleculeByIdAction : public Action {
-  friend void SelectionMoleculeById(molecule *_mol);
-
-public:
-  SelectionMoleculeByIdAction();
-  virtual ~SelectionMoleculeByIdAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog *dialog);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "MoleculeByIdAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* MOLECULEBYIDACTION_HPP_ */
Index: src/Actions/SelectionAction/MoleculeOfAtomAction.cpp
===================================================================
--- src/Actions/SelectionAction/MoleculeOfAtomAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/MoleculeOfAtomAction.cpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/SelectionAction/MoleculeOfAtomAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "Descriptors/MoleculeDescriptor.hpp"
 #include "atom.hpp"
@@ -33,54 +31,18 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/SelectionAction/MoleculeOfAtomAction.hpp"
 
-
-// memento to remember the state when undoing
-
-class SelectionMoleculeOfAtomState : public ActionState {
-public:
-  SelectionMoleculeOfAtomState(std::vector<molecule*> selectedMolecules, atom *_Walker) :
-    selectedMolecules(selectedMolecules),
-    Walker(_Walker)
-  {}
-  std::vector<molecule*> selectedMolecules;
-  atom *Walker;
-};
-
-const char SelectionMoleculeOfAtomAction::NAME[] = "select-molecule-of-atom";
-
-SelectionMoleculeOfAtomAction::SelectionMoleculeOfAtomAction() :
-  Action(NAME)
-{}
-
-SelectionMoleculeOfAtomAction::~SelectionMoleculeOfAtomAction()
-{}
-
-void SelectionMoleculeOfAtom() {
-  ActionRegistry::getInstance().getActionByName(SelectionMoleculeOfAtomAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionMoleculeOfAtomAction::getParametersfromValueStorage()
-{};
-
-Dialog* SelectionMoleculeOfAtomAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryAtom(NAME, ValueStorage::getInstance().getDescription(NAME));
-
-  return dialog;
-}
-
+// and construct the stuff
+#include "MoleculeOfAtomAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
 Action::state_ptr SelectionMoleculeOfAtomAction::performCall() {
-  atom *Walker = NULL;
-
-  ValueStorage::getInstance().queryCurrentValue(NAME, Walker);
+  // obtain information
+  getParametersfromValueStorage();
 
   std::vector<molecule *> selectedMolecules = World::getInstance().getSelectedMolecules();
-  DoLog(1) && (Log() << Verbose(1) << "Selecting molecule to which " << Walker->getName() << " belongs." << endl);
-  World::getInstance().selectMoleculeOfAtom(Walker);
-  return Action::state_ptr(new SelectionMoleculeOfAtomState(selectedMolecules, Walker));
+  DoLog(1) && (Log() << Verbose(1) << "Selecting molecule to which " << params.Walker->getName() << " belongs." << endl);
+  World::getInstance().selectMoleculeOfAtom(params.Walker);
+  return Action::state_ptr(new SelectionMoleculeOfAtomState(selectedMolecules, params));
 }
 
@@ -92,5 +54,5 @@
     World::getInstance().selectMolecule(*iter);
 
-  return Action::state_ptr(new SelectionMoleculeOfAtomState(state->selectedMolecules, state->Walker));
+  return Action::state_ptr(_state);
 }
 
@@ -98,7 +60,7 @@
   SelectionMoleculeOfAtomState *state = assert_cast<SelectionMoleculeOfAtomState*>(_state.get());
 
-  World::getInstance().selectMoleculeOfAtom(state->Walker);
+  World::getInstance().selectMoleculeOfAtom(state->params.Walker);
 
-  return Action::state_ptr(new SelectionMoleculeOfAtomState(state->selectedMolecules, state->Walker));
+  return Action::state_ptr(_state);
 }
 
@@ -114,2 +76,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/MoleculeOfAtomAction.def
===================================================================
--- src/Actions/SelectionAction/MoleculeOfAtomAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
+++ src/Actions/SelectionAction/MoleculeOfAtomAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -0,0 +1,24 @@
+/*
+ * MoleculeOfAtomAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#define paramtypes (atom*)
+#define paramtokens (SelectionMoleculeOfAtomAction::NAME)
+#define paramreferences (Walker)
+
+#define statetypes (std::vector<molecule*>)
+#define statereferences (selectedMolecules)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define ACTIONNAME MoleculeOfAtom
+#define TOKEN "select-molecule-of-atom"
+
Index: src/Actions/SelectionAction/MoleculeOfAtomAction.hpp
===================================================================
--- src/Actions/SelectionAction/MoleculeOfAtomAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/MoleculeOfAtomAction.hpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -11,27 +11,6 @@
 #include "Actions/Action.hpp"
 
-void SelectionMoleculeOfAtom();
-
-class SelectionMoleculeOfAtomAction : public Action {
-  friend void SelectionMoleculeOfAtom();
-
-public:
-  SelectionMoleculeOfAtomAction();
-  virtual ~SelectionMoleculeOfAtomAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog *dialog);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "MoleculeOfAtomAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* MOLECULEOFATOMSACTION_HPP_ */
Index: src/Actions/SelectionAction/NotAllAtomsAction.cpp
===================================================================
--- src/Actions/SelectionAction/NotAllAtomsAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/NotAllAtomsAction.cpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/SelectionAction/NotAllAtomsAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "Descriptors/AtomDescriptor.hpp"
 #include "atom.hpp"
@@ -33,48 +31,18 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/SelectionAction/NotAllAtomsAction.hpp"
 
+// and construct the stuff
+#include "NotAllAtomsAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+Action::state_ptr SelectionNotAllAtomsAction::performCall() {
+  // obtain information
+  getParametersfromValueStorage();
 
-// memento to remember the state when undoing
-
-class SelectionNotAllAtomsState : public ActionState {
-public:
-  SelectionNotAllAtomsState(std::vector<atom*> _selectedAtoms) :
-    selectedAtoms(_selectedAtoms)
-  {}
-  std::vector<atom*> selectedAtoms;
-};
-
-const char SelectionNotAllAtomsAction::NAME[] = "unselect-all-atoms";
-
-SelectionNotAllAtomsAction::SelectionNotAllAtomsAction() :
-  Action(NAME)
-{}
-
-SelectionNotAllAtomsAction::~SelectionNotAllAtomsAction()
-{}
-
-void SelectionNotAllAtoms() {
-  ActionRegistry::getInstance().getActionByName(SelectionNotAllAtomsAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionNotAllAtomsAction::getParametersfromValueStorage()
-{};
-
-Dialog* SelectionNotAllAtomsAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME));
-
-  return dialog;
-}
-
-Action::state_ptr SelectionNotAllAtomsAction::performCall() {
   std::vector<atom *> selectedAtoms = World::getInstance().getSelectedAtoms();
   DoLog(1) && (Log() << Verbose(1) << "Unselecting all atoms." << endl);
   World::getInstance().clearAtomSelection();
-  return Action::state_ptr(new SelectionNotAllAtomsState(selectedAtoms));
+  return Action::state_ptr(new SelectionNotAllAtomsState(selectedAtoms, params));
 }
 
@@ -86,13 +54,13 @@
     World::getInstance().selectAtom(*iter);
 
-  return Action::state_ptr(new SelectionNotAllAtomsState(state->selectedAtoms));
+  return Action::state_ptr(_state);
 }
 
 Action::state_ptr SelectionNotAllAtomsAction::performRedo(Action::state_ptr _state){
-  SelectionNotAllAtomsState *state = assert_cast<SelectionNotAllAtomsState*>(_state.get());
+  //SelectionNotAllAtomsState *state = assert_cast<SelectionNotAllAtomsState*>(_state.get());
 
   World::getInstance().clearAtomSelection();
 
-  return Action::state_ptr(new SelectionNotAllAtomsState(state->selectedAtoms));
+  return Action::state_ptr(_state);
 }
 
@@ -108,2 +76,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/NotAllAtomsAction.def
===================================================================
--- src/Actions/SelectionAction/NotAllAtomsAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
+++ src/Actions/SelectionAction/NotAllAtomsAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -0,0 +1,25 @@
+/*
+ * NotAllAtomsAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#undef paramtypes
+#undef paramtokens
+#undef paramreferences
+
+#define statetypes (std::vector<atom*>)
+#define statereferences (selectedAtoms)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define ACTIONNAME NotAllAtoms
+#define TOKEN "unselect-all-atoms"
+
Index: src/Actions/SelectionAction/NotAllAtomsAction.hpp
===================================================================
--- src/Actions/SelectionAction/NotAllAtomsAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/NotAllAtomsAction.hpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -11,27 +11,6 @@
 #include "Actions/Action.hpp"
 
-void SelectionNotAllAtoms();
-
-class SelectionNotAllAtomsAction : public Action {
-  friend void SelectionNotAllAtoms();
-
-public:
-  SelectionNotAllAtomsAction();
-  virtual ~SelectionNotAllAtomsAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog *dialog);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "NotAllAtomsAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* NOTALLATOMSACTION_HPP_ */
Index: src/Actions/SelectionAction/NotAllAtomsInsideCuboidAction.cpp
===================================================================
--- src/Actions/SelectionAction/NotAllAtomsInsideCuboidAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/NotAllAtomsInsideCuboidAction.cpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/SelectionAction/NotAllAtomsInsideCuboidAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "Descriptors/AtomDescriptor.hpp"
 #include "Descriptors/AtomShapeDescriptor.hpp"
@@ -39,90 +37,23 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/SelectionAction/NotAllAtomsInsideCuboidAction.hpp"
 
-
-// memento to remember the state when undoing
-
-class SelectionNotAllAtomsInsideCuboidState : public ActionState {
-public:
-  SelectionNotAllAtomsInsideCuboidState(std::vector<atom*> _selectedAtoms, const Vector &_position, const Vector &_extension, const double _Xangle, const double _Yangle, const double _Zangle) :
-    selectedAtoms(_selectedAtoms),
-    position(_position),
-    extension(_extension),
-    Xangle(_Xangle),
-    Yangle(_Yangle),
-    Zangle(_Zangle)
-  {}
-  std::vector<atom*> selectedAtoms;
-  Vector position;
-  Vector extension;
-  double Xangle;
-  double Yangle;
-  double Zangle;
-};
-
-const char SelectionNotAllAtomsInsideCuboidAction::NAME[] = "unselect-atoms-inside-cuboid";
-
-SelectionNotAllAtomsInsideCuboidAction::SelectionNotAllAtomsInsideCuboidAction() :
-  Action(NAME)
-{}
-
-SelectionNotAllAtomsInsideCuboidAction::~SelectionNotAllAtomsInsideCuboidAction()
-{}
-
-void SelectionNotAllAtomsInsideCuboid(const Vector &position, const Vector &extension) {
-  ValueStorage::getInstance().setCurrentValue(SelectionNotAllAtomsInsideCuboidAction::NAME, extension);
-  ValueStorage::getInstance().setCurrentValue("position", position);
-  ActionRegistry::getInstance().getActionByName(SelectionNotAllAtomsInsideCuboidAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionNotAllAtomsInsideCuboid(const Vector &position, const Vector &extension, const double Xangle, const double Yangle, const double Zangle) {
-  ValueStorage::getInstance().setCurrentValue(SelectionNotAllAtomsInsideCuboidAction::NAME, extension);
-  ValueStorage::getInstance().setCurrentValue("position", position);
-  ValueStorage::getInstance().setCurrentValue("angle-x", Xangle);
-  ValueStorage::getInstance().setCurrentValue("angle-y", Yangle);
-  ValueStorage::getInstance().setCurrentValue("angle-z", Zangle);
-  ActionRegistry::getInstance().getActionByName(SelectionNotAllAtomsInsideCuboidAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionNotAllAtomsInsideCuboidAction::getParametersfromValueStorage()
-{};
-
-Dialog* SelectionNotAllAtomsInsideCuboidAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryVector(NAME, false, ValueStorage::getInstance().getDescription(NAME));
-  dialog->queryVector("position", false, ValueStorage::getInstance().getDescription("position"));
-
-  return dialog;
-}
-
+// and construct the stuff
+#include "NotAllAtomsInsideCuboidAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
 Action::state_ptr SelectionNotAllAtomsInsideCuboidAction::performCall() {
   std::vector<atom *> selectedAtoms = World::getInstance().getSelectedAtoms();
-  Vector position;
-  Vector extension;
-  double Xangle = 0.;
-  double Yangle = 0.;
-  double Zangle = 0.;
   Matrix RotationMatrix;
 
-  ValueStorage::getInstance().queryCurrentValue("position", position);
-  ValueStorage::getInstance().queryCurrentValue(NAME, extension);
-  // check whether a rotation is given.
-  if (ValueStorage::getInstance().queryCurrentValue("angle-x", Xangle, true))
-    Xangle = 0.;
-  if (ValueStorage::getInstance().queryCurrentValue("angle-y", Yangle, true))
-    Yangle = 0.;
-  if (ValueStorage::getInstance().queryCurrentValue("angle-z", Zangle, true))
-    Zangle = 0.;
-  RotationMatrix.rotation(Xangle, Yangle, Zangle);
+  // obtain information
+  getParametersfromValueStorage();
+  RotationMatrix.rotation(params.Xangle, params.Yangle, params.Zangle);
 
-  DoLog(1) && (Log() << Verbose(1) << "Unselecting all atoms inside a rotated " << RotationMatrix << " cuboid at " << position << " and extension of " << extension << "." << endl);
-  Shape s = translate(transform(stretch(Cuboid(),extension),RotationMatrix),position);
+  DoLog(1) && (Log() << Verbose(1) << "Unselecting all atoms inside a rotated " << RotationMatrix << " cuboid at " << params.position << " and extension of " << params.extension << "." << endl);
+  Shape s = translate(transform(stretch(Cuboid(),params.extension),RotationMatrix),params.position);
 
   World::getInstance().unselectAllAtoms(AtomByShape(s));
-  return Action::state_ptr(new SelectionNotAllAtomsInsideCuboidState(selectedAtoms, position, extension, Xangle, Yangle, Zangle));
+  return Action::state_ptr(new SelectionNotAllAtomsInsideCuboidState(selectedAtoms, params));
 }
 
@@ -141,6 +72,6 @@
   Matrix RotationMatrix;
 
-  RotationMatrix.rotation(state->Xangle, state->Yangle, state->Zangle);
-  Shape s = translate(transform(stretch(Cuboid(),state->extension),RotationMatrix),state->position);
+  RotationMatrix.rotation(state->params.Xangle, state->params.Yangle, state->params.Zangle);
+  Shape s = translate(transform(stretch(Cuboid(),state->params.extension),RotationMatrix),state->params.position);
   World::getInstance().unselectAllAtoms(AtomByShape(s));
 
@@ -159,2 +90,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/NotAllAtomsInsideCuboidAction.def
===================================================================
--- src/Actions/SelectionAction/NotAllAtomsInsideCuboidAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
+++ src/Actions/SelectionAction/NotAllAtomsInsideCuboidAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -0,0 +1,25 @@
+/*
+ * NotAllAtomsInsideCuboidAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+class Vector;
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#define paramtypes (Vector) (Vector) (double) (double) (double)
+#define paramtokens (SelectionNotAllAtomsInsideCuboidAction::NAME) ("position") ("angle-x") ("angle-y") ("angle-z")
+#define paramreferences (extension) (position) (Xangle) (Yangle) (Zangle)
+
+#define statetypes (std::vector<atom*>)
+#define statereferences (selectedAtoms)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define ACTIONNAME NotAllAtomsInsideCuboid
+#define TOKEN "unselect-atoms-inside-cuboid"
+
Index: src/Actions/SelectionAction/NotAllAtomsInsideCuboidAction.hpp
===================================================================
--- src/Actions/SelectionAction/NotAllAtomsInsideCuboidAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/NotAllAtomsInsideCuboidAction.hpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -11,30 +11,6 @@
 #include "Actions/Action.hpp"
 
-class Vector;
-
-void SelectionNotAllAtomsInsideCuboid();
-
-class SelectionNotAllAtomsInsideCuboidAction : public Action {
-  friend void SelectionNotAllAtomsInsideCuboid(const Vector &position, const Vector &extension);
-  friend void SelectionNotAllAtomsInsideCuboid(const Vector &position, const Vector &extension, const double Xangle, const double Yangle, const double Zangle);
-
-public:
-  SelectionNotAllAtomsInsideCuboidAction();
-  virtual ~SelectionNotAllAtomsInsideCuboidAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog *dialog);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "NotAllAtomsInsideCuboidAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* NOTALLATOMSINSIDECUBOIDACTION_HPP_ */
Index: src/Actions/SelectionAction/NotAllAtomsInsideSphereAction.cpp
===================================================================
--- src/Actions/SelectionAction/NotAllAtomsInsideSphereAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/NotAllAtomsInsideSphereAction.cpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/SelectionAction/NotAllAtomsInsideSphereAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "Descriptors/AtomDescriptor.hpp"
 #include "Descriptors/AtomShapeDescriptor.hpp"
@@ -38,62 +36,20 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/SelectionAction/NotAllAtomsInsideSphereAction.hpp"
 
-
-// memento to remember the state when undoing
-
-class SelectionNotAllAtomsInsideSphereState : public ActionState {
-public:
-  SelectionNotAllAtomsInsideSphereState(std::vector<atom*> _selectedAtoms, const Vector &_position, const double _radius) :
-    selectedAtoms(_selectedAtoms),
-    position(_position),
-    radius(_radius)
-  {}
-  std::vector<atom*> selectedAtoms;
-  Vector position;
-  double radius;
-};
-
-const char SelectionNotAllAtomsInsideSphereAction::NAME[] = "unselect-atoms-inside-sphere";
-
-SelectionNotAllAtomsInsideSphereAction::SelectionNotAllAtomsInsideSphereAction() :
-  Action(NAME)
-{}
-
-SelectionNotAllAtomsInsideSphereAction::~SelectionNotAllAtomsInsideSphereAction()
-{}
-
-void SelectionNotAllAtomsInsideSphere(const Vector &position, const double radius) {
-  ValueStorage::getInstance().setCurrentValue(SelectionNotAllAtomsInsideSphereAction::NAME, radius);
-  ValueStorage::getInstance().setCurrentValue("position", position);
-  ActionRegistry::getInstance().getActionByName(SelectionNotAllAtomsInsideSphereAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionNotAllAtomsInsideSphereAction::getParametersfromValueStorage()
-{};
-
-Dialog* SelectionNotAllAtomsInsideSphereAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryDouble(NAME, ValueStorage::getInstance().getDescription(NAME));
-  dialog->queryVector("position", false, ValueStorage::getInstance().getDescription("position"));
-
-  return dialog;
-}
-
+// and construct the stuff
+#include "NotAllAtomsInsideSphereAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
 Action::state_ptr SelectionNotAllAtomsInsideSphereAction::performCall() {
   std::vector<atom *> selectedAtoms = World::getInstance().getSelectedAtoms();
-  double radius = 0.;
-  Vector position;
 
-  ValueStorage::getInstance().queryCurrentValue(NAME, radius);
-  ValueStorage::getInstance().queryCurrentValue("position", position);
+  // obtain information
+  getParametersfromValueStorage();
 
-  DoLog(1) && (Log() << Verbose(1) << "Unselecting all atoms inside a sphere at " << position << " with radius " << radius << "." << endl);
-  Shape s = translate(resize(Sphere(),radius),position);
+  DoLog(1) && (Log() << Verbose(1) << "Unselecting all atoms inside a sphere at " << params.position << " with radius " << params.radius << "." << endl);
+  Shape s = translate(resize(Sphere(),params.radius),params.position);
   World::getInstance().unselectAllAtoms(AtomByShape(s));
-  return Action::state_ptr(new SelectionNotAllAtomsInsideSphereState(selectedAtoms, position, radius));
+  return Action::state_ptr(new SelectionNotAllAtomsInsideSphereState(selectedAtoms, params));
 }
 
@@ -105,5 +61,5 @@
     World::getInstance().selectAtom(*iter);
 
-  return Action::state_ptr(new SelectionNotAllAtomsInsideSphereState(state->selectedAtoms, state->position, state->radius));
+  return Action::state_ptr(_state);
 }
 
@@ -111,8 +67,8 @@
   SelectionNotAllAtomsInsideSphereState *state = assert_cast<SelectionNotAllAtomsInsideSphereState*>(_state.get());
 
-  Shape s = translate(resize(Sphere(),state->radius),state->position);
+  Shape s = translate(resize(Sphere(),state->params.radius),state->params.position);
   World::getInstance().unselectAllAtoms(AtomByShape(s));
 
-  return Action::state_ptr(new SelectionNotAllAtomsInsideSphereState(state->selectedAtoms, state->position, state->radius));
+  return Action::state_ptr(_state);
 }
 
@@ -128,2 +84,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/NotAllAtomsInsideSphereAction.def
===================================================================
--- src/Actions/SelectionAction/NotAllAtomsInsideSphereAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
+++ src/Actions/SelectionAction/NotAllAtomsInsideSphereAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -0,0 +1,25 @@
+/*
+ * NotAllAtomsInsideSphereAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+class Vector;
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#define paramtypes (double) (Vector)
+#define paramtokens (SelectionNotAllAtomsInsideSphereAction::NAME) ("position")
+#define paramreferences (radius) (position)
+
+#define statetypes (std::vector<atom*>)
+#define statereferences (selectedAtoms)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define ACTIONNAME NotAllAtomsInsideSphere
+#define TOKEN "unselect-atoms-inside-sphere"
+
Index: src/Actions/SelectionAction/NotAllAtomsInsideSphereAction.hpp
===================================================================
--- src/Actions/SelectionAction/NotAllAtomsInsideSphereAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/NotAllAtomsInsideSphereAction.hpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -11,29 +11,6 @@
 #include "Actions/Action.hpp"
 
-class Vector;
-
-void SelectionNotAllAtomsInsideSphere();
-
-class SelectionNotAllAtomsInsideSphereAction : public Action {
-  friend void SelectionNotAllAtomsInsideSphere(const Vector &position, const double radius);
-
-public:
-  SelectionNotAllAtomsInsideSphereAction();
-  virtual ~SelectionNotAllAtomsInsideSphereAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog *dialog);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "NotAllAtomsInsideSphereAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* NOTALLATOMSINSIDESPHEREACTION_HPP_ */
Index: src/Actions/SelectionAction/NotAllAtomsOfMoleculeAction.cpp
===================================================================
--- src/Actions/SelectionAction/NotAllAtomsOfMoleculeAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/NotAllAtomsOfMoleculeAction.cpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/SelectionAction/NotAllAtomsOfMoleculeAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "Descriptors/AtomDescriptor.hpp"
 #include "atom.hpp"
@@ -34,54 +32,19 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/SelectionAction/NotAllAtomsOfMoleculeAction.hpp"
 
-
-// memento to remember the state when undoing
-
-class SelectionNotAllAtomsOfMoleculeState : public ActionState {
-public:
-  SelectionNotAllAtomsOfMoleculeState(std::vector<atom*> _selectedAtoms, molecule *_mol) :
-    selectedAtoms(_selectedAtoms),
-    mol(_mol)
-  {}
-  std::vector<atom*> selectedAtoms;
-  molecule *mol;
-};
-
-const char SelectionNotAllAtomsOfMoleculeAction::NAME[] = "unselect-molecules-atoms";
-
-SelectionNotAllAtomsOfMoleculeAction::SelectionNotAllAtomsOfMoleculeAction() :
-  Action(NAME)
-{}
-
-SelectionNotAllAtomsOfMoleculeAction::~SelectionNotAllAtomsOfMoleculeAction()
-{}
-
-void SelectionNotAllAtomsOfMolecule() {
-  ActionRegistry::getInstance().getActionByName(SelectionNotAllAtomsOfMoleculeAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionNotAllAtomsOfMoleculeAction::getParametersfromValueStorage()
-{};
-
-Dialog* SelectionNotAllAtomsOfMoleculeAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryMolecule(NAME, ValueStorage::getInstance().getDescription(NAME));
-
-  return dialog;
-}
-
+// and construct the stuff
+#include "NotAllAtomsOfMoleculeAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
 Action::state_ptr SelectionNotAllAtomsOfMoleculeAction::performCall() {
-  molecule *mol = NULL;
   std::vector<atom *> selectedAtoms = World::getInstance().getSelectedAtoms();
 
-  ValueStorage::getInstance().queryCurrentValue(NAME, mol);
+  // obtain information
+  getParametersfromValueStorage();
 
-  DoLog(1) && (Log() << Verbose(1) << "Unselecting all atoms of molecule " << mol->getName() << "." << endl);
-  World::getInstance().unselectAtomsOfMolecule(mol);
-  return Action::state_ptr(new SelectionNotAllAtomsOfMoleculeState(selectedAtoms, mol));
+  DoLog(1) && (Log() << Verbose(1) << "Unselecting all atoms of molecule " << params.mol->getName() << "." << endl);
+  World::getInstance().unselectAtomsOfMolecule(params.mol);
+  return Action::state_ptr(new SelectionNotAllAtomsOfMoleculeState(selectedAtoms, params));
 }
 
@@ -93,5 +56,5 @@
     World::getInstance().selectAtom(*iter);
 
-  return Action::state_ptr(new SelectionNotAllAtomsOfMoleculeState(state->selectedAtoms, state->mol));
+  return Action::state_ptr(_state);
 }
 
@@ -99,7 +62,7 @@
   SelectionNotAllAtomsOfMoleculeState *state = assert_cast<SelectionNotAllAtomsOfMoleculeState*>(_state.get());
 
-  World::getInstance().unselectAtomsOfMolecule(state->mol);
+  World::getInstance().unselectAtomsOfMolecule(state->params.mol);
 
-  return Action::state_ptr(new SelectionNotAllAtomsOfMoleculeState(state->selectedAtoms, state->mol));
+  return Action::state_ptr(_state);
 }
 
@@ -115,2 +78,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/NotAllAtomsOfMoleculeAction.def
===================================================================
--- src/Actions/SelectionAction/NotAllAtomsOfMoleculeAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
+++ src/Actions/SelectionAction/NotAllAtomsOfMoleculeAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -0,0 +1,25 @@
+/*
+ * NotAllAtomsOfMoleculeAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#define paramtypes (molecule*)
+#define paramtokens (SelectionNotAllAtomsOfMoleculeAction::NAME)
+#define paramreferences (mol)
+
+#define statetypes (std::vector<atom*>)
+#define statereferences (selectedAtoms)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define ACTIONNAME NotAllAtomsOfMolecule
+#define TOKEN "unselect-molecules-atoms"
+
Index: src/Actions/SelectionAction/NotAllAtomsOfMoleculeAction.hpp
===================================================================
--- src/Actions/SelectionAction/NotAllAtomsOfMoleculeAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/NotAllAtomsOfMoleculeAction.hpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -11,27 +11,6 @@
 #include "Actions/Action.hpp"
 
-void SelectionNotAllAtomsOfMolecule();
-
-class SelectionNotAllAtomsOfMoleculeAction : public Action {
-  friend void SelectionNotAllAtomsOfMolecule();
-
-public:
-  SelectionNotAllAtomsOfMoleculeAction();
-  virtual ~SelectionNotAllAtomsOfMoleculeAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog *dialog);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "NotAllAtomsOfMoleculeAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* NOTALLATOMSOFMOLECULEACTION_HPP_ */
Index: src/Actions/SelectionAction/NotAllMoleculesAction.cpp
===================================================================
--- src/Actions/SelectionAction/NotAllMoleculesAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/NotAllMoleculesAction.cpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/SelectionAction/NotAllMoleculesAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "Descriptors/MoleculeDescriptor.hpp"
 #include "atom.hpp"
@@ -33,48 +31,18 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/SelectionAction/NotAllMoleculesAction.hpp"
 
+// and construct the stuff
+#include "NotAllMoleculesAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+Action::state_ptr SelectionNotAllMoleculesAction::performCall() {
+  // obtain information
+  getParametersfromValueStorage();
 
-// memento to remember the state when undoing
-
-class SelectionNotAllMoleculesState : public ActionState {
-public:
-  SelectionNotAllMoleculesState(std::vector<molecule*> selectedMolecules) :
-    selectedMolecules(selectedMolecules)
-  {}
-  std::vector<molecule*> selectedMolecules;
-};
-
-const char SelectionNotAllMoleculesAction::NAME[] = "unselect-all-molecules";
-
-SelectionNotAllMoleculesAction::SelectionNotAllMoleculesAction() :
-  Action(NAME)
-{}
-
-SelectionNotAllMoleculesAction::~SelectionNotAllMoleculesAction()
-{}
-
-void SelectionNotAllMolecules() {
-  ActionRegistry::getInstance().getActionByName(SelectionNotAllMoleculesAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionNotAllMoleculesAction::getParametersfromValueStorage()
-{};
-
-Dialog* SelectionNotAllMoleculesAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME));
-
-  return dialog;
-}
-
-Action::state_ptr SelectionNotAllMoleculesAction::performCall() {
   std::vector<molecule *> selectedMolecules = World::getInstance().getSelectedMolecules();
   DoLog(1) && (Log() << Verbose(1) << "Unselecting all molecules." << endl);
   World::getInstance().clearMoleculeSelection();
-  return Action::state_ptr(new SelectionNotAllMoleculesState(selectedMolecules));
+  return Action::state_ptr(new SelectionNotAllMoleculesState(selectedMolecules,params));
 }
 
@@ -86,13 +54,13 @@
     World::getInstance().selectMolecule(*iter);
 
-  return Action::state_ptr(new SelectionNotAllMoleculesState(state->selectedMolecules));
+  return Action::state_ptr(_state);
 }
 
 Action::state_ptr SelectionNotAllMoleculesAction::performRedo(Action::state_ptr _state){
-  SelectionNotAllMoleculesState *state = assert_cast<SelectionNotAllMoleculesState*>(_state.get());
+  //SelectionNotAllMoleculesState *state = assert_cast<SelectionNotAllMoleculesState*>(_state.get());
 
   World::getInstance().clearMoleculeSelection();
 
-  return Action::state_ptr(new SelectionNotAllMoleculesState(state->selectedMolecules));
+  return Action::state_ptr(_state);
 }
 
@@ -108,2 +76,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/NotAllMoleculesAction.def
===================================================================
--- src/Actions/SelectionAction/NotAllMoleculesAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
+++ src/Actions/SelectionAction/NotAllMoleculesAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -0,0 +1,24 @@
+/*
+ * NotAllMoleculesAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#undef paramtypes
+#undef paramtokens
+#undef paramreferences
+
+#define statetypes (std::vector<molecule*>)
+#define statereferences (selectedMolecules)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define ACTIONNAME NotAllMolecules
+#define TOKEN "unselect-all-molecules"
+
Index: src/Actions/SelectionAction/NotAllMoleculesAction.hpp
===================================================================
--- src/Actions/SelectionAction/NotAllMoleculesAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/NotAllMoleculesAction.hpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -2,5 +2,5 @@
  * NotAllMoleculesAction.hpp
  *
- *  Created on: May 12, 2010
+ *  Created on: Aug 09, 2010
  *      Author: heber
  */
@@ -11,27 +11,6 @@
 #include "Actions/Action.hpp"
 
-void SelectionNotAllMolecules();
-
-class SelectionNotAllMoleculesAction : public Action {
-  friend void SelectionNotAllMolecules();
-
-public:
-  SelectionNotAllMoleculesAction();
-  virtual ~SelectionNotAllMoleculesAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog *dialog);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "NotAllMoleculesAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* NOTALLMOLECULESSACTION_HPP_ */
Index: src/Actions/SelectionAction/NotAtomByElementAction.cpp
===================================================================
--- src/Actions/SelectionAction/NotAtomByElementAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/NotAtomByElementAction.cpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/SelectionAction/NotAtomByElementAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "Descriptors/AtomTypeDescriptor.hpp"
 #include "atom.hpp"
@@ -34,55 +32,19 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/SelectionAction/NotAtomByElementAction.hpp"
 
-
-// memento to remember the state when undoing
-
-class SelectionNotAtomByElementState : public ActionState {
-public:
-  SelectionNotAtomByElementState(std::vector<atom*> _selectedAtoms, const element *_elemental) :
-    selectedAtoms(_selectedAtoms),
-    elemental(_elemental)
-  {}
-  std::vector<atom*> selectedAtoms;
-  const element *elemental;
-};
-
-const char SelectionNotAtomByElementAction::NAME[] = "unselect-atom-by-element";
-
-SelectionNotAtomByElementAction::SelectionNotAtomByElementAction() :
-  Action(NAME)
-{}
-
-SelectionNotAtomByElementAction::~SelectionNotAtomByElementAction()
-{}
-
-void SelectionNotAtomByElement(const element &_element) {
-  ValueStorage::getInstance().setCurrentValue(SelectionNotAtomByElementAction::NAME, _element);
-  ActionRegistry::getInstance().getActionByName(SelectionNotAtomByElementAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionNotAtomByElementAction::getParametersfromValueStorage()
-{};
-
-Dialog* SelectionNotAtomByElementAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryElement(NAME, ValueStorage::getInstance().getDescription(NAME));
-
-  return dialog;
-}
-
+// and construct the stuff
+#include "NotAtomByElementAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
 Action::state_ptr SelectionNotAtomByElementAction::performCall() {
-  const element *elemental;
   std::vector<atom *> selectedAtoms = World::getInstance().getSelectedAtoms();
 
-  ValueStorage::getInstance().queryCurrentValue(NAME, elemental);
+  // obtain information
+  getParametersfromValueStorage();
 
-  DoLog(1) && (Log() << Verbose(1) << "Unselecting atoms of type " << *elemental << endl);
-  World::getInstance().unselectAllAtoms(AtomByType(elemental));
-  return Action::state_ptr(new SelectionNotAtomByElementState(selectedAtoms,elemental));
+  DoLog(1) && (Log() << Verbose(1) << "Unselecting atoms of type " << *params.elemental << endl);
+  World::getInstance().unselectAllAtoms(AtomByType(params.elemental));
+  return Action::state_ptr(new SelectionNotAtomByElementState(selectedAtoms,params));
 }
 
@@ -100,5 +62,5 @@
   SelectionNotAtomByElementState *state = assert_cast<SelectionNotAtomByElementState*>(_state.get());
 
-  World::getInstance().unselectAllAtoms(AtomByType(state->elemental));
+  World::getInstance().unselectAllAtoms(AtomByType(state->params.elemental));
 
   return Action::state_ptr(_state);
@@ -116,2 +78,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/NotAtomByElementAction.def
===================================================================
--- src/Actions/SelectionAction/NotAtomByElementAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
+++ src/Actions/SelectionAction/NotAtomByElementAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -0,0 +1,25 @@
+/*
+ * NotAtomByElementAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+class element;
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#define paramtypes (const element*)
+#define paramtokens (SelectionNotAtomByElementAction::NAME)
+#define paramreferences (elemental)
+
+#define statetypes (std::vector<atom*>)
+#define statereferences (selectedAtoms)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define ACTIONNAME NotAtomByElement
+#define TOKEN "unselect-atom-by-element"
+
Index: src/Actions/SelectionAction/NotAtomByElementAction.hpp
===================================================================
--- src/Actions/SelectionAction/NotAtomByElementAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/NotAtomByElementAction.hpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -11,29 +11,6 @@
 #include "Actions/Action.hpp"
 
-class element;
-
-void SelectionNotAtomByElement(const element &_element);
-
-class SelectionNotAtomByElementAction : public Action {
-  friend void SelectionNotAtomByElement(const element &_element);
-
-public:
-  SelectionNotAtomByElementAction();
-  virtual ~SelectionNotAtomByElementAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog *dialog);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "NotAtomByElementAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* NOTATOMBYELEMENTACTION_HPP_ */
Index: src/Actions/SelectionAction/NotAtomByIdAction.cpp
===================================================================
--- src/Actions/SelectionAction/NotAtomByIdAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/NotAtomByIdAction.cpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/SelectionAction/NotAtomByIdAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "atom.hpp"
 #include "Helpers/Log.hpp"
@@ -32,53 +30,18 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/SelectionAction/NotAtomByIdAction.hpp"
 
+// and construct the stuff
+#include "NotAtomByIdAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+Action::state_ptr SelectionNotAtomByIdAction::performCall() {
+  // obtain information
+  getParametersfromValueStorage();
 
-// memento to remember the state when undoing
-
-class SelectionNotAtomByIdState : public ActionState {
-public:
-  SelectionNotAtomByIdState(atom* _walker) :
-    walker(_walker)
-  {}
-  atom* walker;
-};
-
-const char SelectionNotAtomByIdAction::NAME[] = "unselect-atom-by-id";
-
-SelectionNotAtomByIdAction::SelectionNotAtomByIdAction() :
-  Action(NAME)
-{}
-
-SelectionNotAtomByIdAction::~SelectionNotAtomByIdAction()
-{}
-
-void SelectionNotAtomById(atom *_atom) {
-  ValueStorage::getInstance().setCurrentValue(SelectionNotAtomByIdAction::NAME, _atom);
-  ActionRegistry::getInstance().getActionByName(SelectionNotAtomByIdAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionNotAtomByIdAction::getParametersfromValueStorage()
-{};
-
-Dialog* SelectionNotAtomByIdAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryAtom(NAME, ValueStorage::getInstance().getDescription(NAME));
-
-  return dialog;
-}
-
-Action::state_ptr SelectionNotAtomByIdAction::performCall() {
-  atom *Walker = NULL;
-
-  ValueStorage::getInstance().queryCurrentValue(NAME, Walker);
-
-  if (World::getInstance().isSelected(Walker)) {
-    DoLog(1) && (Log() << Verbose(1) << "Unselecting atom " << *Walker << endl);
-    World::getInstance().unselectAtom(Walker);
-    return Action::state_ptr(new SelectionNotAtomByIdState(Walker));
+  if (World::getInstance().isSelected(params.Walker)) {
+    DoLog(1) && (Log() << Verbose(1) << "Unselecting atom " << *params.Walker << endl);
+    World::getInstance().unselectAtom(params.Walker);
+    return Action::state_ptr(new SelectionNotAtomByIdState(params));
   } else {
     return Action::success;
@@ -89,8 +52,8 @@
   SelectionNotAtomByIdState *state = assert_cast<SelectionNotAtomByIdState*>(_state.get());
 
-  if (state->walker != NULL)
-    World::getInstance().selectAtom(state->walker);
+  if (state->params.Walker != NULL)
+    World::getInstance().selectAtom(state->params.Walker);
 
-  return Action::state_ptr(new SelectionNotAtomByIdState(state->walker));
+  return Action::state_ptr(_state);
 }
 
@@ -98,8 +61,8 @@
   SelectionNotAtomByIdState *state = assert_cast<SelectionNotAtomByIdState*>(_state.get());
 
-  if (state->walker != NULL)
-    World::getInstance().unselectAtom(state->walker);
+  if (state->params.Walker != NULL)
+    World::getInstance().unselectAtom(state->params.Walker);
 
-  return Action::state_ptr(new SelectionNotAtomByIdState(state->walker));
+  return Action::state_ptr(_state);
 }
 
@@ -115,2 +78,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/NotAtomByIdAction.def
===================================================================
--- src/Actions/SelectionAction/NotAtomByIdAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
+++ src/Actions/SelectionAction/NotAtomByIdAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -0,0 +1,25 @@
+/*
+ * NotAtomByIdAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+class atom;
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#define paramtypes (atom*)
+#define paramtokens (SelectionNotAtomByIdAction::NAME)
+#define paramreferences (Walker)
+
+#undef statetypes
+#undef statereferences
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define ACTIONNAME NotAtomById
+#define TOKEN "unselect-atom-by-id"
+
Index: src/Actions/SelectionAction/NotAtomByIdAction.hpp
===================================================================
--- src/Actions/SelectionAction/NotAtomByIdAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/NotAtomByIdAction.hpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -11,29 +11,6 @@
 #include "Actions/Action.hpp"
 
-class atom;
-
-void SelectionNotAtomById(atom *_atom);
-
-class SelectionNotAtomByIdAction : public Action {
-  friend void SelectionNotAtomById(atom *_atom);
-
-public:
-  SelectionNotAtomByIdAction();
-  virtual ~SelectionNotAtomByIdAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog *dialog);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "NotAtomByIdAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* NOTATOMBYIDACTION_HPP_ */
Index: src/Actions/SelectionAction/NotMoleculeByFormulaAction.cpp
===================================================================
--- src/Actions/SelectionAction/NotMoleculeByFormulaAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/NotMoleculeByFormulaAction.cpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/SelectionAction/NotMoleculeByFormulaAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "Descriptors/MoleculeFormulaDescriptor.hpp"
 #include "molecule.hpp"
@@ -33,59 +31,23 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/SelectionAction/NotMoleculeByFormulaAction.hpp"
 
-
-// memento to remember the state when undoing
-
-class SelectionNotMoleculeByFormulaState : public ActionState {
-public:
-  SelectionNotMoleculeByFormulaState(std::vector<molecule*> selectedMolecules, const std::string &_formula) :
-    selectedMolecules(selectedMolecules),
-    formula(_formula)
-  {}
-  std::vector<molecule*> selectedMolecules;
-  std::string formula;
-};
-
-const char SelectionNotMoleculeByFormulaAction::NAME[] = "unselect-molecule-by-formula";
-
-SelectionNotMoleculeByFormulaAction::SelectionNotMoleculeByFormulaAction() :
-  Action(NAME)
-{}
-
-SelectionNotMoleculeByFormulaAction::~SelectionNotMoleculeByFormulaAction()
-{}
-
-void SelectionNotMoleculeByFormula(const std::string &_formula) {
-  ValueStorage::getInstance().setCurrentValue(SelectionNotMoleculeByFormulaAction::NAME, _formula);
-  ActionRegistry::getInstance().getActionByName(SelectionNotMoleculeByFormulaAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionNotMoleculeByFormulaAction::getParametersfromValueStorage()
-{};
-
-Dialog* SelectionNotMoleculeByFormulaAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME));
-
-  return dialog;
-}
-
+// and construct the stuff
+#include "NotMoleculeByFormulaAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
 Action::state_ptr SelectionNotMoleculeByFormulaAction::performCall() {
-  std::string formula;
   std::vector<molecule *> selectedMolecules = World::getInstance().getSelectedMolecules();
 
-  ValueStorage::getInstance().queryCurrentValue(NAME, formula);
+  // obtain information
+  getParametersfromValueStorage();
 
-  DoLog(1) && (Log() << Verbose(1) << "Unselecting molecules with chemical formula " << formula << ":" << endl);
-  std::vector<molecule *> matchingMolecules = World::getInstance().getAllMolecules(MoleculeByFormula(formula));
+  DoLog(1) && (Log() << Verbose(1) << "Unselecting molecules with chemical formula " << params.formula << ":" << endl);
+  std::vector<molecule *> matchingMolecules = World::getInstance().getAllMolecules(MoleculeByFormula(params.formula));
   for (std::vector<molecule *>::const_iterator iter = matchingMolecules.begin(); iter != matchingMolecules.end(); ++iter) {
     DoLog(1) && (Log() << Verbose(1) << "\t" << (*iter)->getId() << ", " << (*iter)->getName() << "." << endl);
   }
-  World::getInstance().unselectAllMolecules(MoleculeByFormula(formula));
-  return Action::state_ptr(new SelectionNotMoleculeByFormulaState(selectedMolecules,formula));
+  World::getInstance().unselectAllMolecules(MoleculeByFormula(params.formula));
+  return Action::state_ptr(new SelectionNotMoleculeByFormulaState(selectedMolecules,params));
 }
 
@@ -103,5 +65,5 @@
   SelectionNotMoleculeByFormulaState *state = assert_cast<SelectionNotMoleculeByFormulaState*>(_state.get());
 
-  World::getInstance().unselectAllMolecules(MoleculeByFormula(state->formula));
+  World::getInstance().unselectAllMolecules(MoleculeByFormula(state->params.formula));
 
   return Action::state_ptr(_state);
@@ -119,2 +81,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/NotMoleculeByFormulaAction.def
===================================================================
--- src/Actions/SelectionAction/NotMoleculeByFormulaAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
+++ src/Actions/SelectionAction/NotMoleculeByFormulaAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -0,0 +1,25 @@
+/*
+ * NotMoleculeByFormulaAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+class molecule;
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#define paramtypes (std::string)
+#define paramtokens (SelectionNotMoleculeByFormulaAction::NAME)
+#define paramreferences (formula)
+
+#define statetypes (std::vector<molecule*>)
+#define statereferences (selectedMolecules)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define ACTIONNAME NotMoleculeByFormula
+#define TOKEN "unselect-molecule-by-formula"
+
Index: src/Actions/SelectionAction/NotMoleculeByFormulaAction.hpp
===================================================================
--- src/Actions/SelectionAction/NotMoleculeByFormulaAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/NotMoleculeByFormulaAction.hpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -11,29 +11,6 @@
 #include "Actions/Action.hpp"
 
-class molecule;
-
-void SelectionNotMoleculeByFormula(molecule *_mol);
-
-class SelectionNotMoleculeByFormulaAction : public Action {
-  friend void SelectionNotMoleculeByFormula(const std::string &_formula);
-
-public:
-  SelectionNotMoleculeByFormulaAction();
-  virtual ~SelectionNotMoleculeByFormulaAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog *dialog);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "NotMoleculeByFormulaAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* NOTMOLECULEBYFORMULAACTION_HPP_ */
Index: src/Actions/SelectionAction/NotMoleculeByIdAction.cpp
===================================================================
--- src/Actions/SelectionAction/NotMoleculeByIdAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/NotMoleculeByIdAction.cpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/SelectionAction/NotMoleculeByIdAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "molecule.hpp"
 #include "Helpers/Log.hpp"
@@ -32,53 +30,18 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/SelectionAction/NotMoleculeByIdAction.hpp"
 
+// and construct the stuff
+#include "NotMoleculeByIdAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+Action::state_ptr SelectionNotMoleculeByIdAction::performCall() {
+  // obtain information
+  getParametersfromValueStorage();
 
-// memento to remember the state when undoing
-
-class SelectionNotMoleculeByIdState : public ActionState {
-public:
-  SelectionNotMoleculeByIdState(molecule* _mol) :
-    mol(_mol)
-  {}
-  molecule* mol;
-};
-
-const char SelectionNotMoleculeByIdAction::NAME[] = "unselect-molecule-by-id";
-
-SelectionNotMoleculeByIdAction::SelectionNotMoleculeByIdAction() :
-  Action(NAME)
-{}
-
-SelectionNotMoleculeByIdAction::~SelectionNotMoleculeByIdAction()
-{}
-
-void SelectionNotMoleculeById(molecule *_mol) {
-  ValueStorage::getInstance().setCurrentValue(SelectionNotMoleculeByIdAction::NAME, _mol);
-  ActionRegistry::getInstance().getActionByName(SelectionNotMoleculeByIdAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionNotMoleculeByIdAction::getParametersfromValueStorage()
-{};
-
-Dialog* SelectionNotMoleculeByIdAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryMolecule(NAME, ValueStorage::getInstance().getDescription(NAME));
-
-  return dialog;
-}
-
-Action::state_ptr SelectionNotMoleculeByIdAction::performCall() {
-  molecule *mol = NULL;
-
-  ValueStorage::getInstance().queryCurrentValue(NAME, mol);
-
-  if (World::getInstance().isSelected(mol)) {
-    DoLog(1) && (Log() << Verbose(1) << "Unselecting molecule " << mol->name << endl);
-    World::getInstance().unselectMolecule(mol);
-    return Action::state_ptr(new SelectionNotMoleculeByIdState(mol));
+  if (World::getInstance().isSelected(params.mol)) {
+    DoLog(1) && (Log() << Verbose(1) << "Unselecting molecule " << params.mol->name << endl);
+    World::getInstance().unselectMolecule(params.mol);
+    return Action::state_ptr(new SelectionNotMoleculeByIdState(params));
   } else {
     return Action::success;
@@ -89,8 +52,8 @@
   SelectionNotMoleculeByIdState *state = assert_cast<SelectionNotMoleculeByIdState*>(_state.get());
 
-  if (state->mol != NULL)
-    World::getInstance().selectMolecule(state->mol);
+  if (state->params.mol != NULL)
+    World::getInstance().selectMolecule(state->params.mol);
 
-  return Action::state_ptr(new SelectionNotMoleculeByIdState(state->mol));
+  return Action::state_ptr(_state);
 }
 
@@ -98,8 +61,8 @@
   SelectionNotMoleculeByIdState *state = assert_cast<SelectionNotMoleculeByIdState*>(_state.get());
 
-  if (state->mol != NULL)
-    World::getInstance().unselectMolecule(state->mol);
+  if (state->params.mol != NULL)
+    World::getInstance().unselectMolecule(state->params.mol);
 
-  return Action::state_ptr(new SelectionNotMoleculeByIdState(state->mol));
+  return Action::state_ptr(_state);
 }
 
@@ -115,2 +78,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/NotMoleculeByIdAction.def
===================================================================
--- src/Actions/SelectionAction/NotMoleculeByIdAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
+++ src/Actions/SelectionAction/NotMoleculeByIdAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -0,0 +1,25 @@
+/*
+ * NotMoleculeByIdAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+class molecule;
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#define paramtypes (molecule*)
+#define paramtokens (SelectionNotMoleculeByIdAction::NAME)
+#define paramreferences (mol)
+
+#undef statetypes
+#undef statereferences
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define ACTIONNAME NotMoleculeById
+#define TOKEN "unselect-molecule-by-id"
+
Index: src/Actions/SelectionAction/NotMoleculeByIdAction.hpp
===================================================================
--- src/Actions/SelectionAction/NotMoleculeByIdAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/NotMoleculeByIdAction.hpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -11,29 +11,6 @@
 #include "Actions/Action.hpp"
 
-class molecule;
-
-void SelectionNotMoleculeById(molecule *_mol);
-
-class SelectionNotMoleculeByIdAction : public Action {
-  friend void SelectionNotMoleculeById(molecule *_mol);
-
-public:
-  SelectionNotMoleculeByIdAction();
-  virtual ~SelectionNotMoleculeByIdAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog *dialog);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "NotMoleculeByIdAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* NOTMOLECULEBYIDACTION_HPP_ */
Index: src/Actions/SelectionAction/NotMoleculeOfAtomAction.cpp
===================================================================
--- src/Actions/SelectionAction/NotMoleculeOfAtomAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/NotMoleculeOfAtomAction.cpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/SelectionAction/NotMoleculeOfAtomAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "Descriptors/MoleculeDescriptor.hpp"
 #include "atom.hpp"
@@ -33,54 +31,18 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/SelectionAction/NotMoleculeOfAtomAction.hpp"
 
-
-// memento to remember the state when undoing
-
-class SelectionNotMoleculeOfAtomState : public ActionState {
-public:
-  SelectionNotMoleculeOfAtomState(std::vector<molecule*> selectedMolecules, atom *_Walker) :
-    selectedMolecules(selectedMolecules),
-    Walker(_Walker)
-  {}
-  std::vector<molecule*> selectedMolecules;
-  atom *Walker;
-};
-
-const char SelectionNotMoleculeOfAtomAction::NAME[] = "unselect-molecule-of-atom";
-
-SelectionNotMoleculeOfAtomAction::SelectionNotMoleculeOfAtomAction() :
-  Action(NAME)
-{}
-
-SelectionNotMoleculeOfAtomAction::~SelectionNotMoleculeOfAtomAction()
-{}
-
-void SelectionNotMoleculeOfAtom() {
-  ActionRegistry::getInstance().getActionByName(SelectionNotMoleculeOfAtomAction::NAME)->call(Action::NonInteractive);
-};
-
-void SelectionNotMoleculeOfAtomAction::getParametersfromValueStorage()
-{};
-
-Dialog* SelectionNotMoleculeOfAtomAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryAtom(NAME, ValueStorage::getInstance().getDescription(NAME));
-
-  return dialog;
-}
-
+// and construct the stuff
+#include "NotMoleculeOfAtomAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
 Action::state_ptr SelectionNotMoleculeOfAtomAction::performCall() {
-  atom *Walker = NULL;
-
-  ValueStorage::getInstance().queryCurrentValue(NAME, Walker);
+  // obtain information
+  getParametersfromValueStorage();
 
   std::vector<molecule *> selectedMolecules = World::getInstance().getSelectedMolecules();
-  DoLog(1) && (Log() << Verbose(1) << "Unselecting molecule to which " << Walker->getName() << " belongs." << endl);
-  World::getInstance().unselectMoleculeOfAtom(Walker);
-  return Action::state_ptr(new SelectionNotMoleculeOfAtomState(selectedMolecules, Walker));
+  DoLog(1) && (Log() << Verbose(1) << "Unselecting molecule to which " << params.Walker->getName() << " belongs." << endl);
+  World::getInstance().unselectMoleculeOfAtom(params.Walker);
+  return Action::state_ptr(new SelectionNotMoleculeOfAtomState(selectedMolecules, params));
 }
 
@@ -92,5 +54,5 @@
     World::getInstance().selectMolecule(*iter);
 
-  return Action::state_ptr(new SelectionNotMoleculeOfAtomState(state->selectedMolecules, state->Walker));
+  return Action::state_ptr(_state);
 }
 
@@ -98,7 +60,7 @@
   SelectionNotMoleculeOfAtomState *state = assert_cast<SelectionNotMoleculeOfAtomState*>(_state.get());
 
-  World::getInstance().unselectMoleculeOfAtom(state->Walker);
+  World::getInstance().unselectMoleculeOfAtom(state->params.Walker);
 
-  return Action::state_ptr(new SelectionNotMoleculeOfAtomState(state->selectedMolecules, state->Walker));
+  return Action::state_ptr(_state);
 }
 
@@ -114,2 +76,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/NotMoleculeOfAtomAction.def
===================================================================
--- src/Actions/SelectionAction/NotMoleculeOfAtomAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
+++ src/Actions/SelectionAction/NotMoleculeOfAtomAction.def	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -0,0 +1,24 @@
+/*
+ * NotMoleculeOfAtomAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#define paramtypes (atom*)
+#define paramtokens (SelectionNotMoleculeOfAtomAction::NAME)
+#define paramreferences (Walker)
+
+#define statetypes (std::vector<molecule*>)
+#define statereferences (selectedMolecules)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define ACTIONNAME NotMoleculeOfAtom
+#define TOKEN "unselect-molecule-of-atom"
+
Index: src/Actions/SelectionAction/NotMoleculeOfAtomAction.hpp
===================================================================
--- src/Actions/SelectionAction/NotMoleculeOfAtomAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/SelectionAction/NotMoleculeOfAtomAction.hpp	(revision 966e12d8a822176e4558e3229d5f45d6231cc1c0)
@@ -11,27 +11,6 @@
 #include "Actions/Action.hpp"
 
-void SelectionNotMoleculeOfAtom();
-
-class SelectionNotMoleculeOfAtomAction : public Action {
-  friend void SelectionNotMoleculeOfAtom();
-
-public:
-  SelectionNotMoleculeOfAtomAction();
-  virtual ~SelectionNotMoleculeOfAtomAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog *dialog);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "NotMoleculeOfAtomAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* NOTMOLECULEOFATOMSACTION_HPP_ */
