Package org.eclipse.jface.text.source

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


     * @param parent the parent composite of the viewer
     * @return a configured <code>SourceViewer</code>
     */
    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() {
        public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {

          ContentAssistant assistant= new ContentAssistant();
          assistant.enableAutoActivation(true);
          assistant.enableAutoInsert(true);
View Full Code Here


    int styles= SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION;
    fSourceViewer= createSourceViewer(parent, fVerticalRuler, styles);

    if (fConfiguration == null)
      fConfiguration= new SourceViewerConfiguration();
    fSourceViewer.configure(fConfiguration);

    if (fSourceViewer instanceof ISourceViewerExtension4)
      fKeyBindingSupportForContentAssistant= new KeyBindingSupportForAssistant(((ISourceViewerExtension4)fSourceViewer));
View Full Code Here

   * <p>Subclasses may extend or override this method.</p>
   *
   * @since 3.3
   */
  protected void installTabsToSpacesConverter() {
    SourceViewerConfiguration config= getSourceViewerConfiguration();
    if (config != null && fSourceViewer instanceof ITextViewerExtension7) {
      int tabWidth= config.getTabWidth(fSourceViewer);
      TabsToSpacesConverter tabToSpacesConverter= new TabsToSpacesConverter();
      tabToSpacesConverter.setLineTracker(new DefaultLineTracker());
      tabToSpacesConverter.setNumberOfSpacesPerTab(tabWidth);
      ((ITextViewerExtension7)fSourceViewer).setTabsToSpacesConverter(tabToSpacesConverter);
      updateIndentPrefixes();
View Full Code Here

   * the values provided by the source viewer configuration.
   *
   * @since 3.3
   */
  protected final void updateIndentPrefixes() {
    SourceViewerConfiguration configuration= getSourceViewerConfiguration();
    String[] types= configuration.getConfiguredContentTypes(fSourceViewer);
    for (int i= 0; i < types.length; i++) {
      String[] prefixes= configuration.getIndentPrefixes(fSourceViewer, types[i]);
      if (prefixes != null && prefixes.length > 0)
        fSourceViewer.setIndentPrefixes(prefixes, types[i]);
    }
  }
View Full Code Here

            public void resetForceTabs() {

            }

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

        IQuickAssistProcessor quickAssistProcessor = createConsoleQuickAssistProcessor(quickAssist);

        // Correction assist works on all
        quickAssist.setQuickAssistProcessor(quickAssistProcessor);

        SourceViewerConfiguration cfg = new PydevScriptConsoleSourceViewerConfiguration(createHover(), contentAssist,
                quickAssist);
        return cfg;
    }
View Full Code Here

   * @return a configured <code>SourceViewer</code>
   */
  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() {
      public IContentAssistant getContentAssistant(
          ISourceViewer sourceViewer) {

        ContentAssistant assistant = new ContentAssistant();
        assistant.enableAutoActivation(true);
View Full Code Here

    @Override
    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() {
        public IContentAssistant getContentAssistant(
            ISourceViewer sourceViewer) {

          ContentAssistant assistant = new ContentAssistant();
          assistant.enableAutoActivation(true);
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

   */
  protected void configureTextViewer(TextViewer textViewer) {
    // to get undo for all text files
    // bugzilla 131895, 33665
    if (textViewer instanceof MergeSourceViewer) {
      SourceViewerConfiguration configuration = new SourceViewerConfiguration();
      ((MergeSourceViewer) textViewer).configure(configuration);
    }
  }
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.