Changeset 65 in default for v2/trunk/de.ugoe.cs.swe.bnftools.ebnf.ui
- Timestamp:
- 05/07/14 16:02:46 (11 years ago)
- Location:
- v2/trunk/de.ugoe.cs.swe.bnftools.ebnf.ui
- Files:
-
- 10 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
v2/trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src-gen/de/ugoe/cs/swe/bnftools/ui/AbstractEbnfUiModule.java
r61 r65 39 39 } 40 40 41 // contributed by org.eclipse.xtext.generator.exporting. QualifiedNamesFragment41 // contributed by org.eclipse.xtext.generator.exporting.SimpleNamesFragment 42 42 public Class<? extends org.eclipse.xtext.ui.refactoring.IDependentElementsCalculator> bindIDependentElementsCalculator() { 43 43 return org.eclipse.xtext.ui.refactoring.impl.DefaultDependentElementsCalculator.class; 44 }45 46 // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment47 public void configureIResourceDescriptionsBuilderScope(com.google.inject.Binder binder) {48 binder.bind(org.eclipse.xtext.resource.IResourceDescriptions.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider.NAMED_BUILDER_SCOPE)).to(org.eclipse.xtext.builder.clustering.CurrentDescriptions.ResourceSetAware.class);49 }50 51 // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment52 public Class<? extends org.eclipse.xtext.ui.editor.IXtextEditorCallback> bindIXtextEditorCallback() {53 return org.eclipse.xtext.builder.nature.NatureAddingEditorCallback.class;54 }55 56 // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment57 public void configureIResourceDescriptionsPersisted(com.google.inject.Binder binder) {58 binder.bind(org.eclipse.xtext.resource.IResourceDescriptions.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.builder.impl.PersistentDataAwareDirtyResource.PERSISTED_DESCRIPTIONS)).to(org.eclipse.xtext.builder.builderState.IBuilderState.class);59 }60 61 // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment62 public Class<? extends org.eclipse.xtext.ui.editor.DocumentBasedDirtyResource> bindDocumentBasedDirtyResource() {63 return org.eclipse.xtext.builder.impl.PersistentDataAwareDirtyResource.class;64 44 } 65 45 … … 154 134 } 155 135 156 // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment157 public java.lang.ClassLoader bindClassLoaderToInstance() {158 return getClass().getClassLoader();159 }160 161 // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment162 public Class<? extends org.eclipse.xtext.common.types.access.IJvmTypeProvider.Factory> bindIJvmTypeProvider$Factory() {163 return org.eclipse.xtext.common.types.access.jdt.JdtTypeProviderFactory.class;164 }165 166 // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment167 public Class<? extends org.eclipse.xtext.common.types.xtext.AbstractTypeScopeProvider> bindAbstractTypeScopeProvider() {168 return org.eclipse.xtext.common.types.xtext.ui.JdtBasedSimpleTypeScopeProvider.class;169 }170 171 // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment172 public Class<? extends org.eclipse.xtext.common.types.xtext.ui.ITypesProposalProvider> bindITypesProposalProvider() {173 return org.eclipse.xtext.common.types.xtext.ui.JdtTypesProposalProvider.class;174 }175 176 // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment177 public Class<? extends org.eclipse.xtext.common.types.access.jdt.IJavaProjectProvider> bindIJavaProjectProvider() {178 return org.eclipse.xtext.common.types.xtext.ui.XtextResourceSetBasedProjectProvider.class;179 }180 181 // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment182 public Class<? extends org.eclipse.xtext.ui.editor.hyperlinking.IHyperlinkHelper> bindIHyperlinkHelper() {183 return org.eclipse.xtext.common.types.xtext.ui.TypeAwareHyperlinkHelper.class;184 }185 186 // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment187 public Class<? extends org.eclipse.xtext.ui.editor.contentassist.PrefixMatcher> bindPrefixMatcher() {188 return org.eclipse.xtext.ui.editor.contentassist.FQNPrefixMatcher.class;189 }190 191 // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment192 public Class<? extends org.eclipse.xtext.ui.editor.contentassist.AbstractJavaBasedContentProposalProvider.ReferenceProposalCreator> bindAbstractJavaBasedContentProposalProvider$ReferenceProposalCreator() {193 return org.eclipse.xtext.common.types.xtext.ui.TypeAwareReferenceProposalCreator.class;194 }195 196 // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment197 public Class<? extends org.eclipse.xtext.ui.editor.IValidationJobScheduler> bindIValidationJobScheduler() {198 return org.eclipse.xtext.common.types.xtext.ui.JdtValidationJobScheduler.class;199 }200 201 // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment202 public Class<? extends org.eclipse.xtext.ui.refactoring.impl.RefactoringResourceSetProvider> bindRefactoringResourceSetProvider() {203 return org.eclipse.xtext.common.types.ui.refactoring.JvmRefactoringResourceSetProvider.class;204 }205 206 // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment207 public Class<? extends org.eclipse.xtext.common.types.ui.query.IJavaSearchParticipation> bindIJavaSearchParticipation() {208 return org.eclipse.xtext.common.types.ui.query.IJavaSearchParticipation.Yes.class;209 }210 211 136 // contributed by org.eclipse.xtext.ui.generator.templates.CodetemplatesGeneratorFragment 212 137 public com.google.inject.Provider<org.eclipse.xtext.ui.codetemplates.ui.preferences.TemplatesLanguageConfiguration> provideTemplatesLanguageConfiguration() { -
v2/trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/quickfix/EbnfQuickfixProvider.xtend
r64 r65 27 27 */ 28 28 class EbnfQuickfixProvider extends org.eclipse.xtext.ui.editor.quickfix.DefaultQuickfixProvider { 29 30 //***************************************************************************************** 29 31 //works 30 32 @Fix(EbnfValidator.ruleReferencedOneDescription) … … 37 39 ) [ element, context | 38 40 var Rule rule = element as Rule; 41 39 42 var IXtextDocument xtextDocument = context.getXtextDocument(); 40 43 var ICompositeNode node = NodeModelUtils.findActualNodeFor(rule); … … 50 53 var boolean foundRule = false; 51 54 var EObject r = references.get(0) as EObject; 52 var Rule containingRule =null;55 var Rule containingRule = null; 53 56 while (!foundRule) { 54 57 r = r.eContainer; … … 69 72 } 70 73 } 71 72 73 // delete rule 74 xtextDocument.replace(offset, textLength, ""); 74 // delete rule 75 xtextDocument.replace(offset, textLength, ""); 75 76 ] 76 77 77 78 } 78 79 80 //***************************************************************************************** 81 82 // @Fix(EbnfValidator.passthroughRuleDescription) 83 // def void fixRemovePassthroughRule(Issue issue, IssueResolutionAcceptor acceptor) { 84 // acceptor.accept( 85 // issue, 86 // "Remove passthrough rule", 87 // "Delete the passthrough rule and replace its references with its right side", 88 // "upcase.png", 89 // [ element, context | 90 // var Rule rule = element as Rule; 91 // var IXtextDocument xtextDocument = context.getXtextDocument(); 92 // var ICompositeNode node = NodeModelUtils.findActualNodeFor(rule); 93 // var String nodeText = node.text; 94 // var int textLength = nodeText.length - 2; 95 // var int offset = node.textRegion.offset; 96 // var ICompositeNode dList = NodeModelUtils.findActualNodeFor(rule.definitionList); 97 // var String refText = "(" + dList.text + ")"; 98 // var int refLength = rule.name.length; 99 // var List<RuleReference> references = EbnfAnalysisUtils.findReferences(rule); 100 // //sort references by offset 101 // var int i = 0; 102 // var List<RuleReference> referenceHleper = new ArrayList<RuleReference>(); 103 // while(i<references.length){ 104 // 105 // i++; 106 // } 107 // for (ruleRef : references) { 108 // var ICompositeNode refNode = NodeModelUtils.findActualNodeFor(ruleRef); 109 // var int refOffset = refNode.textRegion.offset; 110 // 111 // xtextDocument.replace(refOffset, refLength, refText); 112 // if (refOffset < offset) { 113 // offset += refText.length - refLength; 114 // } 115 // } 116 // ] 117 // ); 118 // } 119 120 //***************************************************************************************** 79 121 //works 80 // @Fix(EbnfValidator.passthroughRuleDescription) 81 // def void fixRemovePassthroughRule(Issue issue, IssueResolutionAcceptor acceptor) { 82 // acceptor.accept( 83 // issue, 84 // "Remove passthrough rule", 85 // "Delete the passthrough rule and replace its references with its right side", 86 // "upcase.png", 87 // [ element, context | 88 // var Rule rule = element as Rule; 89 // var IXtextDocument xtextDocument = context.getXtextDocument(); 90 // var ICompositeNode node = NodeModelUtils.findActualNodeFor(rule); 91 // var String nodeText = node.text; 92 // var int textLength = nodeText.length - 2; 93 // var int offset = node.textRegion.offset; 94 // var ICompositeNode dList = NodeModelUtils.findActualNodeFor(rule.definitionList); 95 // var String refText = "(" + dList.text + ")"; 96 // var int refLength = rule.name.length; 97 // var List<RuleReference> references = EbnfAnalysisUtils.findReferences(rule); 98 // //sort references by offset 99 // var int i = 0; 100 // var List<RuleReference> referenceHleper = new ArrayList<RuleReference>(); 101 // while(i<references.length){ 102 // 103 // i++; 104 // } 105 // for (ruleRef : references) { 106 // var ICompositeNode refNode = NodeModelUtils.findActualNodeFor(ruleRef); 107 // var int refOffset = refNode.textRegion.offset; 108 // 109 // xtextDocument.replace(refOffset, refLength, refText); 110 // if (refOffset < offset) { 111 // offset += refText.length - refLength; 112 // } 113 // } 114 // ] 115 // ); 116 // } 117 118 @Fix(EbnfValidator.unusedRuleDescription) 122 @Fix(EbnfValidator.unusedRuleDescription) 119 123 def void fixUnusedRule(Issue issue, IssueResolutionAcceptor acceptor) { 120 124 … … 131 135 } 132 136 } 133
Note: See TracChangeset
for help on using the changeset viewer.