Package org.eclipse.jface.text.contentassist

Examples of org.eclipse.jface.text.contentassist.ContentAssistant


        EclimPlugin.getShell(), null, null, false,
        SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.FULL_SELECTION,
        CUIPlugin.getDefault().getPreferenceStore());
    viewer.setDocument(ProjectUtils.getDocument(project, file));

    ContentAssistant ca = (ContentAssistant)config.getContentAssistant(viewer);
    Method computeCompletionProposals =
      ContentAssistant.class.getDeclaredMethod(
          "computeCompletionProposals", ITextViewer.class, Integer.TYPE);
    computeCompletionProposals.setAccessible(true);
View Full Code Here


  public CommitMessageArea(Composite parent, String initialText, int styles) {
    super(parent, initialText, styles);
  }

  protected IContentAssistant createContentAssistant(ISourceViewer viewer) {
    ContentAssistant assistant = new ContentAssistant();
    assistant.enableAutoInsert(true);
    final CommitProposalProcessor processor = getCommitProposalProcessor();
    getTextWidget().addDisposeListener(new DisposeListener() {

      public void widgetDisposed(DisposeEvent e) {
        processor.dispose();
      }
    });
    assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);
    return assistant;
  }
View Full Code Here

    }

    @Override
    public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {

        ContentAssistant assistant = new ContentAssistant();

        assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
        if (apexCompletionProcessor != null) {
            assistant.setContentAssistProcessor(apexCompletionProcessor, IDocument.DEFAULT_CONTENT_TYPE);
            apexCompletionProcessor.setContentAssistant(assistant);
        }

        assistant.setContentAssistProcessor(new ApexDocCompletionProcessor(), ApexPartitionScanner.APEX_DOC);
        assistant.enableAutoActivation(true);
        assistant.setAutoActivationDelay(500);
        assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_STACKED);
        assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_BELOW);
        assistant.setShowEmptyList(true); // display no proposal when code assist is triggered by ctrl+space, but display nothing when triggered by auto-activation

        if (apexCodeColorProvider != null) {
            assistant.setContextInformationPopupBackground(apexCodeColorProvider.getColor(new RGB(150, 150, 0)));
        }

        assistant.addCompletionListener(new ICompletionListener() {
            public void assistSessionEnded(ContentAssistEvent event) {
                ((ApexCompletionProcessor) event.assistant.getContentAssistProcessor(IDocument.DEFAULT_CONTENT_TYPE))
                        .clearState();
            }

            public void assistSessionStarted(ContentAssistEvent event) {}

            public void selectionChanged(ICompletionProposal proposal, boolean smartToggle) {}
        });

        assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
        return assistant;
    }
View Full Code Here

    if (sourceViewer instanceof PHPStructuredTextViewer) {

      ITextEditor textEditor = ((PHPStructuredTextViewer) sourceViewer)
          .getTextEditor();
      if (phpCompletionProcessor == null) {
        ContentAssistant phpContentAssistant = (ContentAssistant) getPHPContentAssistant(sourceViewer);
        // phpCompletionProcessor may be initialized in
        // getPHPContentAssistant call
        if (phpCompletionProcessor == null) {
          phpCompletionProcessor = new PHPCompletionProcessor(
              textEditor, phpContentAssistant,
              PHPPartitionTypes.PHP_DEFAULT);
          addContentAssistProcessors(sourceViewer);
        }
      } else {
        ContentAssistant phpContentAssistant = (ContentAssistant) getPHPContentAssistant(sourceViewer);
        // make sure current contentAssistant install dltk's
        // ContentAssistProcessor.CompletionListener,so we can call
        // IContentAssistantExtension3.setRepeatedInvocationTrigger for
        // PHPContentAssistant,so we can press "ctrl+space" to switch
        // between different template categories
View Full Code Here

        SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
    SourceViewerConfiguration configuration = new SourceViewerConfiguration() {
      public IContentAssistant getContentAssistant(
          ISourceViewer sourceViewer) {

        ContentAssistant assistant = new ContentAssistant();
        assistant.enableAutoActivation(true);
        assistant.enableAutoInsert(true);
        assistant.setContentAssistProcessor(fTemplateProcessor,
            IDocument.DEFAULT_CONTENT_TYPE);
        return assistant;
      }
    };
    viewer.configure(configuration);
View Full Code Here

          SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
      SourceViewerConfiguration configuration = new SourceViewerConfiguration() {
        public IContentAssistant getContentAssistant(
            ISourceViewer sourceViewer) {

          ContentAssistant assistant = new ContentAssistant();
          assistant.enableAutoActivation(true);
          assistant.enableAutoInsert(true);
          assistant.setContentAssistProcessor(getTemplateProcessor(),
              IDocument.DEFAULT_CONTENT_TYPE);
          assistant.setProposalSelectorBackground(Display
              .getCurrent().getSystemColor(
                  SWT.COLOR_INFO_BACKGROUND));
          return assistant;
        }
      };
View Full Code Here

        globalsViewer.configure(new DRLSourceViewerConfig(null) {
            public IReconciler getReconciler(ISourceViewer sourceViewer) {
                return null;
            }
            public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
                ContentAssistant assistant = new ContentAssistant();
                IContentAssistProcessor completionProcessor = new GlobalCompletionProcessor();
                assistant.setContentAssistProcessor(
                    completionProcessor, IDocument.DEFAULT_CONTENT_TYPE);
                assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
                return assistant;
            }
        });
        IDocument document = new Document(getProcessImports());
        globalsViewer.setDocument(document);
View Full Code Here

        constraintViewer.configure(new DRLSourceViewerConfig(null) {
            public IReconciler getReconciler(ISourceViewer sourceViewer) {
                return null;
            }
            public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
                ContentAssistant assistant = new ContentAssistant();
                completionProcessor = new ConstraintCompletionProcessor(process);
                assistant.setContentAssistProcessor(
                    completionProcessor, IDocument.DEFAULT_CONTENT_TYPE);
                assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
                return assistant;
            }
        });
        IDocument document = new Document();
        constraintViewer.setDocument(document);
View Full Code Here

        importsViewer.configure(new DRLSourceViewerConfig(null) {
            public IReconciler getReconciler(ISourceViewer sourceViewer) {
                return null;
            }
            public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
                ContentAssistant assistant = new ContentAssistant();
                IContentAssistProcessor completionProcessor = new ImportCompletionProcessor();
                assistant.setContentAssistProcessor(
                    completionProcessor, IDocument.DEFAULT_CONTENT_TYPE);
                assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
                return assistant;
            }
        });
        IDocument document = new Document(getProcessImports());
        importsViewer.setDocument(document);
View Full Code Here

        constraintViewer.configure(new DRLSourceViewerConfig(null) {
            public IReconciler getReconciler(ISourceViewer sourceViewer) {
                return null;
            }
            public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
                ContentAssistant assistant = new ContentAssistant();
                completionProcessor = new ConstraintCompletionProcessor(process);
                assistant.setContentAssistProcessor(
                    completionProcessor, IDocument.DEFAULT_CONTENT_TYPE);
                assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
                return assistant;
            }
        });
        String value = (String) getValue();
        if (value == null) {
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.contentassist.ContentAssistant

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.