Package org.eclipse.jface.text

Examples of org.eclipse.jface.text.IDocument


        if ( source == this )
        {
            return;
        }

        IDocument document = getDocument( input );
        if ( document != null )
        {
            try
            {
                inSetContent = true;
View Full Code Here


    @Override
    protected IDocument createDocument( Object element ) throws CoreException
    {
        input = getEntryEditorInput( element );
        IEntry entry = getEntryEditorInput( element ).getSharedWorkingCopy( editor );
        IDocument document = new Document();
        if ( entry != null )
        {
            setDocumentInput( document, entry );
        }
        setupDocument( document );
View Full Code Here

                        IWorkbenchPage page = window.getActivePage();
                        IEditorPart editor = page.openEditor( input, editorId );
                        IDocumentProvider documentProvider = ( ( LdifEditor ) editor ).getDocumentProvider();
                        if ( documentProvider != null && input != null )
                        {
                            IDocument document = documentProvider.getDocument( input );
                            if ( document != null )
                            {
                                document.set( ldif.toString() );
                            }
                        }

                    }
                    catch ( PartInitException e )
View Full Code Here

    public ICompletionProposal[] computeQuickAssistProposals(IQuickAssistInvocationContext context) {
        List<ICompletionProposal> proposals = new LinkedList<ICompletionProposal>();

        ISourceViewer viewer = context.getSourceViewer();
        @SuppressWarnings("unused")
        IDocument document = viewer.getDocument();
        IAnnotationModel model = viewer.getAnnotationModel();

        @SuppressWarnings("rawtypes")
        Iterator iter = model.getAnnotationIterator();
View Full Code Here

                resourceName = input.getName();
            }
        }

        final IDocumentProvider docProvider = sourcePage.getDocumentProvider();
        IDocument document = docProvider.getDocument(input);
        try {
            model.loadFrom(new IDocumentWrapper(document));
            model.setBndResourceName(resourceName);

            if (resource != null) {
View Full Code Here

        }
        // File content updated externally => reload all pages
        else if ((delta.getKind() & IResourceDelta.CHANGED) > 0 && (delta.getFlags() & IResourceDelta.CONTENT) > 0) {
            if (!saving.get()) {
                final IDocumentProvider docProvider = sourcePage.getDocumentProvider();
                final IDocument document = docProvider.getDocument(getEditorInput());
                SWTConcurrencyUtil.execForControl(getEditorSite().getShell(), true, new Runnable() {
                    public void run() {
                        try {
                            model.loadFrom(new IDocumentWrapper(document));
                            updatePages();
View Full Code Here

        assert (mainEditor != null);
        assert (switchToPageId != null);

        mainEditor.setActivePage(switchToPageId);

        IDocument document = textEditor.getDocumentProvider().getDocument(mainEditor.getEditorInput());
        proposal.apply(document);

        Point selection = proposal.getSelection(document);
        if (selection != null)
            textEditor.selectAndReveal(selection.x, 0);
View Full Code Here

    private void updateBundleBlueprintAndIncludeResource(IFile blueprintFile, IFile bndFile) throws Exception {

        BndEditModel editModel;
        IEditorPart editor = ResourceUtil.findEditor(workbench.getActiveWorkbenchWindow().getActivePage(), bndFile);
        IDocument doc = null;
        if (editor instanceof BndEditor) {
            editModel = ((BndEditor) editor).getEditModel();
        } else {
            editModel = new BndEditModel();
            doc = FileUtils.readFully(bndFile);
View Full Code Here

    if (!keyListeners.containsKey(id)) {
      keyListeners.put(id, new VerifyKeyListener() {
       
        @Override
        public void verifyKey(VerifyEvent event) {
          IDocument document = EclipseEmmetHelper.getDocument(editor);
          if (document == null) {
            return;
          }
         
          if (LinkedModeModel.hasInstalledModel(document)) {
View Full Code Here

   * Returns current editor's syntax mode
   */
  public static String getSyntax(EclipseEmmetEditor editor) {
    String result = null;
   
    IDocument doc = editor.getDocument();
    String className = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
        .getActivePage().getActiveEditor().getSite().getId().toLowerCase();
   
    // try to get current partition (true Eclipse)
    try {
      ITypedRegion[] regions = doc.computePartitioning(editor.getCaretPos(), 0);
      if (regions.length > 0) {
        result = guessSyntaxFromString(regions[0].getType());
      }
    } catch (Exception e) {  }
   
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.