Changeset 84 in default for v2/trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui
- Timestamp:
- 07/02/14 13:59:44 (10 years ago)
- Location:
- v2/trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui
- Files:
-
- 1 added
- 1 deleted
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
v2/trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/handler/BT_GenerationHandlerPDF.java
r72 r84 26 26 import org.eclipse.emf.ecore.xml.type.SimpleAnyType; 27 27 import org.eclipse.emf.ecore.xml.type.XMLTypeFactory; 28 import org.eclipse.jface.dialogs.MessageDialog; 28 29 import org.eclipse.ui.IEditorInput; 29 30 import org.eclipse.ui.IEditorPart; … … 32 33 import org.eclipse.ui.IWorkbenchWindow; 33 34 import org.eclipse.ui.PlatformUI; 35 import org.eclipse.ui.handlers.HandlerUtil; 34 36 import org.eclipse.ui.part.FileEditorInput; 35 37 import org.eclipse.xtext.builder.EclipseResourceFileSystemAccess2; … … 42 44 import com.google.inject.Provider; 43 45 44 public class BT_GenerationHandler extends AbstractHandler implements IHandler { 46 import de.ugoe.cs.swe.bnftools.generator.EbnfGenerator; 47 48 public class BT_GenerationHandlerPDF extends AbstractHandler implements IHandler { 45 49 46 50 @Inject … … 56 60 IResourceSetProvider resourceSetProvider; 57 61 62 63 58 64 @Override 65 public boolean isEnabled() { 66 return true; 67 } 68 69 70 71 59 72 public Object execute(ExecutionEvent event) throws ExecutionException { 60 73 MessageDialog.openInformation(HandlerUtil.getActiveShell(event), 74 "Hello", "Generating PDF"); 75 76 61 77 //used to save the command name (defined in extensions) 62 78 String mode = ""; … … 65 81 mode = event.getCommand().getName(); 66 82 } catch (NotDefinedException e1) { 67 // TODO Auto-generated catch block68 83 e1.printStackTrace(); 69 84 } … … 127 142 wrapper.setValue(mode); 128 143 // 129 144 EbnfGenerator gen = (EbnfGenerator)generator; 130 145 // add string to resource 131 146 r.getContents().add(wrapper); 132 133 generator.doGenerate(r, fsa);134 147 gen.doGenerate(r, fsa,false); 148 //generator.doGenerate(r, fsa); 149 135 150 return null; 136 151 137 152 } 138 139 @Override140 public boolean isEnabled() {141 return true;142 }143 144 153 } -
v2/trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/labeling/EbnfLabelProvider.xtend
r68 r84 5 5 6 6 import com.google.inject.Inject 7 import de.ugoe.cs.swe.bnftools.ebnf.Atom 8 import de.ugoe.cs.swe.bnftools.ebnf.BnfEntry 9 import de.ugoe.cs.swe.bnftools.ebnf.DefinitionList 7 10 import de.ugoe.cs.swe.bnftools.ebnf.ImportSection 8 11 import de.ugoe.cs.swe.bnftools.ebnf.Rule 9 import de.ugoe.cs.swe.bnftools.ebnf.BnfEntry10 import de.ugoe.cs.swe.bnftools.ebnf.DefinitionList11 12 import de.ugoe.cs.swe.bnftools.ebnf.SingleDefinition 12 13 import de.ugoe.cs.swe.bnftools.ebnf.Term 13 import de.ugoe.cs.swe.bnftools.ebnf.Atom14 import de.ugoe.cs.swe.bnftools.ebnf.StringRule14 import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider 15 import org.eclipse.xtext.ui.label.DefaultEObjectLabelProvider 15 16 16 17 /** … … 19 20 * see http://www.eclipse.org/Xtext/documentation.html#labelProvider 20 21 */ 21 class EbnfLabelProvider extends org.eclipse.xtext.ui.label.DefaultEObjectLabelProvider {22 class EbnfLabelProvider extends DefaultEObjectLabelProvider { 22 23 23 24 @Inject 24 new( org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider delegate) {25 new(AdapterFactoryLabelProvider delegate) { 25 26 super(delegate); 26 27 } … … 31 32 32 33 def text(BnfEntry entry){ 33 ' BnfEntry'34 }34 'Rule: '+entry.rule.name 35 } 35 36 36 37 def text(Rule rule){ 37 'Rule: '+rule.name38 38 39 } 39 40
Note: See TracChangeset
for help on using the changeset viewer.