Package org.eclipse.xtext.ui.editor.model

Examples of org.eclipse.xtext.ui.editor.model.IXtextDocument.replace()


        final IXtextDocument xtextDocument = context.getXtextDocument();
        Integer _offset = issue.getOffset();
        Integer _length = issue.getLength();
        int _plus = ((_offset).intValue() + (_length).intValue());
        int _minus = (_plus - 1);
        xtextDocument.replace(_minus, 1, "");
        Integer _offset_1 = issue.getOffset();
        xtextDocument.replace((_offset_1).intValue(), 1, "");
      }
    };
    acceptor.accept(issue, "Remove quotes.", "Remove quotes.", null, _function);
View Full Code Here


        Integer _length = issue.getLength();
        int _plus = ((_offset).intValue() + (_length).intValue());
        int _minus = (_plus - 1);
        xtextDocument.replace(_minus, 1, "");
        Integer _offset_1 = issue.getOffset();
        xtextDocument.replace((_offset_1).intValue(), 1, "");
      }
    };
    acceptor.accept(issue, "Remove quotes.", "Remove quotes.", null, _function);
  }
 
View Full Code Here

    final IModification _function = new IModification() {
      public void apply(final IModificationContext context) throws Exception {
        final IXtextDocument xtextDocument = context.getXtextDocument();
        Integer _offset = issue.getOffset();
        Integer _length = issue.getLength();
        xtextDocument.replace((_offset).intValue(), (_length).intValue(), "");
      }
    };
    acceptor.accept(issue, "Remove deprecated keywords.", "Remove deprecated keywords.", null, _function);
  }
 
View Full Code Here

        Integer _length = issue.getLength();
        final String fullId = xtextDocument.get((_offset).intValue(), (_length).intValue());
        final String replaceID = fullId.replaceAll("\\^", "");
        Integer _offset_1 = issue.getOffset();
        Integer _length_1 = issue.getLength();
        xtextDocument.replace((_offset_1).intValue(), (_length_1).intValue(), replaceID);
      }
    };
    acceptor.accept(issue, "Remove deprecated escape character.", "Remove deprecated escape character.", null, _function);
  }
}
View Full Code Here

        IXtextDocument _xtextDocument = it.getXtextDocument();
        Integer _offset = issue.getOffset();
        Integer _length = issue.getLength();
        String[] _data = issue.getData();
        String _head = IterableExtensions.<String>head(((Iterable<String>)Conversions.doWrapArray(_data)));
        _xtextDocument.replace((_offset).intValue(), (_length).intValue(), _head);
      }
    };
    acceptor.accept(issue, _plus, _builder.toString(), null, _function);
  }
}
View Full Code Here

  @Override
  public void apply(IModificationContext context) throws BadLocationException {
    IXtextDocument xtextDocument = context.getXtextDocument();
    String tmp = text + xtextDocument.get(offset, length) + suffix;
    xtextDocument.replace(offset, length, tmp);
  }

}
View Full Code Here

      if(s.charAt(s.length() - 1) == c && (c == '\'' || c == '"')) {
        o++;
        l -= 2;
      }
    }
    xtextDocument.replace(o, l, text);
  }

}
View Full Code Here

      issue, "Change to regular variable reference", "Removes the '{' and '}'", null, new IModification() {

        @Override
        public void apply(IModificationContext context) throws Exception {
          IXtextDocument doc = context.getXtextDocument();
          doc.replace(
            issue.getOffset(), issue.getLength(),
            "$" + doc.get(issue.getOffset() + 2, issue.getLength() - 3));
        }
      });
View Full Code Here

          builder.append(varName);
          builder.append(" ? {");
          builder.append(" undef => '', default => ");
          builder.append(varName);
          builder.append("}");
          doc.replace(issue.getOffset(), issue.getLength(), builder.toString());
        }
      });
  }
}
View Full Code Here

        int start = issue.getOffset();
        while( ! b.toString().startsWith("id") ) {
          b.insert(0,xtextDocument.getChar(--start))
        }
       
        xtextDocument.replace(start, (b + issue.getData()[0]).length(),"");
      }
    });
  }
 
  @Fix(FXGraphJavaValidator.UNKNOWN_CONTROLLER_METHOD)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.