Package org.eclipse.jface.text.source

Examples of org.eclipse.jface.text.source.SourceViewerConfiguration


   * @param parent the parent control
   * @return a configured source viewer
   */
  protected SourceViewer createViewer(Composite parent) {
    SourceViewer viewer= new SourceViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
    SourceViewerConfiguration configuration= new SourceViewerConfiguration();
    viewer.configure(configuration);
    IDocument document= new Document();
    viewer.setDocument(document);
    return viewer;
  }
View Full Code Here


      TemplatePersistenceData data= (TemplatePersistenceData) selection.getFirstElement();
      Template template= data.getTemplate();
      if(template.getContextTypeId().contains("vhdl"))
      {
        getViewer().unconfigure();
        SourceViewerConfiguration configuration= HdlSourceViewerConfiguration.createForVhdl(new VerilogEditor());
        getViewer().configure(configuration);
       
       
      }
      else if(template.getContextTypeId().contains("verilog"))
      {
        getViewer().unconfigure();
        SourceViewerConfiguration configuration= HdlSourceViewerConfiguration.createForVerilog(new VhdlEditor());
        getViewer().configure(configuration);
      }
      else
      {
        getViewer().unconfigure();
        SourceViewerConfiguration configuration= new SourceViewerConfiguration();
        getViewer().configure(configuration);
      }
    }
    super.updateViewerInput();
  }
View Full Code Here

        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

  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

            }
            ignoreTextConverters = false;
        }

        public void updateIndentationPrefixes() {
            SourceViewerConfiguration configuration = getSourceViewerConfiguration();
            String[] types = configuration.getConfiguredContentTypes(this);
            for (int i = 0; i < types.length; i++) {
                String[] prefixes = configuration.getIndentPrefixes(this, types[i]);
                if (prefixes != null && prefixes.length > 0) setIndentPrefixes(prefixes, types[i]);
            }
        }
View Full Code Here

        public void setTextConverter(TabConverter tabConverter) {
            ColoringEditor.this.tabConverter = tabConverter;
        }

        public void updateIndentationPrefixes() {
            SourceViewerConfiguration configuration = getSourceViewerConfiguration();
            String[] types = configuration.getConfiguredContentTypes(this);
            for (int i = 0; i < types.length; i++) {
                String[] prefixes = configuration.getIndentPrefixes(this, types[i]);
                if (prefixes != null && prefixes.length > 0) {
                    setIndentPrefixes(prefixes, types[i]);
                }
            }
        }
View Full Code Here

  private void configureToggleCommentAction() {
    IAction action = getAction("ToggleComment"); //$NON-NLS-1$
    if (action instanceof ToggleCommentAction) {
      ISourceViewer sourceViewer = getSourceViewer();
      SourceViewerConfiguration configuration = getSourceViewerConfiguration();
      ((ToggleCommentAction) action).configure(sourceViewer, configuration);
    }
  }
View Full Code Here

   * @param parent the parent control
   * @return a configured source viewer
   */
  protected SourceViewer createViewer(Composite parent) {
    SourceViewer viewer= new SourceViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
    SourceViewerConfiguration configuration= new SourceViewerConfiguration();
    viewer.configure(configuration);
    IDocument document= new Document();
    viewer.setDocument(document);
    return viewer;
  }
View Full Code Here

   * @param parent the parent control
   * @return a configured source viewer
   */
  protected SourceViewer createPatternViewer(Composite parent) {
    SourceViewer viewer= new SourceViewer(parent, null, null, false, SWT.V_SCROLL | SWT.H_SCROLL);
    SourceViewerConfiguration configuration= new SourceViewerConfiguration();
    viewer.configure(configuration);
    IDocument document= new Document();
    viewer.setDocument(document);
    viewer.setEditable(false);
    return viewer;
View Full Code Here

      composite.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
    }

    // Source viewer
    fViewer= new SourceViewer(composite, null, textStyle);
    fViewer.configure(new SourceViewerConfiguration());
    fViewer.setEditable(false);

    fText= fViewer.getTextWidget();
    gd= new GridData(GridData.BEGINNING | GridData.FILL_BOTH);
    fText.setLayoutData(gd);
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.source.SourceViewerConfiguration

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.