Package org.eclipse.jface.text.formatter

Examples of org.eclipse.jface.text.formatter.IContentFormatter


   */
  public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
    // try to use the StructuredTextMultiPassContentFormatter so that it
    // picks up any additional formatting strategies contributed via the
    // editorConfiguration extension point
    IContentFormatter formatter = null;
    if (sourceViewer != null) {
      IDocument document = sourceViewer.getDocument();
      if (document instanceof IDocumentExtension3) {
        String partitioning = getConfiguredDocumentPartitioning(sourceViewer);
        IDocumentPartitioner partitioner = ((IDocumentExtension3) document).getDocumentPartitioner(partitioning);
View Full Code Here


        this.getContentAssistant(), partitionType, sourceViewer);
    return new IContentAssistProcessor[]{processor};
  }

  public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
    IContentFormatter formatter = super.getContentFormatter(sourceViewer);
    // super was unable to create a formatter, probably because
    // sourceViewer does not have document set yet, so just create a
    // generic one
    if (!(formatter instanceof MultiPassContentFormatter))
      formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IXMLPartitions.XML_DEFAULT);
View Full Code Here

   */
  public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
    // try to use the StructuredTextMultiPassContentFormatter so that it
    // picks up any additional formatting strategies contributed via the
    // editorConfiguration extension point
    IContentFormatter formatter = null;
    if (sourceViewer != null) {
      IDocument document = sourceViewer.getDocument();
      if (document instanceof IDocumentExtension3) {
        String partitioning = getConfiguredDocumentPartitioning(sourceViewer);
        IDocumentPartitioner partitioner = ((IDocumentExtension3) document).getDocumentPartitioner(partitioning);
View Full Code Here

        this.getContentAssistant(), partitionType, sourceViewer);
    return new IContentAssistProcessor[]{processor};
  }

  public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
    IContentFormatter formatter = super.getContentFormatter(sourceViewer);
    // super was unable to create a formatter, probably because
    // sourceViewer does not have document set yet, so just create a
    // generic one
    if (!(formatter instanceof MultiPassContentFormatter))
      formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IXMLPartitions.XML_DEFAULT);
View Full Code Here

        this.getContentAssistant(), partitionType, sourceViewer);
    return new IContentAssistProcessor[]{processor};
  }

  public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
    IContentFormatter formatter = super.getContentFormatter(sourceViewer);
    // super was unable to create a formatter, probably because
    // sourceViewer does not have document set yet, so just create a
    // generic one
    if (!(formatter instanceof MultiPassContentFormatter))
      formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IXMLPartitions.XML_DEFAULT);
View Full Code Here

    targets.put(ContentTypeIdForPHP.ContentTypeID_PHP, null);
    return targets;
  }

  public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
    IContentFormatter usedFormatter = null;

    IConfigurationElement[] elements = Platform.getExtensionRegistry()
        .getConfigurationElementsFor(FORMATTER_PROCESSOR_EXT);
    for (int i = 0; i < elements.length; i++) {
      IConfigurationElement element = elements[i];
View Full Code Here

        }
      }

      if (document != null) {
        Region region = new Region(0, document.getLength());
        IContentFormatter formatter = getFormatter();
        if (formatter != null)
          formatter.format(document, region);
      }

    } catch (Exception e) {
      PHPCorePlugin.log(e);
    } finally {
View Full Code Here

   * formatModel
   * (org.eclipse.wst.sse.core.internal.provisional.IStructuredModel)
   */
  public void formatModel(IStructuredModel structuredModel) {
    IStructuredDocument document = structuredModel.getStructuredDocument();
    IContentFormatter formatter = getFormatter();
    if (formatter != null)
      formatter.format(document, new Region(0, document.getLength()));
  }
View Full Code Here

   */
  public void formatModel(IStructuredModel structuredModel, int start,
      int length) {
    IStructuredDocument document = structuredModel.getStructuredDocument();
    Region region = new Region(start, length);
    IContentFormatter formatter = getFormatter();
    if (formatter != null)
      formatter.format(document, region);
  }
View Full Code Here

   *            injected. This issue needs to be reviewed again when OFFLINE
   *            formatting will be available.
   */
  public void formatDocument(IStructuredDocument document, int offset,
      int length) {
    IContentFormatter formatter = null;
    if (formatter == null) {
      formatter = PHPUiPlugin.getDefault().getActiveFormatter();
    }
    try {
      formatter.format(document, new Region(offset, length));
    } catch (Exception e) {
      Logger.logException(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.formatter.IContentFormatter

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.