Index: trunk/org.modelica.mdt.ui/src/org/modelica/mdt/ui/ModelicaElementAdapter.java
===================================================================
--- trunk/org.modelica.mdt.ui/src/org/modelica/mdt/ui/ModelicaElementAdapter.java	(revision 383)
+++ trunk/org.modelica.mdt.ui/src/org/modelica/mdt/ui/ModelicaElementAdapter.java	(revision 384)
@@ -47,6 +47,4 @@
 import org.eclipse.ui.model.IWorkbenchAdapter;
 import org.eclipse.ui.model.WorkbenchAdapter;
-import org.modelica.mdt.core.IModelicaClass;
-import org.modelica.mdt.core.IModelicaComponent;
 import org.modelica.mdt.core.IModelicaElement;
 import org.modelica.mdt.core.IModelicaFile;
@@ -54,7 +52,4 @@
 import org.modelica.mdt.core.IModelicaFolder;
 import org.modelica.mdt.core.IModelicaProject;
-import org.modelica.mdt.core.IStandardLibrary;
-import org.modelica.mdt.core.compiler.CompilerException;
-import org.modelica.mdt.internal.core.ErrorManager;
 
 /**
@@ -89,77 +84,10 @@
 			
 		}
-		else if (object instanceof IModelicaClass)
-		{
-			String imgTag = null;
-
-			try
-			{
-				switch (((IModelicaClass)object).getRestrictionType())
-				{
-				case PACKAGE:
-					imgTag = ModelicaImages.IMG_OBJS_PACKAGE;
-					break;
-				case CLASS:
-					imgTag = ModelicaImages.IMG_OBJS_CLASS;
-					break;
-				case MODEL:
-					imgTag = ModelicaImages.IMG_OBJS_MODEL;
-					break;
-				case FUNCTION:
-					imgTag = ModelicaImages.IMG_OBJS_FUNCTION;
-					break;
-				case RECORD:
-					imgTag = ModelicaImages.IMG_OBJS_RECORD;
-					break;
-				case CONNECTOR:
-					imgTag = ModelicaImages.IMG_OBJS_CONNECTOR;
-					break;
-				case BLOCK:
-					imgTag = ModelicaImages.IMG_OBJS_BLOCK;
-					break;
-				case TYPE:
-					imgTag = ModelicaImages.IMG_OBJS_TYPE;
-					break;
-				default:
-					ErrorManager.logBug(UIPlugin.getSymbolicName(),
-							"IModelicaClass object of unexpected restriction " + 
-							"type " + 
-							((IModelicaClass)object).getRestrictionType() +
-							" encountered.");
-					imgTag = "";
-				}
-			}
-			catch (CompilerException e)
-			{
-				ErrorManager.logError(e);
-				/* 
-				 * hmm, let the class icon be default 
-				 * 'i don't know your type' image
-				 */ 
-				imgTag = ModelicaImages.IMG_OBJS_CLASS;
-			}
-			return ModelicaImages.getImageDescriptor(imgTag);
-		}
-		else if (object instanceof IModelicaComponent)
-		{
-			switch (((IModelicaComponent)object).getVisbility())
-			{
-			case PUBLIC:
-				return ModelicaImages.getImageDescriptor
-					(ModelicaImages.IMG_OBJS_PUBLIC_COMPONENT);
-			case PROTECTED:
-				return ModelicaImages.getImageDescriptor
-					(ModelicaImages.IMG_OBJS_PROTECTED_COMPONENT);
-			}
-		}
-		else if (object instanceof IModelicaSourceFile)
-		{
-			return ModelicaImages.getImageDescriptor(ModelicaImages.IMG_OBJS_MO_FILE);
-		}
 		/* 
-		 * this check must be done after IModelicaSourceFile couse 
+		 * this check uggly must be done couse 
 		 * IModelciaFile is superclass of IModelicaSourceFile
 		 */
