当前位置: 首页>>代码示例>>Java>>正文


Java IAutoEditStrategy类代码示例

本文整理汇总了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) };
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:19,代码来源:TypeScriptSourceViewerConfiguration.java

示例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;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:18,代码来源:AbstractEditStrategyProvider.java

示例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);
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:22,代码来源:UiBinderXmlSourceViewerConfiguration.java

示例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);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:13,代码来源:AutoEditStrategyProvider.java

示例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};
}
 
开发者ID:Imhotup,项目名称:LibertyEiffel-Eclipse-Plugin,代码行数:8,代码来源:EiffelSourceViewerConfiguration.java

示例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};
}
 
开发者ID:eclipse,项目名称:texlipse,代码行数:8,代码来源:TexSourceViewerConfiguration.java

示例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 };
}
 
开发者ID:ncleclipse,项目名称:ncl30-eclipse,代码行数:8,代码来源:NCLConfiguration.java

示例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);
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:13,代码来源:GWTSourceViewerConfiguration.java

示例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 };
}
 
开发者ID:forcedotcom,项目名称:idecore,代码行数:9,代码来源:ApexSourceViewerConfiguration.java

示例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);
	}
}
 
开发者ID:GoClipse,项目名称:goclipse,代码行数:11,代码来源:AbstractLangSourceViewerConfiguration.java

示例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; 
}
 
开发者ID:mulesoft,项目名称:mule-tooling-incubator,代码行数:10,代码来源:GradleProjectHighlightConfiguration.java

示例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};
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:7,代码来源:RelationModelEditorSourceViewerConfiguration.java


注:本文中的org.eclipse.jface.text.IAutoEditStrategy类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。