Commit 0aeca31c authored by Philip Makedonski's avatar Philip Makedonski
Browse files

+ generation ui improvement

parent e75ef3e5
...@@ -9,14 +9,16 @@ import org.eclipse.emf.common.util.URI; ...@@ -9,14 +9,16 @@ import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet; import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.handlers.HandlerUtil; import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.ui.part.FileEditorInput; import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.xtext.ui.resource.IResourceSetProvider; import org.eclipse.xtext.ui.resource.IResourceSetProvider;
import org.etsi.mts.tdl.tools.to.docx.TemplateApp; import org.etsi.mts.tdl.tools.to.docx.TemplateApp;
import org.etsi.mts.tdl.Package;
import com.google.inject.Inject; import com.google.inject.Inject;
/** /**
...@@ -26,7 +28,10 @@ import com.google.inject.Inject; ...@@ -26,7 +28,10 @@ import com.google.inject.Inject;
*/ */
public class GenerationHandler extends AbstractHandler { public class GenerationHandler extends AbstractHandler {
@Inject @Inject
IResourceSetProvider resourceSetProvider; IResourceSetProvider resourceSetProvider;
private IWorkbenchWindow window;
/** /**
* The constructor. * The constructor.
*/ */
...@@ -64,8 +69,17 @@ public class GenerationHandler extends AbstractHandler { ...@@ -64,8 +69,17 @@ public class GenerationHandler extends AbstractHandler {
//app.setTemplateName(templateName); //app.setTemplateName(templateName);
app.generate(file.getRawLocation().toOSString(), r); app.generate(file.getRawLocation().toOSString(), r);
} }
MessageDialog.openInformation(
Display.getDefault().getActiveShell(),
// window.getShell(),
"Generating Document",
"Document generated: "+file.getName());
return null; return null;
} }
public void init(IWorkbenchWindow window) {
this.window = window;
}
@Override @Override
public boolean isEnabled() { public boolean isEnabled() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment