Package io.emmet

Examples of io.emmet.SelectionData


         
          if (nextNl != null)
            nl = nextNl;
         
          // check out next line padding
          SelectionData lineRange = editor.getCurrentLineRange();
          StringBuilder nextPadding = new StringBuilder();
         
          for (int i = lineRange.getEnd() + nl.length(); i < c_len; i++) {
            char ch = content.charAt(i);
            if (ch == ' ' || ch == '\t')
              nextPadding.append(ch);
            else
              break;
View Full Code Here


  @Override
  public SelectionData getSelectionRange() {
    ISelectionProvider sp = editor.getEditorSite().getSelectionProvider();
    ISelection selection = sp.getSelection();
     
    SelectionData result = new SelectionData();
   
    if (selection instanceof ITextSelection) {
      ITextSelection txSel = (ITextSelection) selection;
      result.updateRangeWithLength(txSel.getOffset(), txSel.getLength());
    }
   
    return result;
  }
View Full Code Here

  public SelectionData getCurrentLineRange() {
    return getLineRangeFromPosition(getCaretPos());
  }
 
  public SelectionData getLineRangeFromPosition(int pos) {
    SelectionData result = new SelectionData();
   
    try {
      IRegion lineInfo = doc.getLineInformationOfOffset(pos);
      result.updateRangeWithLength(lineInfo.getOffset(), lineInfo.getLength());
    } catch (BadLocationException e) { }
   
    return result;
  }
View Full Code Here

    }
  }

  @Override
  public String getSelection() {
    SelectionData selection = getSelectionRange();
    try {
      return doc.get(selection.getStart(), selection.getLength());
    } catch (BadLocationException e) {
      return "";
    }
  }
View Full Code Here

  @Override
  public SelectionData getSelectionRange() {
    ISelectionProvider sp = editor.getEditorSite().getSelectionProvider();
    ISelection selection = sp.getSelection();
     
    SelectionData result = new SelectionData();
   
    if (selection instanceof ITextSelection) {
      ITextSelection txSel = (ITextSelection) selection;
      result.updateRangeWithLength(txSel.getOffset(), txSel.getLength());
    }
   
    return result;
  }
View Full Code Here

  public SelectionData getCurrentLineRange() {
    return getLineRangeFromPosition(getCaretPos());
  }
 
  public SelectionData getLineRangeFromPosition(int pos) {
    SelectionData result = new SelectionData();
   
    try {
      IRegion lineInfo = doc.getLineInformationOfOffset(pos);
      result.updateRangeWithLength(lineInfo.getOffset(), lineInfo.getLength());
    } catch (BadLocationException e) { }
   
    return result;
  }
View Full Code Here

    }
  }

  @Override
  public String getSelection() {
    SelectionData selection = getSelectionRange();
    try {
      return doc.get(selection.getStart(), selection.getLength());
    } catch (BadLocationException e) {
      return "";
    }
  }
View Full Code Here

TOP

Related Classes of io.emmet.SelectionData

Copyright © 2018 www.massapicom. 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.