Index: trunk/src/util/shell.cc
===================================================================
--- trunk/src/util/shell.cc	(revision 5104)
+++ trunk/src/util/shell.cc	(revision 5105)
@@ -457,5 +457,5 @@
   strcpy(completionLine, this->inputLine);
 
-   char* commandBegin = strrchr(completionLine, ' ');
+  char* commandBegin = strrchr(completionLine, ' ');
   if (commandBegin == NULL)
     commandBegin = completionLine;
@@ -468,5 +468,15 @@
   }
 
-  this->classComplete(commandBegin);
+  char* objectStart;
+  if (objectStart = strstr(commandBegin, "::"))
+  {
+    char* classIdentity = new char[objectStart - commandBegin +1];
+    strncpy(classIdentity, commandBegin, objectStart - commandBegin);
+    classIdentity[objectStart - commandBegin] = '\0';
+    this->objectComplete(objectStart+2, ClassList::StringToID(classIdentity));
+    delete[] classIdentity;
+  }
+  else
+    this->classComplete(commandBegin);
 
   delete[] completionLine;
@@ -482,31 +492,80 @@
   if (unlikely(classBegin == NULL))
     return false;
-  const tList<const char>* classList = this->createCompleteList(ClassList::getClassList(), classBegin);
-  if (classList->getSize() == 0)
-  {
-     //PRINTF(0)("no completion found for %s\n", commandBegin);
+  const tList<const char>* clList = ClassList::getClassList();
+  if (clList != NULL)
+  {
+    const tList<const char>* classList = this->createCompleteList(clList, classBegin);
+    if (classList != NULL)
+      this->generalComplete(classList, classBegin, "%s::", "::");
+    else
+      return false;
+  }
+  else
     return false;
-  }
-
-  const char* addString = classList->firstElement();
+  return true;
+}
+
+/**
+ * autocompletes an ObjectName
+ * @param objectBegin the beginning string of a Object
+ * @param classID the ID of the Class to search for.
+ * @return true on success, false otherwise
+ */
+bool Shell::objectComplete(const char* objectBegin, long classID)
+{
+  printf("%s\n", objectBegin);
+
+  if (unlikely(objectBegin == NULL))
+    return false;
+  tList<BaseObject>* boList = ClassList::getList(classID);
+  if (boList != NULL)
+  {
+    printf("\n", boList->firstElement()->getName());
+    const tList<const char>* objectList = this->createCompleteList(boList, objectBegin);
+    if (objectList != NULL)
+      this->generalComplete(objectList, objectBegin, "%s");
+    else
+      return false;
+  }
+  else
+    return false;
+  return true;
+}
+
+bool Shell::functionComplete(const char* functionBegin)
+{
+}
+
+/**
+ * completes the inputline on grounds of an inputList
+ * @param stringList the List to parse through
+ * @param begin the String to search in the inputList, and to extend with it.
+ * @param displayAs how to display the found value to the user, printf-style, !!with only one %s!! ex.: "::%s::"
+ * @param addBack what should be added at the end of the completion
+ * @param addFront what should be added to the front of one finished completion
+ * @return true if ok, false otherwise
+ */
+bool Shell::generalComplete(const tList<const char>* stringList, const char* begin, const char* displayAs, const char* addBack, const char* addFront)
+{
+  if (stringList->getSize() == 0)
+    return false;
+
+  const char* addString = stringList->firstElement();
   unsigned int addLength = 0;
-  unsigned int inputLenght = strlen(classBegin);
+  unsigned int inputLenght = strlen(begin);
 
   if (addString != NULL)
     addLength = strlen(addString);
-  tIterator<const char>* charIterator = classList->getIterator();
+  tIterator<const char>* charIterator = stringList->getIterator();
   const char* charElem = charIterator->nextElement();
   while (charElem != NULL)
   {
-    PRINTF(0)("%s:: ", charElem);
-    {
-      for (unsigned int i = inputLenght; i < addLength; i++)
-        if (addString[i] != charElem[i])
-      {
-        addLength = i;
-        break;
-      }
-    }
-
+    PRINTF(0)(displayAs, charElem);
+    for (unsigned int i = inputLenght; i < addLength; i++)
+      if (addString[i] != charElem[i])
+    {
+      addLength = i;
+      break;
+    }
     charElem = charIterator->nextElement();
   }
@@ -520,22 +579,17 @@
     this->removeCharacters(inputLenght);
     this->addCharacters(adder);
-//    this->addCharacters("::");
+    if (addBack != NULL && stringList->getSize() == 1)
+      this->addCharacters("::");
     delete[] adder;
   }
-}
-
-bool Shell::objectComplete(const char* objectBegin, ClassID classID)
-{
-
-}
-
-bool Shell::functionComplete(const char* functionBegin)
-{
-}
+  return true;
+}
+
 
 
 /**
  * searches for classes, which beginn with classNameBegin
- * @param classNameBegin the beginning string of a Class
+ * @param inputList the List to parse through
+ * @param classNameBegin the beginning string
  * @return a NEW char-array with ClassNames. The LIST should be deleted afterwards,
  * !! The strings MUST NOT be deleted !!
@@ -543,4 +597,6 @@
 const tList<const char>* Shell::createCompleteList(const tList<const char>* inputList, const char* classNameBegin)
 {
+  if (inputList == NULL || classNameBegin == NULL)
+    return NULL;
   unsigned int searchLength = strlen(classNameBegin);
   if (this->completionList != NULL)
@@ -566,4 +622,37 @@
 }
 
+/**
+ * searches for classes, which beginn with classNameBegin
+ * @param inputList the List to parse through
+ * @param classNameBegin the beginning string
+ * @return a NEW char-array with ClassNames. The LIST should be deleted afterwards,
+ * !! The strings MUST NOT be deleted !!
+ */
+const tList<const char>* Shell::createCompleteList(const tList<BaseObject>* inputList, const char* classNameBegin)
+{
+  if (inputList == NULL || classNameBegin == NULL)
+    return NULL;
+  unsigned int searchLength = strlen(classNameBegin);
+  if (this->completionList != NULL)
+    delete this->completionList;
+  this->completionList = new tList<const char>;
+
+  tIterator<BaseObject>* iterator = inputList->getIterator();
+  BaseObject* enumBO = iterator->nextElement();
+  while (enumBO != NULL)
+  {
+    if (enumBO->getName() != NULL &&
+        strlen(enumBO->getName())>searchLength+1 &&
+        !strncasecmp(enumBO->getName(), classNameBegin, searchLength))
+    {
+      this->completionList->add(enumBO->getName());
+    }
+    enumBO = iterator->nextElement();
+  }
+  delete iterator;
+
+  return this->completionList;
+}
+
 
 
Index: trunk/src/util/shell.h
===================================================================
--- trunk/src/util/shell.h	(revision 5104)
+++ trunk/src/util/shell.h	(revision 5105)
@@ -68,9 +68,11 @@
     bool autoComplete();
     bool classComplete(const char* classBegin);
-    bool objectComplete(const char* objectBegin, ClassID classID);
+    bool objectComplete(const char* objectBegin, long classID);
     bool functionComplete(const char* functionBegin);
 
+    bool generalComplete(const tList<const char>* stringList, const char* begin, const char* displayAs = "%s", const char* addBack = NULL, const char* addFront = NULL);
 
     const tList<const char>* Shell::createCompleteList(const tList<const char>* inputList, const char* classNameBegin);
+    const tList<const char>* Shell::createCompleteList(const tList<BaseObject>* inputList, const char* classNameBegin);
 
 
