Package org.eclipse.jface.text

Examples of org.eclipse.jface.text.Document


                       "       Class ( )\n" + //
                       "   then\n" + //
                       "       " +//
                       "end\n\n" ;

        IDocument doc = new Document( input );
        IDocumentPartitioner partitioner = new FastPartitioner( new DRLPartionScanner(),
                                                                DRLPartionScanner.LEGAL_CONTENT_TYPES );
        partitioner.connect( doc );
        doc.setDocumentPartitioner( partitioner );
        return doc;
    }
View Full Code Here


    Label previewLabel= new Label(composite, SWT.NONE);
    previewLabel.setText(RefactoringMessages.ExtractMethodInputPage_signature_preview);

   
    fPreviewViewer = new PHPStructuredTextViewer(composite, null, null, false, SWT.READ_ONLY | SWT.V_SCROLL | SWT.WRAP);
    fPreviewViewer.setDocument(new Document());
    //fPreviewViewer.adaptBackgroundColor(composite);
   
    StyledText textWidget = fPreviewViewer.getTextWidget();
   
    textWidget.setAlwaysShowScrollBars(false);
View Full Code Here

     
      FunctionDeclaration function = previewAST.newFunctionDeclaration(previewAST.newIdentifier(fMethodName), computeArguments(previewAST), previewAST.newBlock(), false);
      MethodDeclaration method = previewAST.newMethodDeclaration(fModifierAccessFlag, function);
      previewProgram.statements().add(method);
     
      Document myDoc = new Document();
      previewProgram.rewrite(myDoc, null).apply(myDoc);
     
      return myDoc.get().substring(0, myDoc.get().indexOf(METHOD_ARGUMENT_CLOSING_CHAR) + 1);
     
    } catch (Exception e) {
      return RefactoringMessages.ExtractMethodPreviewPage_NoSignaturePreviewAvailable;
    }
  }
View Full Code Here

            "test.in/TestSourceFile-expected2.txt");
    }
   
    private void _testFile(String inFile, String outFile) throws IOException
    {
        Document doc = new Document(readFile(inFile));
        new PerlPartitioner(new Log(), doc);

        String expected = readFile(outFile);

        SourceFile src = new SourceFile(new Log(), doc);
View Full Code Here

    private void _testFile(String path, PrintWriter w)
        throws IOException, TokenStreamException
    {
        String source = readFile(path);
        PerlMultiLexer selector =
            new PerlMultiLexer(new Document(source), null);

        int i = 0;
        Token t;
        while ((t = nextToken(selector, path)).getType() != Token.EOF_TYPE)
        {
View Full Code Here

         * @see org.eclipse.jface.viewers.ISelectionProvider#getSelection()
         */
        @Override
        public ISelection getSelection() {
            if (fControl instanceof StyledText) {
                final IDocument document = new Document(
                        ((StyledText) fControl).getSelectionText());
                return new TextSelection(document, 0, document.getLength());
            }
            return StructuredSelection.EMPTY;
        }
View Full Code Here

        if (content == null) {
            fViewer.setInput(null);
            return;
        }

        final IDocument doc = new Document(content);
        fViewer.setInput(doc);
    }
View Full Code Here

    }

    @Override
    public void setInput(final Object input) {
        if (input instanceof IStreamContentAccessor) {
            final Document document = new Document(getString(input));
            // ErlangCompareUtilities.setupDocument(document);
            fSourceViewer.setDocument(document);
        }
        fInput = input;
    }
View Full Code Here

                colorManager, backend));

        consoleInputViewer = new SourceViewer(sashForm, null, SWT.MULTI | SWT.WRAP
                | SWT.V_SCROLL);
        consoleInputText = consoleInputViewer.getTextWidget();
        consoleInputViewer.setDocument(new Document());
        consoleInputViewer.configure(new ErlangConsoleSourceViewerConfiguration(store,
                colorManager, backend));

        sashForm.setWeights(new int[] { 2, 1 });
View Full Code Here

            if (contents != null) {
                final int n = contents.length();
                buffer = new char[n];
                contents.getChars(0, n, buffer, 0);

                doc = new Document(contents);
                setupDocument(doc);
            }
        }

        try {
View Full Code Here

TOP

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

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.