Java 类org.eclipse.jface.text.IAutoEditStrategy 实例源码

项目:typescript.java    文件:TypeScriptSourceViewerConfiguration.java   
@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) };
}
项目:bts    文件:AbstractEditStrategyProvider.java   
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;
}
项目:gwt-eclipse-plugin    文件:UiBinderXmlSourceViewerConfiguration.java   
@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);
}
项目:Eclipse-Postfix-Code-Completion    文件:PropertiesFileSourceViewerConfiguration.java   
@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;
    }
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:PropertiesFileSourceViewerConfiguration.java   
@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;
    }
}
项目:n4js    文件:AutoEditStrategyProvider.java   
@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);
}
项目:LibertyEiffel-Eclipse-Plugin    文件:EiffelSourceViewerConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
    IAutoEditStrategy strategy = (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType) ? 
            new EiffelAutoEditStrategy() : new DefaultIndentLineAutoEditStrategy());

    return new IAutoEditStrategy[] {strategy};
}
项目:texlipse    文件:TexSourceViewerConfiguration.java   
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
    //return super.getAutoEditStrategies(sourceViewer, contentType);
    if (autoIndentStrategy == null) {
        autoIndentStrategy = new TexAutoIndentStrategy();
    }
    return new IAutoEditStrategy[] {autoIndentStrategy};
}
项目:ncl30-eclipse    文件:NCLConfiguration.java   
public IAutoEditStrategy[] getAutoEditStrategies(
        ISourceViewer sourceViewer, String contentType) {
    IAutoEditStrategy strategy = (IDocument.DEFAULT_CONTENT_TYPE
            .equals(contentType) ? new XMLAutoIdentStrategy()
            : new DefaultIndentLineAutoEditStrategy());
    return new IAutoEditStrategy[] { strategy };
}
项目:gwt-eclipse-plugin    文件:GWTSourceViewerConfiguration.java   
@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);
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaSourceViewerConfiguration.java   
@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) };
}
项目:idecore    文件:ApexSourceViewerConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
    IAutoEditStrategy strategy =
            (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType) ? new ApexAutoIndentStrategy()
                    : new DefaultIndentLineAutoEditStrategy());

    return new IAutoEditStrategy[] { strategy };
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaSourceViewerConfiguration.java   
@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) };
}
项目:goclipse    文件:AbstractLangSourceViewerConfiguration.java   
@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);
    }
}
项目:mule-tooling-incubator    文件:GradleProjectHighlightConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {

    IAutoEditStrategy[] ret = {
            new SimpleIndentBracesOnEnterStrategy(),
            new SimpleCharBalancingAutoEditStrategy()
    };
    return ret; 
}
项目:Tarski    文件:RelationModelEditorSourceViewerConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(final ISourceViewer sourceViewer,
    final String contentType) {
  final IAutoEditStrategy strategy = new RelationModelEditStrategy();
  return new IAutoEditStrategy[] {strategy};
}
项目:Tarski    文件:ValidationConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(final ISourceViewer sourceViewer,
    final String contentType) {
  final IAutoEditStrategy strategy = new ValidationAutoEditStrategy();
  return new IAutoEditStrategy[] {strategy};
}
项目:tm4e    文件:TextMateSourceViewerConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
    return new IAutoEditStrategy[] { new LanguageConfigurationAutoEditStrategy() };
}
项目:LibertyEiffel-Eclipse-Plugin    文件:EiffelSourceViewerConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
    IAutoEditStrategy strategy = new DefaultIndentLineAutoEditStrategy();

    return new IAutoEditStrategy[] {strategy};
}
项目:fluentmark    文件:FluentMkSimpleSourceViewerConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
    return null;
}
项目:fluentmark    文件:FluentMkSourceViewerConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
    return new IAutoEditStrategy[] { new SmartAutoEditStrategy(partitioning), new LineWrapEditStrategy(editor),
            new PairEditStrategy() };
}
项目:bts    文件:ReadOnlySourceViewerConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
    return null;
}
项目:bts    文件:XtextSourceViewerConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
    List<IAutoEditStrategy> strategies = editStrategyProvider.getStrategies(sourceViewer, contentType);
    return strategies.toArray(new IAutoEditStrategy[strategies.size()]);
}
项目:brainfuck    文件:BfSourceViewerConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(
        ISourceViewer sourceViewer, String contentType) {
    IAutoEditStrategy closeBrackets = new CloseBracketStrategy();
    return new IAutoEditStrategy[]{new DefaultIndentLineAutoEditStrategy(), closeBrackets};
}
项目:APICloud-Studio    文件:XMLSourceViewerConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType)
{
    return new IAutoEditStrategy[] { new RubyRegexpAutoIndentStrategy(contentType, this, sourceViewer, XMLPlugin
            .getDefault().getPreferenceStore()) };
}
项目:APICloud-Studio    文件:JSSourceViewerConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType)
{
    return new IAutoEditStrategy[] { new JSAutoIndentStrategy(contentType, this, sourceViewer, JSPlugin
            .getDefault().getPreferenceStore()) };
}
项目:APICloud-Studio    文件:CSSSourceViewerConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
    return new IAutoEditStrategy[] { new RubyRegexpAutoIndentStrategy(contentType, this, sourceViewer, CSSPlugin.getDefault().getPreferenceStore()) };
}
项目:APICloud-Studio    文件:HTMLSourceViewerConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
    return new IAutoEditStrategy[] { new RubyRegexpAutoIndentStrategy(contentType, this, sourceViewer, HTMLPlugin.getDefault().getPreferenceStore()) };
}
项目:APICloud-Studio    文件:CommonSourceViewerConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType)
{
    return new IAutoEditStrategy[] { new RubyRegexpAutoIndentStrategy(contentType, this, sourceViewer,
            CommonEditorPlugin.getDefault().getPreferenceStore()) };
}
项目:Eclipse-Postfix-Code-Completion    文件:SimpleJavaSourceViewerConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
    return null;
}
项目:WP3    文件:RelationModelEditorSourceViewerConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(final ISourceViewer sourceViewer,
    final String contentType) {
  final IAutoEditStrategy strategy = new RelationModelEditStrategy();
  return new IAutoEditStrategy[] {strategy};
}
项目:WP3    文件:ValidationConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(final ISourceViewer sourceViewer,
    final String contentType) {
  final IAutoEditStrategy strategy = new ValidationAutoEditStrategy();
  return new IAutoEditStrategy[] {strategy};
}
项目:syncope    文件:HTMLSourceConfiguration.java   
public final IAutoEditStrategy[] getAutoEditStrategies(final ISourceViewer sourceViewer,
        final String contentType) {
    return new IAutoEditStrategy[]{ getAutoEditStrategy() };
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:SimpleJavaSourceViewerConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
    return null;
}
项目:rustyeclipse    文件:RustEditorConfig.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(@Nullable ISourceViewer sourceViewer, @Nullable String contentType) {
    return new IAutoEditStrategy[] { new RustAutoIndentStrategy() };
}
项目:eclipse-gn    文件:SimpleGnSourceViewerConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
  return null;
}
项目:eclipse-gn    文件:GnSourceViewerConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
  return new IAutoEditStrategy[] {new DefaultIndentLineAutoEditStrategy()};
}
项目:wt-studio    文件:JsonSourceViewerConfiguration.java   
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
    return new IAutoEditStrategy[] { jsonIndentLineAutoEditStrategy };
}
项目:Pydev    文件:ScriptConsoleViewerWrapper.java   
public void prependAutoEditStrategy(IAutoEditStrategy strategy, String contentType) {
    viewer.prependAutoEditStrategy(strategy, contentType);
}
项目:Pydev    文件:ScriptConsoleViewerWrapper.java   
public void removeAutoEditStrategy(IAutoEditStrategy strategy, String contentType) {
    viewer.removeAutoEditStrategy(strategy, contentType);
}