Package org.eclipse.jface.text

Examples of org.eclipse.jface.text.IDocument.replace()


                        { // LdifContentRecord ||
                            // LdifChangeAddRecord
                            LdifAttrValLine newLine = LdifAttrValLine.create( newAttributeDescription, oldValue );
                            try
                            {
                                document.replace( line.getOffset(), line.getLength(), newLine.toFormattedString( Utils
                                    .getLdifFormatParameters() ) );
                            }
                            catch ( BadLocationException e )
                            {
                                e.printStackTrace();
View Full Code Here


                        }
                    }

                    try
                    {
                        document.replace( line.getOffset(), line.getLength(), newLine.toFormattedString( Utils
                            .getLdifFormatParameters() ) );
                    }
                    catch ( BadLocationException e )
                    {
                        e.printStackTrace();
View Full Code Here

            ISelectionProvider selectionProvider = getSelectionProvider();
            ISelection selection = selectionProvider.getSelection();
            if (selection instanceof ITextSelection) {
                ITextSelection textSelection = (ITextSelection) selection;
                int offset = textSelection.getOffset();
                doc.replace(offset, 0, path);
            }
        } catch (BadLocationException e) {
            e.printStackTrace();
        }
    }
View Full Code Here

          // System.err.println("we are at " + where);
              final IDocument document= editor.
                  getDocumentProvider().
                  getDocument(editor.getEditorInput());
              if (document != null) {
                document.replace(where.x, where.y, "•");
                editor.selectAndReveal(where.x+1, 0);
              }
        }
          catch (BadLocationException e) {
          // TODO Auto-generated catch block
View Full Code Here

              final IDocument document= editor.
                  getDocumentProvider().
                  getDocument(editor.getEditorInput());
              if (document != null) {
                String w = document.get(where.x, where.y);
                document.replace(where.x, where.y, "´" + w + "´");
                if (w.length() == 0)
                  editor.selectAndReveal(where.x+1, 0);
              }
        }
          catch (BadLocationException e) {
View Full Code Here

              final IDocument document= editor.
                  getDocumentProvider().
                  getDocument(editor.getEditorInput());
              if (document != null) {
                String w = document.get(where.x, where.y);
                document.replace(where.x, where.y, "`" + w + "`");
                if (w.length() == 0)
                  editor.selectAndReveal(where.x+1, 0);
              }
        }
          catch (BadLocationException e) {
View Full Code Here

                  getDocument(editor.getEditorInput());
             
              fpc.resetHash();
              fpc.msgHandler.clearMessages();
          theEditor.removeParserAnnotations();
          document.replace(0,1, document.get(0, 1));             
        }
          catch (Exception e) {
          // e.printStackTrace();
        }
      }
View Full Code Here

      // modify the document
      beginCompoundEdit();
      if (fCopy) {
//        fDescription= new EditDescription(offset, 0, insertion.length());
        document.replace(offset, 0, insertion);
      } else {
//        fDescription= new EditDescription(offset, insertion.length(), insertion.length());
        document.replace(offset, insertion.length(), insertion);
      }
View Full Code Here

      if (fCopy) {
//        fDescription= new EditDescription(offset, 0, insertion.length());
        document.replace(offset, 0, insertion);
      } else {
//        fDescription= new EditDescription(offset, insertion.length(), insertion.length());
        document.replace(offset, insertion.length(), insertion);
      }

      // move the selection along
      int selOffset= movingArea.getOffset() + deviation;
      int selLength= movingArea.getLength() + (fAddDelimiter ? delim.length() : 0);
View Full Code Here

      }

      String target= document.get(sel.x, sel.y);
      String replacement= (fToUpper ? target.toUpperCase() : target.toLowerCase());
      if (!target.equals(replacement)) {
        document.replace(sel.x, target.length(), replacement);
        // https://bugs.eclipse.org/bugs/show_bug.cgi?id=145326: replacement might be larger than the original
        int adjustment= replacement.length() - target.length();
        if (adjustment > 0)
          sel.y += adjustment;
       }
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.