- Timestamp:
- 10/22/10 08:58:43 (14 years ago)
- Location:
- trunk/de.ugoe.cs.swe.bnftools.ebnf.ui
- Files:
-
- 4 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/plugin.xml
r5 r9 65 65 class="de.ugoe.cs.swe.bnftools.ui.EbnfExecutableExtensionFactory:de.ugoe.cs.swe.bnftools.ui.refactoring.autorenumber.AutoRenumberRefactoringHandler" 66 66 commandId="de.ugoe.cs.swe.bnftools.Ebnf.refactoring.autorenumber"> 67 <activeWhen> 68 <reference 69 definitionId="de.ugoe.cs.swe.bnftools.Ebnf.Editor.opened"> 70 </reference> 71 </activeWhen> 67 72 </handler> 68 73 <handler 69 74 class="de.ugoe.cs.swe.bnftools.ui.EbnfExecutableExtensionFactory:de.ugoe.cs.swe.bnftools.ui.refactoring.replacepassthroughrules.ReplaceAllPassthroughRulesRefactoringHandler" 70 75 commandId="de.ugoe.cs.swe.bnftools.Ebnf.refactoring.replacepassthroughrules"> 76 <activeWhen> 77 <reference 78 definitionId="de.ugoe.cs.swe.bnftools.Ebnf.Editor.opened"> 79 </reference> 80 </activeWhen> 71 81 </handler> 72 82 <handler 73 83 class="de.ugoe.cs.swe.bnftools.ui.EbnfExecutableExtensionFactory:de.ugoe.cs.swe.bnftools.ui.refactoring.removeunusedrules.RemoveUnusedRulesRefactoringHandler" 74 84 commandId="de.ugoe.cs.swe.bnftools.Ebnf.refactoring.removeunusedrules"> 85 <activeWhen> 86 <reference 87 definitionId="de.ugoe.cs.swe.bnftools.Ebnf.Editor.opened"> 88 </reference> 89 </activeWhen> 75 90 </handler> 76 91 <handler 77 92 class="de.ugoe.cs.swe.bnftools.ui.EbnfExecutableExtensionFactory:de.ugoe.cs.swe.bnftools.ui.refactoring.uppercasetokenrules.UppercaseTokenRulesRefactoringHandler" 78 93 commandId="de.ugoe.cs.swe.bnftools.Ebnf.refactoring.uppercasetokenrules"> 94 <activeWhen> 95 <reference 96 definitionId="de.ugoe.cs.swe.bnftools.Ebnf.Editor.opened"> 97 </reference> 98 </activeWhen> 79 99 </handler> 80 100 <handler 81 101 class="de.ugoe.cs.swe.bnftools.ui.EbnfExecutableExtensionFactory:de.ugoe.cs.swe.bnftools.ui.refactoring.inlinetokenrules.InlineTokenRulesRefactoringHandler" 82 102 commandId="de.ugoe.cs.swe.bnftools.Ebnf.refactoring.inlinetokenrules"> 103 <activeWhen> 104 <reference 105 definitionId="de.ugoe.cs.swe.bnftools.Ebnf.Editor.opened"> 106 </reference> 107 </activeWhen> 83 108 </handler> 84 109 <handler 85 110 class="de.ugoe.cs.swe.bnftools.ui.EbnfExecutableExtensionFactory:de.ugoe.cs.swe.bnftools.ui.refactoring.inlinesinglereferencedrules.InlineSingleReferencedRulesRefactoringHandler" 86 111 commandId="de.ugoe.cs.swe.bnftools.Ebnf.refactoring.inlinesinglereferencedrules"> 112 <activeWhen> 113 <reference 114 definitionId="de.ugoe.cs.swe.bnftools.Ebnf.Editor.opened"> 115 </reference> 116 </activeWhen> 117 </handler> 118 <handler 119 class="de.ugoe.cs.swe.bnftools.ui.EbnfExecutableExtensionFactory:de.ugoe.cs.swe.bnftools.ui.formatter.FormatterHandler" 120 commandId="de.ugoe.cs.swe.bnftools.Ebnf.formatter"> 121 <activeWhen> 122 <reference 123 definitionId="de.ugoe.cs.swe.bnftools.Ebnf.Editor.opened"> 124 </reference> 125 </activeWhen> 87 126 </handler> 88 127 </extension> … … 142 181 </command> 143 182 <command 183 description="Trigger custom bnftools formatter" 184 id="de.ugoe.cs.swe.bnftools.Ebnf.formatter" 185 name="Custom Formatter"> 186 </command> 187 <command 144 188 description="Rename Refactoring" 145 189 id="de.ugoe.cs.swe.bnftools.Ebnf.refactoring.rename" … … 200 244 </visibleWhen> 201 245 </command> 246 <command 247 commandId="de.ugoe.cs.swe.bnftools.Ebnf.formatter" 248 style="push" 249 tooltip="Trigger custom bnftools formatting"> 250 <visibleWhen checkEnabled="false"> 251 <reference 252 definitionId="de.ugoe.cs.swe.bnftools.Ebnf.Editor.opened"> 253 </reference> 254 </visibleWhen> 255 </command> 202 256 <menu 203 257 id="org.etsi.bnftools.refactoring.menu" … … 251 305 style="push" 252 306 tooltip="Trigger Uppercase All Token Rules Refactoring"> 307 <visibleWhen 308 checkEnabled="false"> 309 <reference 310 definitionId="de.ugoe.cs.swe.bnftools.Ebnf.Editor.opened"> 311 </reference> 312 </visibleWhen> 253 313 </command> 254 314 <command … … 256 316 style="push" 257 317 tooltip="Trigger Inline All Token Rules Refactoring"> 318 <visibleWhen 319 checkEnabled="false"> 320 <reference 321 definitionId="de.ugoe.cs.swe.bnftools.Ebnf.Editor.opened"> 322 </reference> 323 </visibleWhen> 258 324 </command> 259 325 <command … … 261 327 style="push" 262 328 tooltip="Trigger Inline All Single References Rules Refactoring"> 329 <visibleWhen 330 checkEnabled="false"> 331 <reference 332 definitionId="de.ugoe.cs.swe.bnftools.Ebnf.Editor.opened"> 333 </reference> 334 </visibleWhen> 263 335 </command> 264 336 </menu> -
trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/formatter/FormatterProcessor.java
r8 r9 103 103 compositeChange.add(fileChange); 104 104 105 String newText = "foobar"; 105 FormatterConfig config = new FormatterConfig(); 106 EbnfFormatterVisitor visitor = new EbnfFormatterVisitor(rootNode.getElement(), config); 107 visitor.accept(); 106 108 107 ReplaceEdit replaceEdit = new ReplaceEdit(0, document.getLength(), newText);109 ReplaceEdit replaceEdit = new ReplaceEdit(0, document.getLength(), visitor.getBuf().toString()); 108 110 multiEdit.addChild(replaceEdit); 109 111
Note: See TracChangeset
for help on using the changeset viewer.