Package org.eclipse.jface.text.contentassist

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


          processor = getWojJavaCompletionProcessor30(ed);
        }
      }
      if(processor != null) {
        try {
          ContentAssistant assistant = (ContentAssistant) HookUtil.getPrivateAttributeValue(SourceViewer.class, "fContentAssistant", ed.getViewer()); //$NON-NLS-1$
          //HookUtil.callPrivateMethod("org.eclipse.jdt.internal.ui.javaeditor.JavaEditor","initializeEditor", null, ed, null);
          //assistant.install(ed.getViewer());
          assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);
          SourceViewerConfiguration conf = (SourceViewerConfiguration) HookUtil.getPrivateAttributeValue(AbstractTextEditor.class, "fConfiguration", ed); //$NON-NLS-1$
          ContentAssistPreference.configure(assistant, (IPreferenceStore) HookUtil.getPrivateAttributeValue(Class.forName("org.eclipse.ui.editors.text.TextSourceViewerConfiguration"),"fPreferenceStore", conf));
        } catch (ClassNotFoundException ex) {
          WojPlugin.log("exception occured while installing content assist processor", ex); //$NON-NLS-1$
        }
View Full Code Here


  /**
   * @param ed
   */
  private static IContentAssistProcessor getWojJavaCompletionProcessor30(CompilationUnitEditor ed) {
    try {
      ContentAssistant assistant = (ContentAssistant) HookUtil.getPrivateAttributeValue(SourceViewer.class, "fContentAssistant", ed.getViewer()); //$NON-NLS-1$
      IContentAssistProcessor processor = (IContentAssistProcessor) HookUtil.newInstance("org.jayasoft.woj.client.util.completion.eclipse30.WojJavaCompletionProcessor",new Class[]{IEditorPart.class} ,new Object[]{ed}); //$NON-NLS-1$
      assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);
      SourceViewerConfiguration conf = (SourceViewerConfiguration) HookUtil.getPrivateAttributeValue(AbstractTextEditor.class, "fConfiguration", ed); //$NON-NLS-1$
      ContentAssistPreference.configure(assistant, (IPreferenceStore) HookUtil.getPrivateAttributeValue(Class.forName("org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration"),"fPreferenceStore", conf));

    } catch (Exception ex) {
        WojPlugin.log("exception occured while hacking content assist processor", ex); //$NON-NLS-1$
View Full Code Here

    return null;
  }

  private static IContentAssistProcessor getWojJavaCompletionProcessor32(CompilationUnitEditor ed) {
    try {
      ContentAssistant assistant = (ContentAssistant) HookUtil.getPrivateAttributeValue(SourceViewer.class, "fContentAssistant", ed.getViewer()); //$NON-NLS-1$
      return (IContentAssistProcessor) HookUtil.newInstance("org.jayasoft.woj.client.util.completion.eclipse32.WojJavaCompletionProcessor",new Class[]{IEditorPart.class, ContentAssistant.class, String.class} ,new Object[]{ed, assistant , IDocument.DEFAULT_CONTENT_TYPE }); //$NON-NLS-1$
    } catch (Exception ex) {
        WojPlugin.log("exception occured while hacking content assist processor", ex); //$NON-NLS-1$
    }
    return null;
View Full Code Here

    return null;
  }

  private static IContentAssistProcessor getWojJavaCompletionProcessor31(CompilationUnitEditor ed) {
    try {
      ContentAssistant assistant = (ContentAssistant) HookUtil.getPrivateAttributeValue(SourceViewer.class, "fContentAssistant", ed.getViewer()); //$NON-NLS-1$
      return (IContentAssistProcessor) HookUtil.newInstance("org.jayasoft.woj.client.util.completion.eclipse31.WojJavaCompletionProcessor",new Class[]{IEditorPart.class} ,new Object[]{ed}); //$NON-NLS-1$
    } catch (Exception ex) {
        WojPlugin.log("exception occured while hacking content assist processor", ex); //$NON-NLS-1$
    }
    return null;
View Full Code Here

    return assistProcessor;
  }
 
  @Override
  public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
    ContentAssistant assistant = new ContentAssistant();
    assistant.enableAutoInsert(true);
    assistant.setContentAssistProcessor(getAssistProcessor(),IDocument.DEFAULT_CONTENT_TYPE);
    assistant.install(sourceViewer);
   
    return assistant;
  }
