<%@ import val generator: org.fusesource.ide.generator.Generator %>
/*******************************************************************************
 * Copyright (c) 2013 Red Hat, Inc.
 * Distributed under license by Red Hat, Inc. All rights reserved.
 * This program is made available under the terms of the
 * Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Red Hat, Inc. - initial API and implementation
 ******************************************************************************/

/**
 * NOTE - this file is auto-generated using Scalate. 
 * 
 * DO NOT EDIT!
 */
package org.fusesource.ide.camel.editor.provider.generated;

import org.eclipse.graphiti.features.ICreateFeature;
import org.eclipse.graphiti.features.IFeatureProvider;

import org.fusesource.ide.camel.editor.Messages;
import org.fusesource.ide.camel.editor.features.create.CreateFigureFeature;
import org.fusesource.ide.camel.editor.provider.ImageProvider;
import org.fusesource.ide.camel.editor.provider.PaletteCategoryItemProvider;
import org.fusesource.ide.camel.model.Endpoint;

#for (n <- nodeDefinitions)
import org.fusesource.ide.camel.model.generated.${n.definitionName.capitalize};
#end	


/**
* @author lhein
*/
public final class ProviderHelper{

	private ProviderHelper() {
		// private ddefault constructor
	}

	/**
	 * helper method to return all create features available for the palette
	 * 
	 * @param fp	the feature provider
	 * @return	an array of create features for the palette
	 */
	public static ICreateFeature[] getCreateFeatures(IFeatureProvider fp) {
		return new ICreateFeature[] {
				new CreateFigureFeature<Endpoint>(fp, Messages.paletteEndpointTitle, Messages.paletteEndpointDescription, Endpoint.class)
#for (n <- nodeDefinitions)
 #{ val name = n.definitionName.capitalize }#
 #if( name!="Route" )
 				, new CreateFigureFeature<${name}>(fp, Messages.palette${name}Title, Messages.palette${name}Description, ${name}.class)
  #end      
#end	
		};
	}

	/**
	 * helper method which provides all images for the figures in the palette
	 * 
	 * @param imageProvider	the image provider to use
	 */
	public static void addFigureIcons(ImageProvider imageProvider) {
		imageProvider.addIconsForClass(new Endpoint());
#for (n <- nodeDefinitions)
 #{ val name = n.definitionName.capitalize }#
	imageProvider.addIconsForClass(new ${name}());
#end	
	}

}
