Examples of IDocumentPartitioner


Examples of org.eclipse.jface.text.IDocumentPartitioner

public class ToolDocumentProvider extends FileDocumentProvider {

  protected IDocument createDocument(Object element) throws CoreException {
    IDocument document = super.createDocument(element);
    if (document != null) {
      IDocumentPartitioner partitioner =
        new FastPartitioner(
          new ToolPartitionScanner(),
          new String[] {
            ToolPartitionScanner.TOOL_COMMENT,
            ToolPartitionScanner.TOOL_SQL});
      partitioner.connect(document);
      document.setDocumentPartitioner(partitioner);
    }
    return document;
  }
View Full Code Here

Examples of org.eclipse.jface.text.IDocumentPartitioner

public class ToolDocumentProvider extends FileDocumentProvider {

  protected IDocument createDocument(Object element) throws CoreException {
    IDocument document = super.createDocument(element);
    if (document != null) {
      IDocumentPartitioner partitioner =
        new FastPartitioner(
          new ToolPartitionScanner(),
          new String[] {
            ToolPartitionScanner.TOOL_COMMENT,
            ToolPartitionScanner.TOOL_SQL});
      partitioner.connect(document);
      document.setDocumentPartitioner(partitioner);
    }
    return document;
  }
View Full Code Here

Examples of org.eclipse.jface.text.IDocumentPartitioner

 
  protected IDocument createDocument(Object element) throws CoreException {
    ToolMethod method = ((MethodEditorInput)element).getMethod();
    IDocument document = method.getImplementationDocument();

    IDocumentPartitioner partitioner =
      new FastPartitioner(
          new ToolPartitionScanner(),
          new String[] {
            ToolPartitionScanner.TOOL_COMMENT,
            ToolPartitionScanner.TOOL_SQL});
    partitioner.connect(document);
    document.setDocumentPartitioner(partitioner);
    return document;
  }
View Full Code Here

Examples of org.eclipse.jface.text.IDocumentPartitioner

    IContentFormatter formatter = null;
    if (sourceViewer != null) {
      IDocument document = sourceViewer.getDocument();
      if (document instanceof IDocumentExtension3) {
        String partitioning = getConfiguredDocumentPartitioning(sourceViewer);
        IDocumentPartitioner partitioner = ((IDocumentExtension3) document).getDocumentPartitioner(partitioning);
        if (partitioner instanceof StructuredTextPartitioner) {
          String defaultPartitionType = ((StructuredTextPartitioner) partitioner).getDefaultPartitionType();
          formatter = new StructuredTextMultiPassContentFormatter(partitioning, defaultPartitionType);
        }
      }
View Full Code Here

Examples of org.eclipse.jface.text.IDocumentPartitioner

    IContentFormatter formatter = null;
    if (sourceViewer != null) {
      IDocument document = sourceViewer.getDocument();
      if (document instanceof IDocumentExtension3) {
        String partitioning = getConfiguredDocumentPartitioning(sourceViewer);
        IDocumentPartitioner partitioner = ((IDocumentExtension3) document).getDocumentPartitioner(partitioning);
        if (partitioner instanceof StructuredTextPartitioner) {
          String defaultPartitionType = ((StructuredTextPartitioner) partitioner).getDefaultPartitionType();
          formatter = new StructuredTextMultiPassContentFormatter(partitioning, defaultPartitionType);
        }
      }
View Full Code Here

Examples of org.eclipse.jface.text.IDocumentPartitioner

      newEmbeddedContentType.initializeFactoryRegistry(model.getFactoryRegistry());
      newEmbeddedContentType.initializeParser(structuredDocument.getParser());

      // partitioner setup is the responsibility of this loader
      IDocumentPartitioner documentPartitioner = structuredDocument.getDocumentPartitioner();
      // ISSUE: this logic is flawed, not sure of original intent, but
      // added null/type checks for safety.
      if (documentPartitioner != null && documentPartitioner instanceof StructuredTextPartitionerForJSP) {
        if (newEmbeddedContentType.getFamilyId().equals(ContentTypeIdForXML.ContentTypeID_XML)) {
          ((StructuredTextPartitionerForJSP) documentPartitioner).setEmbeddedPartitioner(new StructuredTextPartitionerForXML());
View Full Code Here

Examples of org.eclipse.jface.text.IDocumentPartitioner

public class XVRDocumentProvider extends FileDocumentProvider {

  protected IDocument createDocument(Object element) throws CoreException {
    IDocument document = super.createDocument(element);
    if (document != null) {
      IDocumentPartitioner partitioner =
        new FastPartitioner(
          new XVRPartitionScanner(),
          new String[] {
            XVRPartitionScanner.COMMENT,
            XVRPartitionScanner.PREPROCESSOR});
      partitioner.connect(document);
      document.setDocumentPartitioner(partitioner);
    }
    return document;
  }
View Full Code Here

Examples of org.eclipse.jface.text.IDocumentPartitioner

   * This is public access method, used especially from loader, for JSP
   * Fragment support.
   */
  public void setLanguage(String newLanguage) {
    this.cachedLanguage = newLanguage;
    IDocumentPartitioner partitioner = ((IDocumentExtension3) model.getStructuredDocument()).getDocumentPartitioner(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING);
    if (partitioner instanceof StructuredTextPartitionerForJSP) {
      ((StructuredTextPartitionerForJSP) partitioner).setLanguage(newLanguage);
    }
  }
View Full Code Here

Examples of org.eclipse.jface.text.IDocumentPartitioner

    int documentOffset = context.getInvocationOffset();
   
    List results = new ArrayList();
    // need to compute context info here, if it's JSP, call java computer
    IDocument doc = viewer.getDocument();
    IDocumentPartitioner dp = null;
    if (doc instanceof IDocumentExtension3) {
      dp = ((IDocumentExtension3) doc).getDocumentPartitioner(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING);
    }
    if (dp != null) {
      //IDocumentPartitioner dp = viewer.getDocument().getDocumentPartitioner();
      String type = dp.getPartition(documentOffset).getType();
      if (type == IJSPPartitions.JSP_DEFAULT || type == IJSPPartitions.JSP_CONTENT_JAVA) {
        // get context info from completion results...
        List proposals = computeCompletionProposals(context,monitor);
        for (int i = 0; i < proposals.size(); i++) {
          IContextInformation ci = ((ICompletionProposal)proposals.get(i)).getContextInformation();
View Full Code Here

Examples of org.eclipse.jface.text.IDocumentPartitioner

   */
  public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) {
    List results = new ArrayList();
    // need to compute context info here, if it's JSP, call java computer
    IDocument doc = viewer.getDocument();
    IDocumentPartitioner dp = null;
    if (doc instanceof IDocumentExtension3) {
      dp = ((IDocumentExtension3) doc).getDocumentPartitioner(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING);
    }
    if (dp != null) {
      //IDocumentPartitioner dp = viewer.getDocument().getDocumentPartitioner();
      String type = dp.getPartition(documentOffset).getType();
      if (type == IJSPPartitions.JSP_DEFAULT || type == IJSPPartitions.JSP_CONTENT_JAVA) {
        // get context info from completion results...
        ICompletionProposal[] proposals = computeCompletionProposals(viewer, documentOffset);
        for (int i = 0; i < proposals.length; i++) {
          IContextInformation ci = proposals[i].getContextInformation();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.