-		else if (object instanceof IModelicaFile)
+		else if ((object instanceof IModelicaFile) 
+				&& !(object instanceof IModelicaSourceFile))
 		{
 			/*
@@ -172,15 +100,18 @@
 			
 		}
-		
 		else if (object instanceof IModelicaFolder)
 		{
 			return PlatformUI.getWorkbench().getSharedImages().
-			getImageDescriptor(ISharedImages.IMG_OBJ_FOLDER);
+					getImageDescriptor(ISharedImages.IMG_OBJ_FOLDER);
 		}
-		else if (object instanceof IStandardLibrary)
+		else if (object instanceof IModelicaElement)
 		{
-			return ModelicaImages.getImageDescriptor(ModelicaImages.IMG_OBJS_LIBRARY);
+			String key = 
+				ModelicaImages.getModelicaElementKey((IModelicaElement)object);
+			if (key != null)
+			{
+				return ModelicaImages.getImageDescriptor(key);
+			}
 		}
-		
 		
 		return super.getImageDescriptor(object);
Index: trunk/org.modelica.mdt.ui/src/org/modelica/mdt/ui/ModelicaImages.java
===================================================================
--- trunk/org.modelica.mdt.ui/src/org/modelica/mdt/ui/ModelicaImages.java	(revision 383)
+++ trunk/org.modelica.mdt.ui/src/org/modelica/mdt/ui/ModelicaImages.java	(revision 384)
@@ -18,4 +18,10 @@
 import org.eclipse.jface.resource.ImageRegistry;
 import org.eclipse.swt.graphics.Image;
+import org.modelica.mdt.core.IModelicaClass;
+import org.modelica.mdt.core.IModelicaComponent;
+import org.modelica.mdt.core.IModelicaElement;
+import org.modelica.mdt.core.IModelicaSourceFile;
+import org.modelica.mdt.core.IStandardLibrary;
+import org.modelica.mdt.core.compiler.CompilerException;
 import org.modelica.mdt.internal.core.ErrorManager;
 
@@ -163,5 +169,70 @@
 			
 		return new URL(ICON_BASE_URL, iconPath);
-	}	
-
+	}
+	
+	/**
+	 * Get the key to the image used to display certain modelica elements.
+	 * @param element the modelica element who's image key to fetch 
+	 * @return the image key or null if it is unknow which image is used
+	 * to visualize provided element
+	 */
+	public static String getModelicaElementKey(IModelicaElement element)
+	{
+		if (element instanceof IModelicaClass)
+		{
+			try
+			{
+				switch (((IModelicaClass)element).getRestrictionType())
+				{
+				case PACKAGE:
+					return ModelicaImages.IMG_OBJS_PACKAGE;
+				case CLASS:
+					return ModelicaImages.IMG_OBJS_CLASS;
+				case MODEL:
+					return ModelicaImages.IMG_OBJS_MODEL;
+				case FUNCTION:
+					return ModelicaImages.IMG_OBJS_FUNCTION;
+				case RECORD:
+					return ModelicaImages.IMG_OBJS_RECORD;
+				case CONNECTOR:
+					return ModelicaImages.IMG_OBJS_CONNECTOR;
+				case BLOCK:
+					return ModelicaImages.IMG_OBJS_BLOCK;
+				case TYPE:
+					return ModelicaImages.IMG_OBJS_TYPE;
+				default:
+					ErrorManager.logBug(UIPlugin.getSymbolicName(),
+							"IModelicaClass object of unexpected restriction " + 
+							"type " + 
+							((IModelicaClass)element).getRestrictionType() +
+							" encountered.");
+				}
+			}
+			catch (CompilerException e)
+			{
+				ErrorManager.logError(e);
+			}
+		}
+		else if (element instanceof IModelicaComponent)
+		{
+			switch (((IModelicaComponent)element).getVisbility())
+			{
+			case PUBLIC:
+				return ModelicaImages.IMG_OBJS_PUBLIC_COMPONENT;
+			case PROTECTED:
+				return ModelicaImages.IMG_OBJS_PROTECTED_COMPONENT;
+			}
+		}
+		else if (element instanceof IModelicaSourceFile)
+		{
+			return ModelicaImages.IMG_OBJS_MO_FILE;
+		}
+		else if (element instanceof IStandardLibrary)
+		{
+			return ModelicaImages.IMG_OBJS_LIBRARY;
+		}
+
+		/* we have no idea */
+		return null;
+	}
 }
Index: trunk/org.modelica.mdt.ui/src/org/modelica/mdt/ui/editor/ModelicaCompletionProcessor.java
===================================================================
--- trunk/org.modelica.mdt.ui/src/org/modelica/mdt/ui/editor/ModelicaCompletionProcessor.java	(revision 383)
+++ trunk/org.modelica.mdt.ui/src/org/modelica/mdt/ui/editor/ModelicaCompletionProcessor.java	(revision 384)
@@ -78,4 +78,5 @@
 import org.modelica.mdt.core.compiler.UnexpectedReplyException;
 import org.modelica.mdt.internal.core.ErrorManager;
+import org.modelica.mdt.ui.ModelicaImages;
 import org.modelica.mdt.ui.UIPlugin;
 
@@ -507,14 +508,15 @@
 				return;
 			}
+			
 			/*
 			 * if there are no dots in the prefix then we can
 			 * only propose our own name
 			 */ 
-
 			proposals.add(new CompletionProposal(packageName,
 					offset-prefix.length(),
 					prefix.length(),
-					packageName.length(), 
-					null, // TODO provide real image here instead
+					packageName.length(),
+					ModelicaImages.get
+						(ModelicaImages.getModelicaElementKey(importedPackage)),
 					packageName, 
 					null, null));
@@ -611,5 +613,6 @@
 					childPrefix.length(),
 					elementName.length(), 
-					null, // TODO provide real image here instead
+					ModelicaImages.get
+						(ModelicaImages.getModelicaElementKey(element)),
 					elementName, 
 					null, null));
