Examples of SelectionData


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

Examples of io.emmet.SelectionData

  @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

Examples of io.emmet.SelectionData

  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

Examples of io.emmet.SelectionData

    }
  }

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

Examples of io.emmet.SelectionData

  @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

Examples of io.emmet.SelectionData

  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

Examples of io.emmet.SelectionData

    }
  }

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

Examples of org.eclipse.ui.internal.forms.widgets.SelectionData

    });
  }

  private void startSelection(MouseEvent e) {
    inSelection = true;
    selData = new SelectionData(e);
    redraw();
    Form form = FormUtil.getForm(this);
    if (form != null)
      form.setSelectionText(this);
  }
View Full Code Here

Examples of org.eclipse.ui.internal.forms.widgets.SelectionData

    });
  }

  private void startSelection(MouseEvent e) {
    inSelection = true;
    selData = new SelectionData(e);
    redraw();
    Form form = FormUtil.getForm(this);
    if (form != null)
      form.setSelectionText(this);
  }
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.