/*
  * @see org.eclipse.core.filebuffers.IDocumentSetupParticipant#setup(org.eclipse.jface.text.IDocument)
  */
 public void setup(IDocument document) {
   if (document instanceof IDocumentExtension3) {
     IDocumentExtension3 extension3 = (IDocumentExtension3) document;
     IDocumentPartitioner partitioner =
         new FastPartitioner(
             JavaEditorExamplePlugin.getDefault().getJavaPartitionScanner(),
             JavaPartitionScanner.JAVA_PARTITION_TYPES);
     extension3.setDocumentPartitioner(JavaEditorExamplePlugin.JAVA_PARTITIONING, partitioner);
     partitioner.connect(document);
   }
 }
 public void setup(IDocument document) {
   if (document instanceof IDocumentExtension3) {
     IDocumentExtension3 extension3 = (IDocumentExtension3) document;
     IDocumentPartitioner partitioner =
         new FastPartitioner(
             Activator.getDefault().getResourceFilePartitionScanner(),
             ResourceFilePartitionScanner.PARTITION_TYPES);
     extension3.setDocumentPartitioner(ResourceFilePartitionScanner.PARTITIONING, partitioner);
     ((IDocumentPartitionerExtension3) partitioner).connect(document, false);
   }
 }
  public void setup(IDocument document) {
    IDocumentPartitioner partitioner =
        new FastPartitioner(
            Activator.getDefault().getAdaPartitionScanner(), AdaPartitionScanner.PARTITION_TYPES);

    if (document instanceof IDocumentExtension3) {
      IDocumentExtension3 extension3 = (IDocumentExtension3) document;
      extension3.setDocumentPartitioner(AdaPartitionScanner.ADA_PARTITIONNING, partitioner);
    }

    partitioner.connect(document);
  }
 protected void setupDocumentPartitioner(IDocument document, String partitioning) {
   IDocumentPartitioner partitioner = createDocumentPartitioner();
   if (partitioner != null) {
     partitioner.connect(document);
     if (document instanceof IDocumentExtension3) {
       IDocumentExtension3 extension3 = (IDocumentExtension3) document;
       extension3.setDocumentPartitioner(partitioning, partitioner);
     } else {
       document.setDocumentPartitioner(partitioner);
     }
   }
 }
 public void setup(IDocument document) {
   AutoconfPartitioner partitioner =
       new AutoconfPartitioner(
           new AutoconfPartitionScanner(), AutoconfPartitionScanner.AUTOCONF_PARTITION_TYPES);
   partitioner.connect(document, 1);
   if (document instanceof IDocumentExtension3) {
     IDocumentExtension3 extension3 = (IDocumentExtension3) document;
     extension3.setDocumentPartitioner(AutoconfEditor.AUTOCONF_PARTITIONING, partitioner);
   } else {
     document.setDocumentPartitioner(partitioner);
   }
   //		document.addDocumentListener(this);
 }
예제 #6
0
  /**
   * Installs a document partitioner on the containing editor's document. This partitioner will
   * determine where contained editors should go.
   *
   * @param viewer
   */
  public void installPartitioner(ISourceViewer viewer) {
    FastPartitioner partitioner =
        new FastPartitioner(scanner, new String[] {ContainingEditorScanner.CONTAINED_EDITOR});
    partitioner.connect(doc);

    ((IDocumentExtension3) doc)
        .setDocumentPartitioner(ContainingEditorScanner.CONTAINED_EDITOR, partitioner);

    if (viewer instanceof ITextViewerExtension4) {
      ((ITextViewerExtension4) viewer).addTextPresentationListener(this);
    } else {
      EmbeddedCALPlugin.logWarning(
          "Cannot install Presentation Listener.  " + "The display may not update properly.",
          new RuntimeException());
    }
  }