コード例 #1
0
 protected void _format(final Command command, @Extension final IFormattableDocument document) {
   final Procedure1<IHiddenRegionFormatter> _function =
       new Procedure1<IHiddenRegionFormatter>() {
         @Override
         public void apply(final IHiddenRegionFormatter it) {
           it.newLine();
         }
       };
   document.<Command>prepend(command, _function);
 }
コード例 #2
0
 protected void _format(final State state, @Extension final IFormattableDocument document) {
   final Procedure1<IHiddenRegionFormatter> _function =
       new Procedure1<IHiddenRegionFormatter>() {
         @Override
         public void apply(final IHiddenRegionFormatter it) {
           it.setNewLines(1, 1, 2);
         }
       };
   document.<State>prepend(state, _function);
   ISemanticRegionsFinder _regionFor = this.textRegionExtensions.regionFor(state);
   ISemanticRegion _keyword = _regionFor.keyword("end");
   final Procedure1<IHiddenRegionFormatter> _function_1 =
       new Procedure1<IHiddenRegionFormatter>() {
         @Override
         public void apply(final IHiddenRegionFormatter it) {
           it.newLine();
         }
       };
   document.prepend(_keyword, _function_1);
   ISemanticRegionsFinder _regionFor_1 = this.textRegionExtensions.regionFor(state);
   ISemanticRegion _keyword_1 = _regionFor_1.keyword("state");
   ISemanticRegionsFinder _regionFor_2 = this.textRegionExtensions.regionFor(state);
   ISemanticRegion _keyword_2 = _regionFor_2.keyword("end");
   Pair<ISemanticRegion, ISemanticRegion> _mappedTo =
       Pair.<ISemanticRegion, ISemanticRegion>of(_keyword_1, _keyword_2);
   final Procedure1<IHiddenRegionFormatter> _function_2 =
       new Procedure1<IHiddenRegionFormatter>() {
         @Override
         public void apply(final IHiddenRegionFormatter it) {
           it.indent();
         }
       };
   document.<ISemanticRegion, ISemanticRegion>interior(_mappedTo, _function_2);
   EList<Command> _commands = state.getCommands();
   for (final Command command : _commands) {
     this.format(command, document);
   }
   EList<Transition> _transitions = state.getTransitions();
   for (final Transition transition : _transitions) {
     this.format(transition, document);
   }
 }
コード例 #3
0
 protected void _format(
     final Transition transition, @Extension final IFormattableDocument document) {
   final Procedure1<IHiddenRegionFormatter> _function =
       new Procedure1<IHiddenRegionFormatter>() {
         @Override
         public void apply(final IHiddenRegionFormatter it) {
           it.newLine();
         }
       };
   document.<Transition>prepend(transition, _function);
   Condition _condition = transition.getCondition();
   this.format(_condition, document);
 }