/*
 * Perfclispe
 * 
 * 
 * Copyright (c) 2013 Jakub Knetl
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.perfclipse.ui.editors;

import org.eclipse.gef.palette.MarqueeToolEntry;
import org.eclipse.gef.palette.PaletteContainer;
import org.eclipse.gef.palette.PaletteGroup;
import org.eclipse.gef.palette.PaletteRoot;
import org.eclipse.gef.palette.PanningSelectionToolEntry;
import org.eclipse.gef.palette.ToolEntry;

public class ScenarioPalleteFactory {

	 public static PaletteRoot createPalette() {
	      PaletteRoot palette = new PaletteRoot();
	      palette.add(createToolsGroup(palette));
	      return palette;
	   }

	   private static PaletteContainer createToolsGroup(PaletteRoot palette) {
	      PaletteGroup toolGroup = new PaletteGroup("Tools");

	      ToolEntry tool = new PanningSelectionToolEntry();
	      toolGroup.add(tool);
	      palette.setDefaultEntry(tool);

	      toolGroup.add(new MarqueeToolEntry());

	      return toolGroup;
	   }
}

@@ -651,16 +651,78 @@
 itors;%0A%0A
+import org.eclipse.gef.palette.CombinedTemplateCreationEntry;%0A
 import o
@@ -811,16 +811,107 @@
 tainer;%0A
+import org.eclipse.gef.palette.PaletteDrawer;%0Aimport org.eclipse.gef.palette.PaletteEntry;%0A
 import o
@@ -1090,16 +1090,166 @@
 olEntry;
+%0Aimport org.eclipse.gef.requests.SimpleFactory;%0Aimport org.perfclipse.model.ScenarioModel;%0Aimport org.perfclipse.model.ScenarioModel.Messages.Message;
 %0A%0Apublic
@@ -1433,35 +1433,689 @@
     
-return palette;%0A%09   %7D%0A%0A%09   
+palette.add(createElementsDrawer());%0A%09      return palette;%0A%09   %7D%0A%0A%09   private static PaletteEntry createElementsDrawer() %7B%0A%09%09   PaletteDrawer componentDrawer = new PaletteDrawer(%22Elemnts drawer%22);%0A%0A%09%09   SimpleFactory factory = new SimpleFactory(ScenarioModel.Messages.Message.class)%7B%0A%09%09%09   public Object getNewObject()%7B%0A%09%09%09%09   ScenarioModel.Messages.Message m = new Message();%0A%09%09%09%09   m.setUri(%22Added_by_GEF%22);%0A%09%09%09%09   return m;%0A%09%09%09   %7D%0A%09%09   %7D;%0A%09%09   %0A%09%09   CombinedTemplateCreationEntry messageComponent = new CombinedTemplateCreationEntry(%22Create message%22, %22Add new message%22, factory, null, null);%0A%09%09   componentDrawer.add(messageComponent);%0A%09%09   %0A%09%09   return componentDrawer;%0A%09%7D%0A%0A%09
 priv
@@ -2444,10 +2444,15 @@
 ;%0A%09   %7D%0A
+%09   %0A
 %7D%0A

Add message creation tool to palette