Java 类org.eclipse.jface.text.rules.FastPartitioner 实例源码

项目:convertigo-eclipse    文件:ConnectorEditorPart.java   
/**
 * This method initializes compositeXml
 * 
 */
private void createCompositeXml() {
    compositeXml = new Composite(sashForm, SWT.NONE);
    compositeXml.setLayout(new FillLayout());

    xmlView = new StructuredTextViewer(compositeXml, null, null, false, SWT.H_SCROLL | SWT.V_SCROLL);
    xmlView.setEditable(false);

    colorManager = new ColorManager();
    xmlView.configure(new XMLConfiguration(colorManager));

    Document document = new Document(
            "Click on the XML generation button to view the XML document generated by Convertigo.");
    IDocumentPartitioner partitioner = new FastPartitioner(new XMLPartitionScanner(), new String[] {
            XMLPartitionScanner.XML_TAG, XMLPartitionScanner.XML_COMMENT, });
    partitioner.connect(document);
    document.setDocumentPartitioner(partitioner);
    xmlView.setDocument(document);
}
项目:convertigo-eclipse    文件:SequenceEditorPart.java   
/**
 * This method initializes compositeXml 
 *
 */
private void createCompositeXml() {
    compositeXml = new Composite(sashForm, SWT.NONE);
    compositeXml.setLayout(new FillLayout());

    xmlView = new StructuredTextViewer(compositeXml, null, null, false, SWT.H_SCROLL | SWT.V_SCROLL);
    xmlView.setEditable(false);

    colorManager = new ColorManager();
    xmlView.configure(new XMLConfiguration(colorManager));

    Document document = new Document("Click on the XML generation button to view the XML document generated by Convertigo.");
    IDocumentPartitioner partitioner =
        new FastPartitioner(
            new XMLPartitionScanner(),
            new String[] { 
                XMLPartitionScanner.XML_TAG,
                XMLPartitionScanner.XML_COMMENT,
            }
        );
    partitioner.connect(document);
    document.setDocumentPartitioner(partitioner);
    xmlView.setDocument(document);
}
项目:LibertyEiffel-Eclipse-Plugin    文件:EiffelDocumentProvider.java   
@SuppressWarnings("static-access")
@Override
protected FileInfo createFileInfo(Object element) throws CoreException{
    FileInfo info = super.createFileInfo(element);

    if (info == null) {
        info = createEmptyFileInfo();
    }

    IDocument document = info.fTextFileBuffer.getDocument();

    if (document != null) {
        EiffelPartitionScanner partitionScanner = EiffelEditorPlugin
                .getDefault().getPartitionScanner();
        IDocumentPartitioner partitioner = new FastPartitioner(partitionScanner, 
                EiffelPartitionScanner.PARTITION_TYPE);
        partitioner.connect(document);
        document.setDocumentPartitioner(partitioner);
    }

    return info;
}
项目:typescript.java    文件:TypeScriptAutoIndentStrategy.java   
/**
 * Installs a java partitioner with <code>document</code>.
 *
 * @param document the document
 */
private static void installJavaStuff(Document document) {
    String[] types= new String[] {
                                  IJavaScriptPartitions.JAVA_DOC,
                                  IJavaScriptPartitions.JAVA_MULTI_LINE_COMMENT,
                                  IJavaScriptPartitions.JAVA_SINGLE_LINE_COMMENT,
                                  IJavaScriptPartitions.JAVA_STRING,
                                  IJavaScriptPartitions.JAVASCRIPT_TEMPLATE_LITERAL,
                                  IJavaScriptPartitions.JAVA_CHARACTER,
                                  IJSXPartitions.JSX,
                                  IDocument.DEFAULT_CONTENT_TYPE
    };
    FastPartitioner partitioner= new FastPartitioner(new FastTypeScriptPartitionScanner(), types);
    partitioner.connect(document);
    document.setDocumentPartitioner(IJavaScriptPartitions.JAVA_PARTITIONING, partitioner);
}
项目:BYONDclipse    文件:XMLDocumentProvider.java   
@Override
protected IDocument createDocument(final Object element) throws CoreException
{
    final IDocument document = super.createDocument(element);

    if (document != null)
    {
        MapFile.parse(document.get());

        final IDocumentPartitioner partitioner =
            new FastPartitioner(
                new XMLPartitionScanner(),
                new String[] {
                    XMLPartitionScanner.XML_TAG,
                    XMLPartitionScanner.XML_COMMENT });
        partitioner.connect(document);
        document.setDocumentPartitioner(partitioner);
    }
    return document;
}
项目:vTM-eclipse    文件:TrafficScriptSetup.java   
/**
 * Setup the TrafficScript Partitioner for .zts files
 */