View Full Code Here

  private void updateAssistProperties(PropertyChangeEvent event) {
    String key = event.getProperty();
    try {
      // auto activation delay
      if (key.equals(HTMLPlugin.PREF_ASSIST_TIMES)) {
        ContentAssistant assistant = (ContentAssistant) getSourceViewerConfiguration().getContentAssistant(null);
        assistant.setAutoActivationDelay(Integer.parseInt((String) event.getNewValue()));

        // auto activation trigger
      }
      else if (key.equals(HTMLPlugin.PREF_ASSIST_CHARS)) {
        ContentAssistant assistant = (ContentAssistant) getSourceViewerConfiguration().getContentAssistant(null);
        HTMLAssistProcessor processor = (HTMLAssistProcessor) assistant.getContentAssistProcessor(IDocument.DEFAULT_CONTENT_TYPE);
        processor.setAutoAssistChars(((String) event.getNewValue()).toCharArray());

        // completion close tag
      }
      else if (key.equals(HTMLPlugin.PREF_ASSIST_CLOSE)) {
        ContentAssistant assistant = (ContentAssistant) getSourceViewerConfiguration().getContentAssistant(null);
        HTMLAssistProcessor processor = (HTMLAssistProcessor) assistant.getContentAssistProcessor(IDocument.DEFAULT_CONTENT_TYPE);
        processor.setAssistCloseTag(((Boolean) event.getNewValue()).booleanValue());

        // enable auto activation or not
      }
      else if (key.equals(HTMLPlugin.PREF_ASSIST_AUTO)) {
        ContentAssistant assistant = (ContentAssistant) getSourceViewerConfiguration().getContentAssistant(null);
        assistant.enableAutoActivation(((Boolean) event.getNewValue()).booleanValue());
      }
    }
    catch (Exception ex) {
      HTMLPlugin.logException(ex);
    }
View Full Code Here

   * Creates or Returns the <code>IContentAssistant</code>.
   */
  @Override
  public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
    if(_assistant==null){
      _assistant = new ContentAssistant();
      _assistant.setInformationControlCreator(new IInformationControlCreator() {
        public IInformationControl createInformationControl(Shell parent) {
          return new DefaultInformationControl(parent);
        }});
      _assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
View Full Code Here

  }

  public IContentAssistant getContentAssistant(ISourceViewer _sourceViewer) {
    if (myContentAssistant == null) {
      WodCompletionProcessor completionProcessor = new WodCompletionProcessor(myEditor);
      myContentAssistant = new ContentAssistant();
      myContentAssistant.setContentAssistProcessor(completionProcessor, IDocument.DEFAULT_CONTENT_TYPE);
      myContentAssistant.enableAutoActivation(true);
      myContentAssistant.setAutoActivationDelay(500);
      myContentAssistant.enableAutoInsert(true);
      myContentAssistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
View Full Code Here

    return new String[] { IDocument.DEFAULT_CONTENT_TYPE, CSSPartitionScanner.CSS_COMMENT };
  }

  @Override
  public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
    ContentAssistant assistant = new ContentAssistant();
    assistant.enableAutoInsert(true);
    CSSAssistProcessor processor = new CSSAssistProcessor();
    assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);
    assistant.install(sourceViewer);

    //    IPreferenceStore store = HTMLPlugin.getDefault().getPreferenceStore();
    //    assistant.enableAutoActivation(store.getBoolean(HTMLPlugin.PREF_ASSIST_AUTO));
    //    assistant.setAutoActivationDelay(store.getInt(HTMLPlugin.PREF_ASSIST_TIMES));
View Full Code Here

    /**
     * Get the appropriate content assistance, for each partition.
     */
    public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
        ContentAssistant assistant = new ContentAssistant();
        assistant.setContentAssistProcessor(
            new DefaultCompletionProcessor(getEditor()), IDocument.DEFAULT_CONTENT_TYPE);
        assistant.setContentAssistProcessor(
            new DSLRuleCompletionProcessor(getEditor()), DRLPartionScanner.RULE_PART_CONTENT);
        assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
        assistant.setAutoActivationDelay(0);
        return assistant;
    }
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.