1
|
/**
|
2
|
*
|
3
|
*/
|
4
|
package eu.etaxonomy.taxeditor.editor.key.handler;
|
5
|
|
6
|
import org.eclipse.core.commands.AbstractHandler;
|
7
|
import org.eclipse.core.commands.ExecutionEvent;
|
8
|
import org.eclipse.core.commands.ExecutionException;
|
9
|
import org.eclipse.ui.IEditorPart;
|
10
|
import org.eclipse.ui.handlers.HandlerUtil;
|
11
|
|
12
|
import eu.etaxonomy.taxeditor.editor.key.AbstractGraphKeyEditor;
|
13
|
|
14
|
/**
|
15
|
* @author n.hoffmann
|
16
|
*
|
17
|
*/
|
18
|
public class ApplyLayoutHandler extends AbstractHandler {
|
19
|
|
20
|
/* (non-Javadoc)
|
21
|
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
|
22
|
*/
|
23
|
@Override
|
24
|
public Object execute(ExecutionEvent event) throws ExecutionException {
|
25
|
IEditorPart editor = HandlerUtil.getActiveEditor(event);
|
26
|
|
27
|
if(editor instanceof AbstractGraphKeyEditor){
|
28
|
((AbstractGraphKeyEditor) editor).applyLayout();
|
29
|
}
|
30
|
|
31
|
return null;
|
32
|
}
|
33
|
|
34
|
}
|