<commit_before>/*-
 *******************************************************************************
 * 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:
 *    <NAME> - 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 <NAME>
 *
 */
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
		
	}
}<commit_msg>Make EmptyWorkbenchPart use generics to support plotting systems with non composite parents (IFigure)<commit_after>/*-
 *******************************************************************************
 * 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:
 *    <NAME> - 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 <NAME>
 * @param <T>
 *
 */
public class EmptyWorkbenchPart<T> extends WorkbenchPart {

	private IPlottingSystem<T> system;

	public EmptyWorkbenchPart(IPlottingSystem<T> 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
		
	}
}
{'fraction_non_alphanumeric': 0.1834567106533634, 'fraction_numerical': 0.007724493080141615, 'mean_word_length': 4.424083769633508, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7155532', 'n_tokens_mistral': 933, 'n_tokens_neox': 829, 'n_words': 264}