本文整理汇总了Java中org.eclipse.jface.text.IAutoEditStrategy类的典型用法代码示例。如果您正苦于以下问题:Java IAutoEditStrategy类的具体用法?Java IAutoEditStrategy怎么用?Java IAutoEditStrategy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IAutoEditStrategy类属于org.eclipse.jface.text包,在下文中一共展示了IAutoEditStrategy类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAutoEditStrategies
import org.eclipse.jface.text.IAutoEditStrategy; //导入依赖的package包/类
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
String partitioning = getConfiguredDocumentPartitioning(sourceViewer);
if (IJavaScriptPartitions.JAVA_DOC.equals(contentType)
|| IJavaScriptPartitions.JAVA_MULTI_LINE_COMMENT.equals(contentType)
|| IJavaScriptPartitions.JAVASCRIPT_TEMPLATE_LITERAL.equals(contentType)) {
return new IAutoEditStrategy[] { new JSDocAutoIndentStrategy(partitioning) };
} else if (IJavaScriptPartitions.JAVA_STRING.equals(contentType))
return new IAutoEditStrategy[] { new SmartSemicolonAutoEditStrategy(partitioning),
new JavaStringAutoIndentStrategy(partitioning) };
else if (IJavaScriptPartitions.JAVA_CHARACTER.equals(contentType)
|| IDocument.DEFAULT_CONTENT_TYPE.equals(contentType))
return new IAutoEditStrategy[] { new SmartSemicolonAutoEditStrategy(partitioning),
new TypeScriptAutoIndentStrategy(partitioning, getTypeScriptFile(), sourceViewer) };
else
return new IAutoEditStrategy[] {
new TypeScriptAutoIndentStrategy(partitioning, getTypeScriptFile(), sourceViewer) };
}
示例2: getStrategies
import org.eclipse.jface.text.IAutoEditStrategy; //导入依赖的package包/类
public List<IAutoEditStrategy> getStrategies(final ISourceViewer sourceViewer,final String contentType) {
final List<IAutoEditStrategy> strategies = Lists.newArrayList();
configure(new IEditStrategyAcceptor() {
public void accept(IAutoEditStrategy strategy, String type) {
if (type == null || contentType.equals(type)) {
if (strategy instanceof ISourceViewerAware) {
((ISourceViewerAware) strategy).setSourceViewer(sourceViewer);
}
if (strategy instanceof VerifyKeyListener) {
sourceViewer.getTextWidget().addVerifyKeyListener((VerifyKeyListener) strategy);
}
strategies.add(strategy);
}
}
});
return strategies;
}
示例3: getAutoEditStrategies
import org.eclipse.jface.text.IAutoEditStrategy; //导入依赖的package包/类
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer,
String contentType) {
if (contentType == ICSSPartitions.STYLE) {
IAutoEditStrategy[] autoEditStrategies = cssSourceViewerConfiguration.getAutoEditStrategies(
sourceViewer, contentType);
for (int i = 0; i < autoEditStrategies.length; i++) {
// Replace any StructuredAutoEditStrategyCSS with the one that works
// with inlined CSS
if (autoEditStrategies[i] instanceof StructuredAutoEditStrategyCSS) {
autoEditStrategies[i] = new StructuredAutoEditStrategyInlinedCss();
}
}
return autoEditStrategies;
}
return super.getAutoEditStrategies(sourceViewer, contentType);
}
示例4: getAutoEditStrategies
import org.eclipse.jface.text.IAutoEditStrategy; //导入依赖的package包/类
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
IAutoEditStrategy[] autoEditStrategies= super.getAutoEditStrategies(sourceViewer, contentType);
if (fTextEditor == null)
return autoEditStrategies;
try {
if (!PropertiesFileDocumentProvider.isJavaPropertiesFile(fTextEditor.getEditorInput())) {
return autoEditStrategies;
}
List<IAutoEditStrategy> stratergies= new ArrayList<IAutoEditStrategy>();
for (int i= 0; i < autoEditStrategies.length; i++) {
stratergies.add(autoEditStrategies[i]);
}
stratergies.add(new PropertiesFileAutoEditStrategy(((IFileEditorInput)fTextEditor.getEditorInput()).getFile(), sourceViewer));
return stratergies.toArray(new IAutoEditStrategy[stratergies.size()]);
} catch (CoreException e) {
JavaPlugin.log(e);
return autoEditStrategies;
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:23,代码来源:PropertiesFileSourceViewerConfiguration.java
示例5: configureMultilineComments
import org.eclipse.jface.text.IAutoEditStrategy; //导入依赖的package包/类
@Override
protected void configureMultilineComments(IEditStrategyAcceptor acceptor) {
IAutoEditStrategy multiline = multiLineTerminals.newInstance("/*", " * ", " */");
IAutoEditStrategy singleline = singleLineTerminals.newInstance("/*", " */", new SupressingMLCommentPredicate());
acceptor.accept(singleline, IDocument.DEFAULT_CONTENT_TYPE);
acceptor.accept(multiline, IDocument.DEFAULT_CONTENT_TYPE);
acceptor.accept(multiline, TerminalsTokenTypeToPartitionMapper.COMMENT_PARTITION);
acceptor.accept(multiline, JS_DOC_PARTITION);
acceptor.accept(singleLineTerminals.newInstance("/*", " */"), REG_EX_PARTITION);
acceptor.accept(multiline, REG_EX_PARTITION);
}
示例6: getAutoEditStrategies
import org.eclipse.jface.text.IAutoEditStrategy; //导入依赖的package包/类
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
IAutoEditStrategy strategy = (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType) ?
new EiffelAutoEditStrategy() : new DefaultIndentLineAutoEditStrategy());
return new IAutoEditStrategy[] {strategy};
}
示例7: getAutoEditStrategies
import org.eclipse.jface.text.IAutoEditStrategy; //导入依赖的package包/类
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
//return super.getAutoEditStrategies(sourceViewer, contentType);
if (autoIndentStrategy == null) {
autoIndentStrategy = new TexAutoIndentStrategy();
}
return new IAutoEditStrategy[] {autoIndentStrategy};
}
示例8: getAutoEditStrategies
import org.eclipse.jface.text.IAutoEditStrategy; //导入依赖的package包/类
public IAutoEditStrategy[] getAutoEditStrategies(
ISourceViewer sourceViewer, String contentType) {
IAutoEditStrategy strategy = (IDocument.DEFAULT_CONTENT_TYPE
.equals(contentType) ? new XMLAutoIdentStrategy()
: new DefaultIndentLineAutoEditStrategy());
return new IAutoEditStrategy[] { strategy };
}
示例9: getAutoEditStrategies
import org.eclipse.jface.text.IAutoEditStrategy; //导入依赖的package包/类
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer,
String contentType) {
if (GWTPartitions.JSNI_METHOD.equals(contentType)) {
// Get project's formatting settings
IJavaProject javaProject = ((GWTJavaEditor) getEditor()).getInputJavaProject();
Map<?, ?> prefs = (javaProject != null ? javaProject.getOptions(true)
: JavaCore.getOptions());
return new IAutoEditStrategy[] {new JsniAutoEditStrategy(prefs)};
}
return super.getAutoEditStrategies(sourceViewer, contentType);
}
示例10: getAutoEditStrategies
import org.eclipse.jface.text.IAutoEditStrategy; //导入依赖的package包/类
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
String partitioning= getConfiguredDocumentPartitioning(sourceViewer);
if (IJavaPartitions.JAVA_DOC.equals(contentType) || IJavaPartitions.JAVA_MULTI_LINE_COMMENT.equals(contentType))
return new IAutoEditStrategy[] { new JavaDocAutoIndentStrategy(partitioning) };
else if (IJavaPartitions.JAVA_STRING.equals(contentType))
return new IAutoEditStrategy[] { new SmartSemicolonAutoEditStrategy(partitioning), new JavaStringAutoIndentStrategy(partitioning, getProject()) };
else if (IJavaPartitions.JAVA_CHARACTER.equals(contentType) || IDocument.DEFAULT_CONTENT_TYPE.equals(contentType))
return new IAutoEditStrategy[] { new SmartSemicolonAutoEditStrategy(partitioning), new JavaAutoIndentStrategy(partitioning, getProject(), sourceViewer) };
else
return new IAutoEditStrategy[] { new JavaAutoIndentStrategy(partitioning, getProject(), sourceViewer) };
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:13,代码来源:JavaSourceViewerConfiguration.java
示例11: getAutoEditStrategies
import org.eclipse.jface.text.IAutoEditStrategy; //导入依赖的package包/类
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
IAutoEditStrategy strategy =
(IDocument.DEFAULT_CONTENT_TYPE.equals(contentType) ? new ApexAutoIndentStrategy()
: new DefaultIndentLineAutoEditStrategy());
return new IAutoEditStrategy[] { strategy };
}
示例12: getAutoEditStrategies
import org.eclipse.jface.text.IAutoEditStrategy; //导入依赖的package包/类
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
String partitioning= getConfiguredDocumentPartitioning(sourceViewer);
if (IJavaPartitions.JAVA_DOC.equals(contentType) || IJavaPartitions.JAVA_MULTI_LINE_COMMENT.equals(contentType))
return new IAutoEditStrategy[] { new JavaDocAutoIndentStrategy(partitioning) };
else if (IJavaPartitions.JAVA_STRING.equals(contentType))
return new IAutoEditStrategy[] { new SmartSemicolonAutoEditStrategy(partitioning), new JavaStringAutoIndentStrategy(partitioning) };
else if (IJavaPartitions.JAVA_CHARACTER.equals(contentType) || IDocument.DEFAULT_CONTENT_TYPE.equals(contentType))
return new IAutoEditStrategy[] { new SmartSemicolonAutoEditStrategy(partitioning), new JavaAutoIndentStrategy(partitioning, getProject(), sourceViewer) };
else
return new IAutoEditStrategy[] { new JavaAutoIndentStrategy(partitioning, getProject(), sourceViewer) };
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:13,代码来源:JavaSourceViewerConfiguration.java
示例13: getAutoEditStrategies
import org.eclipse.jface.text.IAutoEditStrategy; //导入依赖的package包/类
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
if(IDocument.DEFAULT_CONTENT_TYPE.equals(contentType)) {
return array(new AutoEditStrategyAdapter(
LangUIPlugin_Actual.createAutoEditStrategy(contentType, new VerifyKeyRecorder(sourceViewer))
));
} else {
return super.getAutoEditStrategies(sourceViewer, contentType);
}
}
示例14: getAutoEditStrategies
import org.eclipse.jface.text.IAutoEditStrategy; //导入依赖的package包/类
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
IAutoEditStrategy[] ret = {
new SimpleIndentBracesOnEnterStrategy(),
new SimpleCharBalancingAutoEditStrategy()
};
return ret;
}
示例15: getAutoEditStrategies
import org.eclipse.jface.text.IAutoEditStrategy; //导入依赖的package包/类
@Override
public IAutoEditStrategy[] getAutoEditStrategies(final ISourceViewer sourceViewer,
final String contentType) {
final IAutoEditStrategy strategy = new RelationModelEditStrategy();
return new IAutoEditStrategy[] {strategy};
}