Examples of selectAndReveal()


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

                }
              } else if (HTML.equals(extension)) {
                String wid_const = DocumentHelper.getNamespacePrefix(document);
                final IRegion region = frda.find(0, wid_const + ":id=\"" + wicketId, true, true, true, false);
                if (region != null) {
                  textEditor.selectAndReveal(region.getOffset() + wid_const.length() + 5, wicketId.length());
                  break;
                }
              } else if (PROPERTIES.equals(extension)) {
                // for the wicket tags that use wicket:message
                if (wicketId.startsWith("value:")) {
View Full Code Here

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

                      activePage.closeEditor(editor, false);
                      continue;
                    }
                    final IRegion lineRegion = document.getLineInformationOfOffset(sr.getOffset());
                    final int selectionLength = lineRegion.getOffset() + lineRegion.getLength() - sr.getOffset();
                    textEditor.selectAndReveal(sr.getOffset() + 1, selectionLength - 1);
                    foundInPropertiesFile = true;
                    break;
                  } else { // xml, select till </
                    final IRegion selEnd = frda.find(regionBegin.getOffset(), "</", true, true, false, false);
                    textEditor.selectAndReveal(sr.getOffset() + 2, selEnd.getOffset() - sr.getOffset() - 2);
View Full Code Here

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

                    textEditor.selectAndReveal(sr.getOffset() + 1, selectionLength - 1);
                    foundInPropertiesFile = true;
                    break;
                  } else { // xml, select till </
                    final IRegion selEnd = frda.find(regionBegin.getOffset(), "</", true, true, false, false);
                    textEditor.selectAndReveal(sr.getOffset() + 2, selEnd.getOffset() - sr.getOffset() - 2);
                    foundInPropertiesFile = true;
                    break;
                  }
                } else {
                  activePage.closeEditor(editor, false);
View Full Code Here

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

    }
    final ITextEditor textEditor = (ITextEditor) workbenchPart;
    return new LiveEditResultDialog.ErrorPositionHighlighter() {
      @Override
      public void highlight(int offset, int length) {
        textEditor.selectAndReveal(offset, length);
      }
    };
  }
}
View Full Code Here

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

                //DebugUIPlugin.log(e);
                e.printStackTrace();
              }
              provider.disconnect(input);
              if (offset >= 0 && lenght >=0) {
                textEditor.selectAndReveal(offset, lenght);
              }
            }

          }
        } catch (PartInitException e) {
View Full Code Here

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

            Object o = editor.getAdapter(ITextEditor.class);
            if (o != null)
              textEditor = (ITextEditor) o;
          }
          if (textEditor != null)
            textEditor.selectAndReveal(old.getOffset(), old.getLength());
        }
        finally {
          history.listenToSelectionChanges();
        }
      }
View Full Code Here

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

  private void gotoSelectedElement() {
    Object element = getSelectedElement();
    dispose();
    ITextEditor editor = getActiveTextEditor();
    if (editor != null) {
      editor.selectAndReveal(((IndexedRegion) element).getStartOffset(), ((IndexedRegion) element).getEndOffset() - ((IndexedRegion) element).getStartOffset());
    }
  }

  private ITextEditor getActiveTextEditor() {
    IWorkbench wb = PlatformUI.getWorkbench();
View Full Code Here

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

    }
    if (textEditor != null && textSelection != null) {
      ISelectionProvider sp = textEditor.getSelectionProvider();
      ITextSelection sel = new TextSelection(textSelection.getOffset(), text.length());
      sp.setSelection(sel);
      textEditor.selectAndReveal(sel.getOffset(), sel.getLength());
    }

    return true;
  }
View Full Code Here

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

          // select new selection
          if (newSelectionRegion != null) {
            fHistory.remember(new Region(textSelection.getOffset(), textSelection.getLength()));
            try {
              fHistory.ignoreSelectionChanges();
              textEditor.selectAndReveal(newSelectionRegion.getOffset(), newSelectionRegion.getLength());
            }
            finally {
              fHistory.listenToSelectionChanges();
            }
          }
View Full Code Here

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

            IDocument document = null;
            document = provider.getDocument(editorInput);
            try {
              IRegion line = document
                  .getLineInformation(lineNumber - 1);
              textEditor.selectAndReveal(line.getOffset(), line
                  .getLength());
            } catch (BadLocationException e) {
            }
            provider.disconnect(editorInput);
          }
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.