/* Override */
public void setup( IDocument document )
{     
   if (document instanceof IDocumentExtension3) {
      IDocumentExtension3 extension3 = (IDocumentExtension3) document;

      IDocumentPartitioner partitioner = new FastPartitioner( 
         ZXTMPlugin.getDefault().getTrafficScriptPartitioner(),
         Partition.getAllPartitionIds()
      );

      extension3.setDocumentPartitioner(
         TrafficScriptPartitioner.TS_PARTITIONER, 
         partitioner 
      );

      partitioner.connect( document );

   }

}
项目:syncope    文件:HTMLFileDocumentProvider.java   
public IDocument createDocument(final Object element) throws CoreException {
    IDocument document = super.createDocument(element);
    if (document != null) {
        IDocumentPartitioner partitioner =
            new FastPartitioner(
                    new HTMLPartitionScanner(),
                    new String[]{
                            HTMLPartitionScanner.HTML_TAG,
                            HTMLPartitionScanner.HTML_COMMENT,
                            HTMLPartitionScanner.HTML_SCRIPT,
                            HTMLPartitionScanner.HTML_DOCTYPE,
                            HTMLPartitionScanner.HTML_DIRECTIVE,
                            HTMLPartitionScanner.JAVASCRIPT,
                            HTMLPartitionScanner.HTML_CSS,
                            HTMLPartitionScanner.SYNCOPE_TAG});
        partitioner.connect(document);
        document.setDocumentPartitioner(partitioner);
    }
    return document;
}
项目:ant-ivyde    文件:XMLDocumentProvider.java   
protected IDocument createDocument(Object element) throws CoreException {
    IDocument document = super.createDocument(element);
    if (document != null) {
        IDocumentPartitioner partitioner = new FastPartitioner(new XMLPartitionScanner(),
                new String[] {XMLPartitionScanner.XML_TAG, XMLPartitionScanner.XML_COMMENT});
        partitioner.connect(document);
        document.setDocumentPartitioner(partitioner);
        // document.addDocumentListener(new IDocumentListener() {
        //
        // public void documentAboutToBeChanged(DocumentEvent event) {
        // }
        //
        // public void documentChanged(DocumentEvent event) {
        // System.out.println("XMLDocumentProvider.documentChanged :"+event.getText());
        // }
        // });
    }
    return document;
}
项目:textuml    文件:SourceEditor.java   
public SourceEditor() {
    setSourceViewerConfiguration(new TextUMLSourceViewerConfiguration(this));
    // set the document provider to create the partitioner
    setDocumentProvider(new FileDocumentProvider() {
        protected IDocument createDocument(Object element) throws CoreException {
            IDocument document = super.createDocument(element);
            if (document != null) {
                // this will create partitions
                IDocumentPartitioner partitioner = new FastPartitioner(new PartitionScanner(),
                        ContentTypes.CONFIGURED_CONTENT_TYPES);
                partitioner.connect(document);
                document.setDocumentPartitioner(partitioner);
            }
            return document;
        }
    });
}
项目:rustyeclipse    文件:RustTextDocumentProvider.java   
@Override
protected FileInfo createFileInfo(Object element) throws CoreException {
    FileInfo info = super.createFileInfo(element);
    if(info==null){
        info = createEmptyFileInfo();
    }
    IDocument document = info.fTextFileBuffer.getDocument();
    if (document != null) {

        /* register your partitioner and other things here 
                      same way as in your first document provider */
        if (document instanceof IDocumentExtension3) {
            IDocumentExtension3 extension3= (IDocumentExtension3) document;
            IDocumentPartitioner partitioner= new FastPartitioner(RustCorePlugin.getDefault().scanners().rustPartitionScanner(), RustPartitionScanner.PARTITION_TYPES);
            extension3.setDocumentPartitioner(RustConstants.RUST_PARTITIONING, partitioner);
            partitioner.connect(document);
        }
    }
    return info;
}
项目:rustyeclipse    文件:RustDocumentProvider.java   
@Override
    protected @Nullable IDocument createDocument(@Nullable Object element) throws CoreException {
//      IDocument document = super.createDocument(element);
//      if (document != null) {
//          IDocumentPartitioner partitioner =
//              new FastPartitioner(
//                  new RustPartitionScanner(),
//                  new String[] {
//                      RustPartitionScanner.RUST_MULTILINE_COMMENT });
//          partitioner.connect(document);
//          document.setDocumentPartitioner(partitioner);
//      }
//      return document;

        IDocument document = super.createDocument(element);
        if (document instanceof IDocumentExtension3) {
            IDocumentExtension3 extension3= (IDocumentExtension3) document;
            IDocumentPartitioner partitioner= new FastPartitioner(RustCorePlugin.getDefault().scanners().rustPartitionScanner(), RustPartitionScanner.PARTITION_TYPES);
            extension3.setDocumentPartitioner(RustConstants.RUST_PARTITIONING, partitioner);
            partitioner.connect(document);
        }
        return document;
    }
