/**
 * 
 */
package org.corpus_tools.atomic.api.commands;

import org.corpus_tools.atomic.api.editors.DocumentGraphEditor;
import org.corpus_tools.salt.common.SDocumentGraph;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PlatformUI;

/**
 * TODO Description
 *
 * @author Stephan Druskat <mail@sdruskat.net>
 *
 */
public class DocumentGraphAwareHandler extends AbstractHandler {
	
	private final SDocumentGraph graph;
	
	/**
	 * 
	 */
	public DocumentGraphAwareHandler() {
		IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
		if (editor instanceof DocumentGraphEditor) {
			graph = ((DocumentGraphEditor) editor).getGraph();
		}
		else {
			graph = null;
		}
	}

	/* (non-Javadoc)
	 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
	 */
	@Override
	public Object execute(ExecutionEvent event) throws ExecutionException {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * @return the graph
	 */
	public final SDocumentGraph getGraph() {
		return graph;
	}

}

@@ -222,110 +222,8 @@
 er;%0A
-import org.eclipse.core.commands.ExecutionEvent;%0Aimport org.eclipse.core.commands.ExecutionException;%0A
 impo
@@ -253,16 +253,16 @@
 orPart;%0A
+
 import o
@@ -376,16 +376,25 @@
 %0Apublic 
+abstract 
 class Do
@@ -791,265 +791,8 @@
 %09%7D%0A%0A
-%09/* (non-Javadoc)%0A%09 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)%0A%09 */%0A%09@Override%0A%09public Object execute(ExecutionEvent event) throws ExecutionException %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09return null;%0A%09%7D%0A%0A
 %09/**
@@ -877,14 +877,13 @@
  graph;%0A
+
 %09%7D%0A
-%0A
 %7D%0A

Add API for handler that know the SDocumentGraph of the editor