Package org.eclipse.wst.sse.ui.internal

Examples of org.eclipse.wst.sse.ui.internal.StructuredTextViewer


  }

  StructuredTextEditor fTextEditor = null;

  public int getCaretOffset() {
    StructuredTextViewer stv = fTextEditor.getTextViewer();
    if ((stv != null) && (stv.getTextWidget() != null) && !stv.getTextWidget().isDisposed()) {
      return stv.widgetOffset2ModelOffset(stv.getTextWidget().getCaretOffset());
    }
    return 0;
  }
View Full Code Here


  }

  SourceViewer doCreateViewer(Composite parent, SourceViewerConfiguration viewerConfiguration) {
    SourceViewer viewer = null;
    String contentTypeID = ContentTypeIdForJSP.ContentTypeID_JSP;
    viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
    viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
    IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(contentTypeID);
    IDocument document = scratchModel.getStructuredDocument();
    viewer.configure(viewerConfiguration);
    viewer.setDocument(document);
View Full Code Here

      public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
        return baseConfiguration.getLineStyleProviders(sourceViewer, partitionType);
      }
    };
    SourceViewer viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
    viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
    IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForJSP.ContentTypeID_JSP);
    IDocument document = scratchModel.getStructuredDocument();
    viewer.configure(sourceViewerConfiguration);
    viewer.setDocument(document);
    return viewer;
  }
View Full Code Here

        changed = true;
       
        //get the display for the editor if we can
        Display display = null;
        if(textEditor instanceof StructuredTextEditor) {
          StructuredTextViewer viewer = ((StructuredTextEditor)textEditor).getTextViewer();
          if(viewer != null) {
            display = viewer.getControl().getDisplay();
          }
        }
       
        //create the toggling operation
        IRunnableWithProgress toggleCommentsRunnable = new ToggleLinesRunnable(
View Full Code Here

   * Creates the source viewer to be used by this editor
   */
  protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler verticalRuler, int styles) {
    fAnnotationAccess = createAnnotationAccess();
    fOverviewRuler = createOverviewRuler(getSharedColors());
    StructuredTextViewer sourceViewer = createStructedTextViewer(parent, verticalRuler, styles);
    initSourceViewer(sourceViewer);
    return sourceViewer;
  }
View Full Code Here

    }
    return cat;
  }

  protected StructuredTextViewer createStructedTextViewer(Composite parent, IVerticalRuler verticalRuler, int styles) {
    return new StructuredTextViewer(parent, verticalRuler, getOverviewRuler(), isOverviewRulerVisible(), styles);
  }
View Full Code Here

   * that viewer configuration could be set after editor part was created.
   */
  protected void setSourceViewerConfiguration(SourceViewerConfiguration config) {
    SourceViewerConfiguration oldSourceViewerConfiguration = getSourceViewerConfiguration();
    super.setSourceViewerConfiguration(config);
    StructuredTextViewer stv = getTextViewer();
    if (stv != null) {
      /*
       * There should be no need to unconfigure before configure because
       * configure will also unconfigure before configuring
       */
      removeReconcilingListeners(oldSourceViewerConfiguration, stv);
      stv.unconfigure();
      setStatusLineMessage(null);
      stv.configure(config);
      addReconcilingListeners(config, stv);
    }
  }
View Full Code Here

   * Creates the source viewer to be used by this editor
   */
  protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler verticalRuler, int styles) {
    fAnnotationAccess = createAnnotationAccess();
    fOverviewRuler = createOverviewRuler(getSharedColors());
    StructuredTextViewer sourceViewer = createStructedTextViewer(parent, verticalRuler, styles);
    initSourceViewer(sourceViewer);
    return sourceViewer;
  }
View Full Code Here

    }
    return cat;
  }

  protected StructuredTextViewer createStructedTextViewer(Composite parent, IVerticalRuler verticalRuler, int styles) {
    return new StructuredTextViewer(parent, verticalRuler, getOverviewRuler(), isOverviewRulerVisible(), styles);
  }
View Full Code Here

   * that viewer configuration could be set after editor part was created.
   */
  protected void setSourceViewerConfiguration(SourceViewerConfiguration config) {
    SourceViewerConfiguration oldSourceViewerConfiguration = getSourceViewerConfiguration();
    super.setSourceViewerConfiguration(config);
    StructuredTextViewer stv = getTextViewer();
    if (stv != null) {
      /*
       * There should be no need to unconfigure before configure because
       * configure will also unconfigure before configuring
       */
      removeReconcilingListeners(oldSourceViewerConfiguration, stv);
      stv.unconfigure();
      setStatusLineMessage(null);
      stv.configure(config);
      addReconcilingListeners(config, stv);
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.wst.sse.ui.internal.StructuredTextViewer

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.