项目:byteman-editor    文件:BytemanRuleTextDocumentProvider.java   
@Override
protected FileInfo createFileInfo(Object element) throws CoreException {
    FileInfo info = super.createFileInfo(element);
    if(info == null) {
        info = createEmptyFileInfo();
    }
    IDocument document = info.fTextFileBuffer.getDocument();
    if(document != null) {
        IDocumentPartitioner partitioner = new FastPartitioner(
                new BytemanRulePartitionScanner(),
                new String[] {
                    BytemanRulePartitionScanner.RULE_COMMENT,
                    BytemanRulePartitionScanner.RULE_DEF_LINE
                });
        partitioner.connect(document);
        document.setDocumentPartitioner(partitioner);
    }
    return info;
}
项目:convertigo-eclipse    文件:XMLDocumentProvider.java   
protected IDocument createDocument(Object element) throws CoreException {
    IDocument document = super.createDocument(element);
    if (document != null) {
        IDocumentPartitioner partitioner =
            new FastPartitioner(
                new XMLPartitionScanner(),
                new String[] {
                    XMLPartitionScanner.XML_TAG,
                    XMLPartitionScanner.XML_COMMENT });
        partitioner.connect(document);
        document.setDocumentPartitioner(partitioner);
    }
    return document;
}
项目:pgcodekeeper    文件:SQLEditorCommonDocumentProvider.java   
IDocumentPartitioner createRecipePartitioner() {
    IPredicateRule[] rules = {
            new SingleLineRule("--", null, new Token(SQL_SINGLE_COMMENT), (char) 0, true, false), //$NON-NLS-1$
            new MultiLineRule("/*", "*/", new Token(SQL_MULTI_COMMENT), (char) 0, true),  //$NON-NLS-1$ //$NON-NLS-2$
            new MultiLineRule( "'", "'", new Token(SQL_CHARACTER_STRING_LITERAL), (char) 0 , true) //$NON-NLS-1$ //$NON-NLS-2$
    };

    RuleBasedPartitionScanner scanner = new RuleBasedPartitionScanner();
    scanner.setPredicateRules(rules);

    return new FastPartitioner(scanner, CONTENT_TYPES);
}
项目:vertigo-chroma-kspplugin    文件:KspDocumentSetupParticipant.java   
@Override
public void setup(IDocument document) {
    /* Définit un partitionnement du document. */
    IDocumentPartitioner p = new FastPartitioner(createKspPartitionScanner(), TYPES);
    IDocumentExtension3 de3 = (IDocumentExtension3) document;
    de3.setDocumentPartitioner(KspRegionType.PARTITIONING, p);
    p.connect(document);
}
项目:Tarski    文件:RelationModelDocumentProvider.java   
@Override
protected IDocument createDocument(final Object element) throws CoreException {
  final IDocument document = super.createDocument(element);
  if (document != null) {
    final IDocumentPartitioner partitioner = new FastPartitioner(
        new RelationModelPartitionScanner(), RelationModelPartitionScanner.PARTITION_TYPES);
    partitioner.connect(document);
    document.setDocumentPartitioner(partitioner);
  }
  return document;
}
项目:Tarski    文件:ValidationDocumentProvider.java   
@Override
protected IDocument createDocument(final Object element) throws CoreException {
  final IDocument document = super.createDocument(element);
  if (document != null) {
    final IDocumentPartitioner partitioner = new FastPartitioner(new ValidationPartitionScanner(),
        ValidationPartitionScanner.PARTITION_TYPES);
    partitioner.connect(document);
    document.setDocumentPartitioner(partitioner);
  }
  return document;
}
项目:Tarski    文件:RelationModelDocumentProvider.java   
@Override
protected IDocument createDocument(final Object element) throws CoreException {
    final IDocument document = super.createDocument(element);
    if (document != null) {
        final IDocumentPartitioner partitioner = new FastPartitioner(new RelationModelPartitionScanner(),
                RelationModelPartitionScanner.PARTITION_TYPES);
        partitioner.connect(document);
        document.setDocumentPartitioner(partitioner);
    }
    return document;
}
项目:Tarski    文件:MetaModelDocumentProvider.java   
@Override
protected IDocument createDocument(final Object element) throws CoreException {
  final IDocument document = super.createDocument(element);
  if (document != null) {
    final IDocumentPartitioner partitioner = new FastPartitioner(new MetaModelPartitionScanner(),
        MetaModelPartitionScanner.PARTITION_TYPES);
    partitioner.connect(document);
    document.setDocumentPartitioner(partitioner);
  }
  return document;
}
项目:LibertyEiffel-Eclipse-Plugin    文件:EiffelDocumentProvider.java   
@Override
protected IDocument createDocument(Object element) throws CoreException {
    IDocument document = super.createDocument(element);

    if (document instanceof IDocumentExtension3) {
        IDocumentExtension3 extension3 = (IDocumentExtension3) document;
        IDocumentPartitioner partitioner = new FastPartitioner(EiffelEditorPlugin
                .getPartitionScanner(), EiffelPartitionScanner.PARTITION_TYPE);
        extension3.setDocumentPartitioner(EiffelEditorPlugin.MY_PARTITIONING, partitioner);
        partitioner.connect(document);
    }

    return document;
}
项目:GradleEditor    文件:NodeDocumentProvider.java   
@Override
protected IDocument createDocument(Object element) throws CoreException {
    IDocument doc = super.createDocument(element);
    if (doc != null) {
        IDocumentPartitioner partitioner = new FastPartitioner(new GradlePartitionScanner(), GradlePartitionScanner.PARTITION_TYPES);
        partitioner.connect(doc);
        doc.setDocumentPartitioner(partitioner);
    }
    return doc;
}
项目:ftc    文件:SqlDocumentSetupParticipant.java   
@Override
public void setup(IDocument document) {
    if (document instanceof IDocumentExtension3) {
        IDocumentExtension3 extension3= (IDocumentExtension3) document;
        IDocumentPartitioner partitioner= new FastPartitioner(SqlCommentPartitionScanner.getDefault(), SqlCommentPartitionScanner.partition_types);
        extension3.setDocumentPartitioner(FtcPlugin.SQL_PARTITIONING, partitioner);
        partitioner.connect(document);
    }
}
项目:texlipse    文件:BibSetupParticipant.java   
public void setup(IDocument document) {
    if (document instanceof IDocumentExtension3) {
        IDocumentExtension3 extension3 = (IDocumentExtension3) document;
        IDocumentPartitioner partitioner = 
            new FastPartitioner(new BibPartitionScanner(), BibPartitionScanner.BIB_PARTITION_TYPES);
        extension3.setDocumentPartitioner(BibEditor.BIB_PARTITIONING, partitioner);
        partitioner.connect(document);
    }
}
项目:texlipse    文件:TexDocumentSetupParticipant.java   
public void setup(IDocument document) {
    if (document instanceof IDocumentExtension3) {
        IDocumentExtension3 extension3= (IDocumentExtension3) document;

        IDocumentPartitioner partitioner = 
            new FastPartitioner(
                    new FastLaTeXPartitionScanner(), 
                    FastLaTeXPartitionScanner.TEX_PARTITION_TYPES);

        extension3.setDocumentPartitioner(TexEditor.TEX_PARTITIONING, partitioner);

        partitioner.connect(document);

    }   
}
项目:dockerfoundry    文件:DockerfileDocumentProvider.java   
protected IDocument createDocument(Object element) throws CoreException {
    IDocument document = super.createDocument(element);
    if (document != null) {
        IDocumentPartitioner partitioner =
            new FastPartitioner(
                new DockerfilePartitionScanner(),
                new String[] {
                    DockerfilePartitionScanner.DOCKERFILE_FROM,
                    DockerfilePartitionScanner.DOCKERFILE_COMMENT });
        partitioner.connect(document);
        document.setDocumentPartitioner(partitioner);
    }
    return document;
}
项目:hssd    文件:XMLDocumentProvider.java   
protected IDocument createDocument(Object element) throws CoreException {
    IDocument document = super.createDocument(element);
    if (document != null) {
        IDocumentPartitioner partitioner =
            new FastPartitioner(
                new XMLPartitionScanner(),
                new String[] {
                    XMLPartitionScanner.XML_TAG,
                    XMLPartitionScanner.XML_COMMENT });
        partitioner.connect(document);
        document.setDocumentPartitioner(partitioner);
    }
    return document;
}
项目:umple    文件:UmpleDocumentProvider.java   
protected IDocument createDocument(Object element) throws CoreException
{
    IDocument document = super.createDocument(element);
    if (document != null)
    {
        IDocumentPartitioner partitioner = new FastPartitioner(new UmplePartitionScanner(), new String[] {
                UmplePartitionScanner.Umple_TAG, UmplePartitionScanner.Umple_COMMENT });
        partitioner.connect(document);
        document.setDocumentPartitioner(partitioner);
    }
    return document;
}
项目:velocity-edit    文件:VelocityDocumentProvider.java   
@Override
  public void connect(Object element) throws CoreException {
    super.connect(element);
    IDocument document = getDocument(element);
    if (document != null) {
      if (document.getDocumentPartitioner() == null) {
        IDocumentPartitioner partitioner = new FastPartitioner(new
VelocityPartitionScanner(), VelocityPartitionScanner.TYPES);
        partitioner.connect(document);
        document.setDocumentPartitioner(partitioner);
      }
    }
  }
