/*-
 *******************************************************************************
 * Copyright (c) 2011, 2014 Diamond Light Source Ltd.
 * All rights reserved. This program and the accompanying materials
 * are 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:
 *    Matthew Gerring - initial API and implementation and/or initial documentation
 *******************************************************************************/
package org.eclipse.dawnsci.plotting.api;

import org.eclipse.dawnsci.plotting.api.tool.IToolPageSystem;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.WorkbenchPart;

/**
 * Class used to fool plotting system that there is a
 * part which is active. This provides then the IAdaptable
 * for tools to work.
 * 
 * @author Matthew Gerring
 *
 */
public class EmptyWorkbenchPart extends WorkbenchPart {

	private IPlottingSystem<Composite> system;

	public EmptyWorkbenchPart(IPlottingSystem<Composite> system) {
		this.system = system;
	}
	
	@SuppressWarnings("rawtypes")
	@Override
    public Object getAdapter(final Class clazz) {
		
		 if (clazz == IToolPageSystem.class) {
			return system;
		}
		
		return null;
	}

	@Override
	public void createPartControl(Composite parent) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void setFocus() {
		// TODO Auto-generated method stub
		
	}
}

@@ -924,16 +924,30 @@
 Gerring%0A
+ * @param %3CT%3E%0A
  *%0A */%0Ap
@@ -976,16 +976,19 @@
 enchPart
+%3CT%3E
  extends
@@ -1026,33 +1026,25 @@
 ttingSystem%3C
-Composite
+T
 %3E system;%0A%0A%09
@@ -1085,25 +1085,17 @@
 gSystem%3C
-Composite
+T
 %3E system

Make EmptyWorkbenchPart use generics to support plotting systems with non composite parents (IFigure)