package cn.net.connor.std.processedit;

import java.lang.reflect.Method;

import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IStartup;

import javafx.embed.swt.FXCanvas;

public class KStartup implements IStartup {

	@Override
	public void earlyStartup() {
		Display.getDefault().asyncExec(()->{
			try {
				Class<?> c = FXCanvas.class;
				Method m = c.getDeclaredMethod("initFx", new Class[0]);
				m.setAccessible(true);
				m.invoke(FXCanvas.class, new Object[0]);
				System.out.println("FXCanvas inited");
			} catch (Exception e) {
				e.printStackTrace();
			}
		});
	}

}
