本文整理了Java中org.dadacoalition.yedit.editor.YEditSourceViewerConfiguration
类的一些代码示例,展示了YEditSourceViewerConfiguration
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YEditSourceViewerConfiguration
类的具体详情如下:
包路径:org.dadacoalition.yedit.editor.YEditSourceViewerConfiguration
类名称:YEditSourceViewerConfiguration
暂无
代码示例来源:origin: RepreZen/KaiZen-OpenAPI-Editor
@Override
public IInformationPresenter getInformationPresenter(ISourceViewer sourceViewer) {
return super.getInformationPresenter(sourceViewer);
}
代码示例来源:origin: oyse/yedit
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
//TODO: create preference page to enable/disable hyperlink detection
// @see super.getHyperlinkDetectors();
return getRegisteredHyperlinkDetectors(sourceViewer);
}
代码示例来源:origin: oyse/yedit
/**
* This methods is necessary for proper implementation of Shift Left and Shift Right.
*
* This implementation overrides the default implementation to ensure that only spaces
* are inserted and not tabs.
*
* @returns An array of prefixes. The prefix at position 0 is used when shifting right.
* When shifting left all the prefixes are checked and one of the matches that prefix is
* removed from the line.
*/
public String[] getIndentPrefixes( ISourceViewer sourceViewer, String contentType ){
int tabWidth = getTabWidth( sourceViewer );
String[] indentPrefixes = new String[ tabWidth ];
for( int prefixLength = 1; prefixLength <= tabWidth; prefixLength++ ){
char[] spaceChars = new char[prefixLength];
Arrays.fill(spaceChars, ' ');
indentPrefixes[tabWidth - prefixLength] = new String(spaceChars);
}
return indentPrefixes;
}
代码示例来源:origin: oyse/yedit
public IPresentationReconciler getPresentationReconciler( ISourceViewer sourceViewer ){
PresentationReconciler pr = new PresentationReconciler();
DefaultDamagerRepairer dr = new YEditDamageRepairer(getScanner() );
pr.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
pr.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
return pr;
}
代码示例来源:origin: oyse/yedit
protected YEditSourceViewerConfiguration createSourceViewerConfiguration() {
YEditSourceViewerConfiguration jsvc = null;
/*
* Check for custom YEditSourceViewerConfiguration contributed via
* extension point
*/
boolean contribFound = false;
IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint point = registry.getExtensionPoint(SOURCE_VIEWER_CONFIGURATION_CONTRIB_ID);
IConfigurationElement[] elts = point.getConfigurationElements();
for(IConfigurationElement elt : elts) {
if("sourceViewerConfiguration".equals(elt.getName())) {
try {
jsvc = (YEditSourceViewerConfiguration) elt.createExecutableExtension("class");
contribFound = true;
break;
} catch (CoreException e) {}
}
}
// otherwise default to the base YEditSourceViewerConfiguration
if( !contribFound ) {
jsvc = new YEditSourceViewerConfiguration();
}
return jsvc;
}
代码示例来源:origin: oyse/yedit
public IContentAssistant getContentAssistant( ISourceViewer sourceViewer ){
ContentAssistant ca = new ContentAssistant();
IContentAssistProcessor cap = new YEditCompletionProcessor();
ca.setContentAssistProcessor(cap, IDocument.DEFAULT_CONTENT_TYPE);
ca.setInformationControlCreator(getInformationControlCreator(sourceViewer));
ca.enableAutoInsert(true);
return ca;
}
代码示例来源:origin: oyse/yedit
public void parse(IDocument document){
String content = document.get();
IPreferenceStore prefs = Activator.getDefault().getPreferenceStore();
if( prefs.getBoolean(PreferenceConstants.SYMFONY_COMPATIBILITY_MODE ) ){
SymfonyCompatibilityMode sr = new SymfonyCompatibilityMode( yamlEditor.sourceViewerConfig.getScanner() );
content = sr.fixScalars(document);
}
yamlDocuments.clear();
try {
for( Node rootNode : yamlParser.composeAll( new StringReader( content ) ) ){
YAMLOutlineElement ye = new YAMLOutlineElement( rootNode, document );
yamlDocuments.add(ye);
}
} catch ( YAMLException ex ) {
YEditLog.logger.info( "Syntax error found during parsing for outlinew view. Parsing stopped." );
}
}
代码示例来源:origin: oyse/yedit
protected SourceViewer createViewer(Composite parent) {
SourceViewer viewer= new SourceViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
SourceViewerConfiguration configuration = new YEditSourceViewerConfiguration();
viewer.configure(configuration);
return viewer;
}
代码示例来源:origin: oyse/yedit
SymfonyCompatibilityMode sr = new SymfonyCompatibilityMode( sourceViewerConfig.getScanner() );
content = sr.fixScalars(document);
代码示例来源:origin: oyse/yedit
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType ){
if( IDocument.DEFAULT_CONTENT_TYPE.equals(contentType) ){
//If the TabsToSpacesConverter is not configured here the editor field in the template
//preference page will not work correctly. Without this configuration the tab key
//will be not work correctly and instead change the focus
int tabWidth= getTabWidth(sourceViewer);
TabsToSpacesConverter tabToSpacesConverter = new TabsToSpacesConverter();
tabToSpacesConverter.setLineTracker(new DefaultLineTracker());
tabToSpacesConverter.setNumberOfSpacesPerTab(tabWidth);
return new IAutoEditStrategy[] {
tabToSpacesConverter,
new DefaultIndentLineAutoEditStrategy(),
};
} else {
return new IAutoEditStrategy[]{ new DefaultIndentLineAutoEditStrategy() };
}
}
代码示例来源:origin: oyse/yedit
TaskTagParser ttp = new TaskTagParser(prefs, sourceViewerConfig.getScanner(), caseSensitiveTags);
List<TaskTag> tags = ttp.parseTags(this.getDocumentProvider().getDocument(this.getEditorInput()));
内容来源于网络,如有侵权,请联系作者删除!