Package org.eclipse.ui.texteditor

Examples of org.eclipse.ui.texteditor.ITextEditor.selectAndReveal()


                    document);
                try {
                  IRegion region = finder.find(0,
                      markerToFind, true, true, true,
                      false);
                  editorTextual.selectAndReveal(
                      region.getOffset(),
                      region.getLength());
                } catch (BadLocationException e) {
                  e.printStackTrace();
                }
View Full Code Here


                    document);
                try {
                  IRegion region = finder.find(0,
                      markerToFind, true, true, true,
                      false);
                  editorTextual.selectAndReveal(
                      region.getOffset(),
                      region.getLength());
                } catch (BadLocationException e) {
                  e.printStackTrace();
                }
View Full Code Here

                    editor = openEditorReuse(marker);
                else
                    editor = openEditorNoReuse(marker);
                Position p = InternalSearchUI.getInstance().getPositionTracker().getCurrentPosition(marker);
                if (p != null)
                    editor.selectAndReveal(p.getOffset(), p.getLength());
                else
                    editor.selectAndReveal(marker.getOffset(), marker.getLength());
                if (focusControl != null && !focusControl.isDisposed())
                    focusControl.setFocus();
            } catch (PartInitException e) {
View Full Code Here

                    editor = openEditorNoReuse(marker);
                Position p = InternalSearchUI.getInstance().getPositionTracker().getCurrentPosition(marker);
                if (p != null)
                    editor.selectAndReveal(p.getOffset(), p.getLength());
                else
                    editor.selectAndReveal(marker.getOffset(), marker.getLength());
                if (focusControl != null && !focusControl.isDisposed())
                    focusControl.setFocus();
            } catch (PartInitException e) {
                String message = Messages.format(SearchMessages.ReplaceDialog_error_unable_to_open_text_editor,
                        ((IFile) marker.getElement()).getName());
View Full Code Here

      try {
        if (line == -1) {
          line = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput()).getNumberOfLines();
        }
        lineRegion = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput()).getLineInformation(line - 1);
        textEditor.selectAndReveal(lineRegion.getOffset(), lineRegion.getLength());
      } catch (BadLocationException e) {
        // TODO popup for a feedback to the user ?
        CCWPlugin.logError("unable to select line " + line + " in the file", e);
      }
    }
View Full Code Here

            editor.getEditorInput());
        if (document != null)
          try {
            IRegion line = document
                .getLineInformation(selectedLine);
            editor.selectAndReveal(line.getOffset(), 0);
          } catch (BadLocationException e) {
            // line seems not to exist in
            // workspace version
          }
      }
View Full Code Here

    int startPos = firstItem.getStartPosition();
    int endPos = firstItem.getEndPosition();
    if (!selecteditems.hasNext()) {
      // select whole tag
      if(firstItem.getClass().getName().endsWith("CfmlComment")){
        editor.selectAndReveal(firstItem.getStartPosition(), firstItem.getEndPosition() - firstItem.getStartPosition() + 1);
        return;
      }
      if (firstItem instanceof TagItem) {
        TagItem cti = (TagItem) firstItem;
        if (cti.matchingItem != null) {
View Full Code Here

      // otherwise select selected items
      while (selecteditems.hasNext()) {
        endPos = ((DocItem) selecteditems.next()).getEndPosition();
      }
    }
    editor.selectAndReveal(startPos, endPos - startPos + 1);
  }

  /**
   * Gets the selected item parses it, and adds the defined stuff to the
   * editor
 
View Full Code Here

                    int offset = lineInfo.getOffset();
                    int lineLength = lineInfo.getLength();

                    if (col != null && (col[0] != 0 || col[1] != 0)) {
                      if (col[1] >= col[0]) {
                        textEditor.selectAndReveal(offset + col[0] - 1, col[1] - col[0] + 1);
                      } else {
                        if (col[0] < lineLength) {
                          textEditor.selectAndReveal(offset + col[0] - 1, lineLength - col[0]);
                        } else {
                          textEditor.selectAndReveal(offset, lineLength);
View Full Code Here

                    if (col != null && (col[0] != 0 || col[1] != 0)) {
                      if (col[1] >= col[0]) {
                        textEditor.selectAndReveal(offset + col[0] - 1, col[1] - col[0] + 1);
                      } else {
                        if (col[0] < lineLength) {
                          textEditor.selectAndReveal(offset + col[0] - 1, lineLength - col[0]);
                        } else {
                          textEditor.selectAndReveal(offset, lineLength);
                        }
                      }
                    } else {
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.