Package org.eclipse.jface.text

Examples of org.eclipse.jface.text.IDocumentAdapter


        PHPStructuredEditor phpEditor = (PHPStructuredEditor) editor;
        boolean isDirty = phpEditor.isDirty();
        if (phpEditor.getTextViewer() instanceof PHPStructuredTextViewer) {
          PHPStructuredTextViewer textViewer = (PHPStructuredTextViewer) phpEditor
              .getTextViewer();
          IDocumentAdapter documentAdapter = textViewer
              .getDocumentAdapter();
          IDocument document = phpEditor.getDocument();
          String content = document.get();
          if (documentAdapter != null) {
            documentAdapter.replaceTextRange(0, content.length(),
                ""); //$NON-NLS-1$
            documentAdapter.replaceTextRange(0, 0, content);
          }

        }
        if (!isDirty) {
          phpEditor.doSave(null);
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.IDocumentAdapter

Copyright © 2018 www.massapicom. 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.