项目:KaiZen-OpenAPI-Editor    文件:JsonDocumentProvider.java   
@Override
protected IDocument createDocument(Object element) throws CoreException {
    IDocument document = super.createDocument(element);
    if (document != null) {
        JsonScanner scanner = new JsonScanner(new ColorManager(), store);
        Set<String> tokens = YAMLToken.VALID_TOKENS.keySet();
        FastPartitioner partitioner = new FastPartitioner(scanner, tokens.toArray(new String[tokens.size()]));
        document.setDocumentPartitioner(partitioner);
        partitioner.connect(document);
    }

    return document;
}
项目:brainfuck    文件:BfDocSetupParticipant.java   
@Override
public void setup(IDocument document) {

    if (document instanceof IDocumentExtension3) {
        final IDocumentExtension3 ext3 = (IDocumentExtension3) document;

        IDocumentPartitioner partitioner = new FastPartitioner(new BfPartitionScanner(), EditorConstants.BRAINFUCK_PARTITION_TYPES);
        partitioner.connect(document);
        ext3.setDocumentPartitioner(EditorConstants.BF_PARTITIONING, partitioner);
    }
}
项目:eclipse-kernelsyntax    文件:KernelSyntaxDocumentProvider.java   
protected IDocument createDocument(Object element) throws CoreException {
    IDocument document = super.createDocument(element);
    if (document != null) {
        IDocumentPartitioner partitioner =
            new FastPartitioner(new KernelSyntaxRuleBasedPartitionScanner(ksl), ksl.KSPS);
        partitioner.connect(document);
        document.setDocumentPartitioner(partitioner);
    }
    return document;
}
项目:eclipseforces    文件:JavaPreferencesPage.java   
@Override
public void createControl(Composite parent) {
  composite = new Composite(parent, SWT.NONE);
  composite.setLayout(new GridLayout(1, false));

  generateJUnitTimeoutEditor = new Button(composite, SWT.CHECK | SWT.LEFT);
  generateJUnitTimeoutEditor.setText("Use timeouts in generated test cases");
  generateJUnitTimeoutEditor.setSelection(EclipseForcesPlugin.getDefault()
      .isGenerateJUnitTimeout());

  codeTemplateLabel = new Label(composite, SWT.NONE);
  codeTemplateLabel.setText("Code template:");

  codeTemplateEditor = new SourceViewer(composite, null, SWT.MULTI | SWT.H_SCROLL
      | SWT.V_SCROLL | SWT.BORDER);
  JavaSourceViewerConfiguration config = new JavaSourceViewerConfiguration(JavaUI.getColorManager(), JavaPlugin.getDefault().getCombinedPreferenceStore(), null, IJavaPartitions.JAVA_PARTITIONING);
  codeTemplateEditor.configure(config);
  Document doc = new Document(EclipseForcesPlugin.getDefault().getCodeTemplate());
  JavaPartitionScanner scanner = new JavaPartitionScanner();
  FastPartitioner fp = new FastPartitioner(scanner, new String[] {IJavaPartitions.JAVA_STRING, IJavaPartitions.JAVA_MULTI_LINE_COMMENT, IJavaPartitions.JAVA_CHARACTER,
      IJavaPartitions.JAVA_DOC, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT});
  fp.connect(doc);
  doc.setDocumentPartitioner(IJavaPartitions.JAVA_PARTITIONING, fp);
  codeTemplateEditor.setDocument(doc);
  codeTemplateEditor.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
  codeTemplateEditor.getControl().pack();
}
项目:chromedevtools    文件:JsDocumentProvider.java   
@Override
protected IDocument createDocument(Object element) throws CoreException {
  IDocument doc = super.createDocument(element);
  if (doc != null) {
    IDocumentPartitioner partitioner = new FastPartitioner(
        new JsPartitionScanner(), JsPartitionScanner.PARTITION_TYPES);
    partitioner.connect(doc);
    doc.setDocumentPartitioner(partitioner);
  }
  return doc;
}
项目:strutsclipse    文件:AbstractXmlParser.java   
private IDocumentPartitioner createConnectPartitioner(IDocument document,
        IPredicateRule[] rules, String[] types) {
    RuleBasedPartitionScanner scanner = new RuleBasedPartitionScanner();
    scanner.setPredicateRules(rules);
    IDocumentPartitioner partitioner = new FastPartitioner(scanner, types);
    partitioner.connect(document);
    return partitioner;
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaFormatter.java   
/**
 * Installs a java partitioner with <code>document</code>.
 *
 * @param document the document
 */
private static void installJavaStuff(Document document) {
    String[] types= new String[] {
                                  IJavaPartitions.JAVA_DOC,
                                  IJavaPartitions.JAVA_MULTI_LINE_COMMENT,
                                  IJavaPartitions.JAVA_SINGLE_LINE_COMMENT,
                                  IJavaPartitions.JAVA_STRING,
                                  IJavaPartitions.JAVA_CHARACTER,
                                  IDocument.DEFAULT_CONTENT_TYPE
    };
    FastPartitioner partitioner= new FastPartitioner(new FastJavaPartitionScanner(), types);
    partitioner.connect(document);
    document.setDocumentPartitioner(IJavaPartitions.JAVA_PARTITIONING, partitioner);
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaAutoIndentStrategy.java   
/**
 * Installs a java partitioner with <code>document</code>.
 *
 * @param document the document
 */
private static void installJavaStuff(Document document) {
    String[] types= new String[] {
                                  IJavaPartitions.JAVA_DOC,
                                  IJavaPartitions.JAVA_MULTI_LINE_COMMENT,
                                  IJavaPartitions.JAVA_SINGLE_LINE_COMMENT,
                                  IJavaPartitions.JAVA_STRING,
                                  IJavaPartitions.JAVA_CHARACTER,
                                  IDocument.DEFAULT_CONTENT_TYPE
    };
    FastPartitioner partitioner= new FastPartitioner(new FastJavaPartitionScanner(), types);
    partitioner.connect(document);
    document.setDocumentPartitioner(IJavaPartitions.JAVA_PARTITIONING, partitioner);
}
项目:optiq-mat-plugin    文件:OptiqPane.java   
@Override
public void createPartControl(Composite parent) {
    SashForm sash = new SashForm(parent, SWT.VERTICAL | SWT.SMOOTH);
    queryViewer = new SourceViewer(sash, null, SWT.MULTI | SWT.WRAP);
    queryViewer.configure(new OptiqSourceViewerConfiguration());
    queryString = queryViewer.getTextWidget();
    queryString.setFont(JFaceResources.getFont(JFaceResources.TEXT_FONT));
    queryString.addKeyListener(new KeyAdapter() {
        @Override
        public void keyPressed(KeyEvent e) {
            if (e.keyCode == '\r' && (e.stateMask & SWT.MOD1) != 0) {
                e.doit = false;
                executeAction.run();
            } else if (e.keyCode == ' ' && (e.stateMask & SWT.CTRL) != 0) {
                // ctrl space combination for content assist
                // contentAssistAction.run();
            } else if (e.keyCode == SWT.F5) {
                executeAction.run();
                e.doit = false;
            }
        }

    });

    IDocument doc = createDocument();
    SourceViewerConfiguration svc = new OptiqSourceViewerConfiguration();
    IDocumentPartitioner partitioner = new FastPartitioner(
            new OptiqPartitionScanner(),
            svc.getConfiguredContentTypes(queryViewer));
    partitioner.connect(doc);
    doc.setDocumentPartitioner(partitioner);
    queryViewer.setDocument(doc);
    queryViewer.configure(svc);

    createContainer(sash);
    makeActions();

    installUndoRedoSupport();
}
项目:WP3    文件:RelationModelDocumentProvider.java   
@Override
protected IDocument createDocument(final Object element) throws CoreException {
  final IDocument document = super.createDocument(element);
  if (document != null) {
    final IDocumentPartitioner partitioner = new FastPartitioner(
        new RelationModelPartitionScanner(), RelationModelPartitionScanner.PARTITION_TYPES);
    partitioner.connect(document);
    document.setDocumentPartitioner(partitioner);
  }
  return document;
}
项目:WP3    文件:ValidationDocumentProvider.java   
@Override
protected IDocument createDocument(final Object element) throws CoreException {
  final IDocument document = super.createDocument(element);
  if (document != null) {
    final IDocumentPartitioner partitioner = new FastPartitioner(new ValidationPartitionScanner(),
        ValidationPartitionScanner.PARTITION_TYPES);
    partitioner.connect(document);
    document.setDocumentPartitioner(partitioner);
  }
  return document;
}
项目:WP3    文件:RelationModelDocumentProvider.java   
@Override
protected IDocument createDocument(final Object element) throws CoreException {
    final IDocument document = super.createDocument(element);
    if (document != null) {
        final IDocumentPartitioner partitioner = new FastPartitioner(new RelationModelPartitionScanner(),
                RelationModelPartitionScanner.PARTITION_TYPES);
        partitioner.connect(document);
        document.setDocumentPartitioner(partitioner);
    }
    return document;
}