package com.exedio.copernica;

import java.util.Collection;
import java.util.Collections;

import com.exedio.cope.lib.Attribute;
import com.exedio.cope.lib.Item;
import com.exedio.cope.lib.Type;


public class TransientCopernicaProvider implements CopernicaProvider
{
	public Collection getDisplayLanguages()
	{
		return Collections.EMPTY_LIST;
	}
	
	public Collection getRootCategories()
	{
		return Collections.EMPTY_LIST;
	}
	
	public Collection getMainAttributes(final Type type)
	{
		return Collections.EMPTY_LIST;
	}

	public Collection getSections(final Type type)
	{
		return Collections.EMPTY_LIST;
	}
	
	public String getDisplayName(final com.exedio.copernica.Language displayLanguage, final Type type)
	{
		return type.getID();
	}

	public String getDisplayName(final com.exedio.copernica.Language displayLanguage, final Attribute attribute)
	{
		String name = attribute.getName();
		if(name.endsWith("Internal"))
			name = name.substring(0, name.length()-"Internal".length());
		return name;
	}
	
	public String getDisplayName(final com.exedio.copernica.Language displayLanguage, final Item item)
	{
		return item.toString();
	}
	
	public String getIconURL(final Type type)
	{
		return null;
	}

	public com.exedio.copernica.Language findLanguageByUniqueID(final String uniqueID)
	{
		return null;
	}
	
	public Category findCategoryByUniqueID(final String uniqueID)
	{
		return null;
	}
	
	public Section findSectionByUniqueID(final String uniqueID)
	{
		return null;
	}

	public void initializeExampleSystem()
	{
	}

}

@@ -986,21 +986,434 @@
 ));%0A
+%0A
 %09%09
-return name
+final StringBuffer result = new StringBuffer(name.length());%0A%09%09boolean wordStart = true;%0A%09%09for(int i=0; i%3Cname.length(); i++)%0A%09%09%7B%0A%09%09%09final char c = name.charAt(i);%0A%0A%09%09%09if(Character.isUpperCase(c))%0A%09%09%09%7B%0A%09%09%09%09if(!wordStart)%0A%09%09%09%09%09result.append(' ');%0A%09%09%09%09wordStart = true;%0A%09%09%09%7D%0A%09%09%09else%0A%09%09%09%09wordStart = false;%0A%0A%09%09%09if(i==0)%0A%09%09%09%09result.append(Character.toUpperCase(c));%0A%09%09%09else%0A%09%09%09%09result.append(c);%0A%09%09%7D%0A%0A%09%09return result.toString()
 ;%0A%09%7D

make attribute names nicer