/** * 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); }
/** * 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); }
@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; }
/** * 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); }
@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; }
/** * 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 ); } }
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; }
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; }
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; } }); }
@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; }
@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; }
@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; }
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; }
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); }
@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); }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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); } }
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); } }
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); } }
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; }
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; }
@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); } } }
@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; }
@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); } }
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; }
@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(); }
@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; }
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; }
/** * 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); }
@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(); }