@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) }; }
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; }
@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); }
@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; } }
@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); }
@Override public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) { IAutoEditStrategy strategy = (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType) ? new EiffelAutoEditStrategy() : new DefaultIndentLineAutoEditStrategy()); return new IAutoEditStrategy[] {strategy}; }
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) { //return super.getAutoEditStrategies(sourceViewer, contentType); if (autoIndentStrategy == null) { autoIndentStrategy = new TexAutoIndentStrategy(); } return new IAutoEditStrategy[] {autoIndentStrategy}; }
public IAutoEditStrategy[] getAutoEditStrategies( ISourceViewer sourceViewer, String contentType) { IAutoEditStrategy strategy = (IDocument.DEFAULT_CONTENT_TYPE .equals(contentType) ? new XMLAutoIdentStrategy() : new DefaultIndentLineAutoEditStrategy()); return new IAutoEditStrategy[] { strategy }; }
@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); }
@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) }; }
@Override public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) { IAutoEditStrategy strategy = (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType) ? new ApexAutoIndentStrategy() : new DefaultIndentLineAutoEditStrategy()); return new IAutoEditStrategy[] { strategy }; }
@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) }; }
@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); } }
@Override public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) { IAutoEditStrategy[] ret = { new SimpleIndentBracesOnEnterStrategy(), new SimpleCharBalancingAutoEditStrategy() }; return ret; }
@Override public IAutoEditStrategy[] getAutoEditStrategies(final ISourceViewer sourceViewer, final String contentType) { final IAutoEditStrategy strategy = new RelationModelEditStrategy(); return new IAutoEditStrategy[] {strategy}; }
@Override public IAutoEditStrategy[] getAutoEditStrategies(final ISourceViewer sourceViewer, final String contentType) { final IAutoEditStrategy strategy = new ValidationAutoEditStrategy(); return new IAutoEditStrategy[] {strategy}; }
@Override public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) { return new IAutoEditStrategy[] { new LanguageConfigurationAutoEditStrategy() }; }
@Override public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) { IAutoEditStrategy strategy = new DefaultIndentLineAutoEditStrategy(); return new IAutoEditStrategy[] {strategy}; }
@Override public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) { return null; }
@Override public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) { return new IAutoEditStrategy[] { new SmartAutoEditStrategy(partitioning), new LineWrapEditStrategy(editor), new PairEditStrategy() }; }
@Override public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) { List<IAutoEditStrategy> strategies = editStrategyProvider.getStrategies(sourceViewer, contentType); return strategies.toArray(new IAutoEditStrategy[strategies.size()]); }
@Override public IAutoEditStrategy[] getAutoEditStrategies( ISourceViewer sourceViewer, String contentType) { IAutoEditStrategy closeBrackets = new CloseBracketStrategy(); return new IAutoEditStrategy[]{new DefaultIndentLineAutoEditStrategy(), closeBrackets}; }
@Override public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) { return new IAutoEditStrategy[] { new RubyRegexpAutoIndentStrategy(contentType, this, sourceViewer, XMLPlugin .getDefault().getPreferenceStore()) }; }
@Override public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) { return new IAutoEditStrategy[] { new JSAutoIndentStrategy(contentType, this, sourceViewer, JSPlugin .getDefault().getPreferenceStore()) }; }
@Override public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) { return new IAutoEditStrategy[] { new RubyRegexpAutoIndentStrategy(contentType, this, sourceViewer, CSSPlugin.getDefault().getPreferenceStore()) }; }
@Override public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) { return new IAutoEditStrategy[] { new RubyRegexpAutoIndentStrategy(contentType, this, sourceViewer, HTMLPlugin.getDefault().getPreferenceStore()) }; }
@Override public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) { return new IAutoEditStrategy[] { new RubyRegexpAutoIndentStrategy(contentType, this, sourceViewer, CommonEditorPlugin.getDefault().getPreferenceStore()) }; }
public final IAutoEditStrategy[] getAutoEditStrategies(final ISourceViewer sourceViewer, final String contentType) { return new IAutoEditStrategy[]{ getAutoEditStrategy() }; }
@Override public IAutoEditStrategy[] getAutoEditStrategies(@Nullable ISourceViewer sourceViewer, @Nullable String contentType) { return new IAutoEditStrategy[] { new RustAutoIndentStrategy() }; }
@Override public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) { return new IAutoEditStrategy[] {new DefaultIndentLineAutoEditStrategy()}; }
@Override public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) { return new IAutoEditStrategy[] { jsonIndentLineAutoEditStrategy }; }
public void prependAutoEditStrategy(IAutoEditStrategy strategy, String contentType) { viewer.prependAutoEditStrategy(strategy, contentType); }
public void removeAutoEditStrategy(IAutoEditStrategy strategy, String contentType) { viewer.removeAutoEditStrategy(strategy, contentType); }