use of org.eclipse.jface.text.IAutoEditStrategy in project titan.EclipsePlug-ins by eclipse.
the class Configuration method getAutoEditStrategies.
@Override
public IAutoEditStrategy[] getAutoEditStrategies(final ISourceViewer sourceViewer, final String contentType) {
HeuristicalIntervalDetector detector = new HeuristicalIntervalDetector();
GeneralTITANAutoEditStrategy strategy2 = new ClosingBracketIndentationAutoEditStrategy();
strategy2.setHeuristicIntervalDetector(detector);
GeneralTITANAutoEditStrategy strategy3 = new SmartIndentAfterNewLineAutoEditStrategy();
strategy3.setHeuristicIntervalDetector(detector);
return new IAutoEditStrategy[] { new BracketCompletionAutoEditStrategy(), strategy2, strategy3 };
}
use of org.eclipse.jface.text.IAutoEditStrategy in project titan.EclipsePlug-ins by eclipse.
the class Configuration method getAutoEditStrategies.
@Override
public IAutoEditStrategy[] getAutoEditStrategies(final ISourceViewer sourceViewer, final String contentType) {
HeuristicalIntervalDetector detector = new HeuristicalIntervalDetector();
GeneralTITANAutoEditStrategy strategy2 = new ClosingBracketIndentationAutoEditStrategy();
strategy2.setHeuristicIntervalDetector(detector);
GeneralTITANAutoEditStrategy strategy3 = new SmartIndentAfterNewLineAutoEditStrategy();
strategy3.setHeuristicIntervalDetector(detector);
return new IAutoEditStrategy[] { new BracketCompletionAutoEditStrategy(), strategy2, strategy3 };
}
use of org.eclipse.jface.text.IAutoEditStrategy in project eclipse.platform.text by eclipse.
the class AutoEditStrategyRegistry method sync.
private void sync() {
Set<IConfigurationElement> toRemoveExtensions = new HashSet<>(this.extensions.keySet());
for (IConfigurationElement extension : Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_POINT_ID)) {
toRemoveExtensions.remove(extension);
if (!this.extensions.containsKey(extension)) {
try {
this.extensions.put(extension, new GenericContentTypeRelatedExtension<IAutoEditStrategy>(extension));
} catch (Exception ex) {
GenericEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, GenericEditorPlugin.BUNDLE_ID, ex.getMessage(), ex));
}
}
}
for (IConfigurationElement toRemove : toRemoveExtensions) {
this.extensions.remove(toRemove);
}
this.outOfSync = false;
}
use of org.eclipse.jface.text.IAutoEditStrategy in project webtools.sourceediting by eclipse.
the class JSDTStructuredTextViewerConfigurationJSP method getAutoEditStrategies.
/**
* @see org.eclipse.jst.jsp.ui.StructuredTextViewerConfigurationJSP#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
*/
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
if (contentType.equals(IHTMLPartitions.SCRIPT) || contentType.equals(IHTMLPartitions.SCRIPT_EVENTHANDLER)) {
IAutoEditStrategy[] strategies = new IAutoEditStrategy[1];
strategies[0] = new AutoEditStrategyForJs();
return strategies;
} else {
return super.getAutoEditStrategies(sourceViewer, contentType);
}
}
use of org.eclipse.jface.text.IAutoEditStrategy in project webtools.sourceediting by eclipse.
the class StructuredTextViewerConfigurationCSS method getAutoEditStrategies.
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
List allStrategies = new ArrayList(0);
IAutoEditStrategy[] superStrategies = super.getAutoEditStrategies(sourceViewer, contentType);
for (int i = 0; i < superStrategies.length; i++) {
allStrategies.add(superStrategies[i]);
}
return (IAutoEditStrategy[]) allStrategies.toArray(new IAutoEditStrategy[0]);
}
Aggregations