Package org.eclipse.jface.text

Examples of org.eclipse.jface.text.IDocument


    IPath path = fSourceModule.getPath();
    bufferManager.connect(path, LocationKind.IFILE, null);
    ITextFileBuffer textFileBuffer = bufferManager.getTextFileBuffer(path,
        LocationKind.IFILE);
   
    IDocument document = textFileBuffer.getDocument();
   
    DocumentChange anotherChange = new DocumentChange(RefactoringMessages.ExtractMethodPreviewPage_TextChangeName, document);
   
    MultiTextEdit rootEdit = new MultiTextEdit();
   
View Full Code Here


  }

  private String computeReplacementString() {

    ITextViewer viewer = getTextViewer();
    IDocument document = viewer.getDocument();
    ITextEditor textEditor = ((PHPStructuredTextViewer) viewer)
        .getTextEditor();

    try {
View Full Code Here

    public DuplicatedCodeInstanceElement(final IFile containingFile, final int startLine,
            final int startColumn, final int endLine, final int endColumn) {

        this.containingFile = containingFile;
        this.startLine = startLine;
        final IDocument doc = WranglerUtils.getDocument(containingFile);
        try {
            startOffset = WranglerUtils.calculateOffsetFromPosition(startLine,
                    startColumn, doc);
            endOffset = WranglerUtils
                    .calculateOffsetFromPosition(endLine, endColumn, doc);
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

    public IHyperlink[] detectHyperlinks(final ITextViewer textViewer,
            final IRegion region, final boolean canShowMultipleHyperlinks) {
        if (region == null) {
            return null;
        }
        final IDocument document = textViewer.getDocument();
        if (document == null) {
            return null;
        }
        return detectHyperlinks(document, region.getOffset());
    }
View Full Code Here

        final int offset = invocationContext.getOffset();
        final ErlToken token = module.getScanner().getTokenAt(offset);
        if (token == null || token.getKind() != ErlToken.KIND_STRING) {
            return false;
        }
        final IDocument doc = viewer.getDocument();
        String text;
        try {
            text = doc.get(token.getOffset(), token.getLength());
            if (text.contains("\n")) {
                return true;
            }
        } catch (final BadLocationException e) {
        }
View Full Code Here

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

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

        if (module == null) {
            return;
        }
        final ITextEditor textEditor = getTextEditor();
        {
            final IDocument document = textEditor.getDocumentProvider().getDocument(
                    textEditor.getEditorInput());
            final String text = document.get();
            final String scannerName = module.getScannerName();

            final InternalScanner internalScanner = (InternalScanner) ErlangEngine
                    .getInstance().getSimpleScannerService();
            final OtpErlangObject checkAll = internalScanner.checkAll(scannerName, text,
View Full Code Here

        fGlobalActions.put(actionID, action);
        actionBars.setGlobalActionHandler(actionID, action);
    }

    protected void contextMenuAboutToShow(final IMenuManager menuManager) {
        final IDocument doc = consoleOutputViewer.getDocument();
        if (doc == null) {
            return;
        }

        menuManager.add(fGlobalActions.get(ActionFactory.CUT.getId()));
View Full Code Here

     */
    @Override
    public IStructureComparator getStructure(final Object input) {
        String contents = null;
        char[] buffer = null;
        IDocument doc = CompareUI.getDocument(input);
        if (doc == null) {
            if (input instanceof IStreamContentAccessor) {
                final IStreamContentAccessor sca = (IStreamContentAccessor) input;
                try {
                    contents = ErlangCompareUtilities.readString(sca);
View Full Code Here

TOP

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

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.