1 package org.simantics.document.swt.core.widget;
3 import org.eclipse.core.commands.AbstractHandler;
4 import org.eclipse.core.commands.ExecutionEvent;
5 import org.eclipse.core.commands.ExecutionException;
6 import org.eclipse.jface.viewers.ISelection;
7 import org.eclipse.swt.widgets.Event;
8 import org.eclipse.swt.widgets.Widget;
9 import org.eclipse.ui.handlers.HandlerUtil;
10 import org.simantics.document.swt.core.widget.SCLTextEditor.State;
12 public class SCLTextEditorSaveHandler extends AbstractHandler {
15 public Object execute(ExecutionEvent event) throws ExecutionException {
17 Object trigger = event.getTrigger();
18 if(trigger instanceof Event) {
19 Event e = (Event)trigger;
20 Widget widget = e.widget;
21 State data = (State)widget.getData("state");