Advertisement
Guest User

FormatModel

a guest
Jun 1st, 2016
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.42 KB | None | 0 0
  1. package com.gameforge.idea.Corona.lang.formatter;
  2.  
  3. import com.intellij.formatting.Block;
  4. import com.intellij.formatting.FormattingDocumentModel;
  5. import com.intellij.formatting.FormattingModel;
  6. import com.intellij.lang.ASTNode;
  7. import com.intellij.openapi.editor.Document;
  8. import com.intellij.openapi.util.TextRange;
  9. import com.intellij.psi.PsiFile;
  10. import com.intellij.psi.formatter.FormattingDocumentModelImpl;
  11. import org.jetbrains.annotations.NotNull;
  12. import org.jetbrains.annotations.Nullable;
  13.  
  14. /**
  15.  * Created by felix.doerschner on 01.06.2016.
  16.  */
  17. public class CoronaFormatModel implements FormattingModel {
  18.     Block rootBlock;
  19.     FormattingDocumentModel documentModel;
  20.     PsiFile file;
  21.  
  22.     public CoronaFormatModel(Block root, PsiFile file) {
  23.         rootBlock = root;
  24.         this.file = file;
  25.         documentModel = FormattingDocumentModelImpl.createOn(file);
  26.     }
  27.  
  28.     @NotNull
  29.     @Override
  30.     public Block getRootBlock() {
  31.         return rootBlock;
  32.     }
  33.  
  34.     @NotNull
  35.     @Override
  36.     public FormattingDocumentModel getDocumentModel() {
  37.         return documentModel;
  38.     }
  39.  
  40.     @Override
  41.     public TextRange replaceWhiteSpace(TextRange textRange, String s) {
  42.         return null;
  43.     }
  44.  
  45.     @Override
  46.     public TextRange shiftIndentInsideRange(ASTNode astNode, TextRange textRange, int i) {
  47.         return null;
  48.     }
  49.  
  50.     @Override
  51.     public void commitChanges() {
  52.  
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement