Examples of IDocument


Examples of org.eclipse.jface.text.IDocument

  public void openLabelEditor(IFile labelFile, String labelKey) {
    try {
      IEditorPart editor = WorkbenchUtils.openEditor(Plugin.getDefault().getWorkbench(), labelFile);
      if (editor instanceof TextEditor) {
        ITextEditor textEditor = (ITextEditor) editor;
        IDocument doc = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
        try {
          // search for line starting with label key
          FindReplaceDocumentAdapter finder = new FindReplaceDocumentAdapter(doc);
          IRegion keyRegion = finder.find(0, "^" + LabelFileEncodingHelper.saveConvert(labelKey,true).replaceAll("\\\\", "\\\\\\\\") + "\\s*=", true, false, false, true);
          if (keyRegion != null) {
View Full Code Here

Examples of org.eclipse.jface.text.IDocument

      } else if (editorPart instanceof TMLEditor) {
        // check if current selection is an tmlscript partion - otherwise return TML-Snippet-Context
        ISelection selection = ((TMLEditor) editorPart).getSelectionProvider().getSelection();
        if (selection instanceof ITextSelection) {
          int selectionOffset = ((TextSelection)selection).getOffset();
          IDocument doc = ((TMLEditor)editorPart).getDocumentProvider().getDocument(editorPart.getEditorInput());
          if (doc != null) {
            ITypedRegion partition;
            try {
              partition = doc.getPartition(selectionOffset);
              if (partition.getType().equals(TMLScriptPartitionScanner.TMLSCRIPT)) {
                return Snippet.CONTEXT_TMLScript;
              }
            } catch (BadLocationException e) {
            }         
View Full Code Here

Examples of org.eclipse.jface.text.IDocument

    if (editorPart != null && editorPart instanceof ITextEditor) {
      ITextEditor editor = (ITextEditor) editorPart;
      ISelection selection = editor.getEditorSite().getSelectionProvider().getSelection();
      if (selection != null && selection instanceof ITextSelection) {
        ITextSelection textSelection = (ITextSelection)selection;
        IDocument doc = editor.getDocumentProvider().getDocument(editor.getEditorInput());
        if (doc != null) {
          try {
            _snippet.apply(doc, textSelection, editor);
          } catch (BadLocationException e) {
          }
View Full Code Here

Examples of org.eclipse.jface.text.IDocument

    if (event.getSource() instanceof IConsole) {
      IConsole console = (IConsole)event.getSource();
      if (TomcatUtils.getInstance().isTomcatProcess(console.getProcess())) {
        try {
          // parse TML Warning
          IDocument document = console.getDocument();
          String content = document.get(event.getOffset(), event.getLength());
          TMLWarning warning = TMLWarning.parse(content);
         
          // compute link offset & length
          int linkOffset = event.getOffset();
          int linkLength = event.getLength();
View Full Code Here

Examples of org.eclipse.jface.text.IDocument

  private static Change createDirlinkChange(DirlinkRefactoringInformation info) throws Exception {

   
    if(info.getArguments() instanceof MoveArguments || info.getArguments() instanceof RenameArguments){
      TextFileChange change = new TextFileChange("", info.getFile());
      IDocument doc = change.getCurrentDocument(new NullProgressMonitor());
      // create Textedit
   
 
      FindReplaceDocumentAdapter find = new FindReplaceDocumentAdapter(doc);
      IRegion resultStart = find.find(0, "location\\s*=\\s*\"", true, true, false, true);
View Full Code Here

Examples of org.eclipse.jface.text.IDocument

    if (editorPart != null && editorPart instanceof AbstractWGATextEditor) {
      AbstractWGATextEditor editor = (AbstractWGATextEditor) editorPart;     
      ISelection selection = editor.getEditorSite().getSelectionProvider().getSelection();
      if (selection != null && selection instanceof ITextSelection) {
        ITextSelection textSelection = (ITextSelection)selection;
        IDocument doc = editor.getDocumentProvider().getDocument(editor.getEditorInput());
        if (doc != null) {
          try {
            ITypedRegion region = doc.getPartition(textSelection.getOffset());           
           
            // comment handling for TMLScriptEditor
            if (editorPart instanceof TMLScriptEditor) {
              if (region.getType().equals(TMLScriptPartitionScanner.MCOMMENT)) {
                removeTMLScriptComment(doc, region);
View Full Code Here

Examples of org.eclipse.jface.text.IDocument

        textViewer = new TextViewer(stackComposite, SWT.H_SCROLL | SWT.V_SCROLL);
        textViewer.setEditable(false);
        // textViewer.setHoverControlCreator(null)

        textControl = textViewer.getTextWidget();
        IDocument document = new Document("");
        textViewer.setDocument(document);

        textSelectionListener = new ISelectionChangedListener() {

            public void selectionChanged(SelectionChangedEvent event) {
View Full Code Here

Examples of org.eclipse.jface.text.IDocument

    /**
     * Fill the context menu
     * @param menuManager menu
     */
    protected void contextMenuAboutToShow(IMenuManager menuManager) {
        IDocument doc = textViewer.getDocument();
        if (doc == null) {
            return;
        }

        menuManager
View Full Code Here

Examples of org.eclipse.jface.text.IDocument

                editorListener);

        }
        if (textViewer != null && textViewer.getTextWidget() != null
            && !textViewer.getTextWidget().isDisposed()) {
            IDocument document = new Document("");
            textViewer.setDocument(document);
        }
        if (tableControl != null && !tableControl.isDisposed()) {
            setVerifyTableItems(null);
        }
View Full Code Here

Examples of org.eclipse.jface.text.IDocument

        }

        lastChildElement = childEl;
        if (clearOutput) {
            if (!modes.get(BCOConstants.F_SHOW_ANALYZER)) {
                IDocument document = new Document("");
                textViewer.setDocument(document);
            } else {
                setVerifyTableItems(null);
            }
        }
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.