Search in sources :

Example 1 with AutoEditStrategyForTabs

use of org.eclipse.wst.html.ui.internal.autoedit.AutoEditStrategyForTabs in project webtools.sourceediting by eclipse.

the class StructuredTextViewerConfigurationHTML 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]);
    }
    // be sure this is added last in list, so it has a change to modify
    // previous results.
    // add auto edit strategy that handles when tab key is pressed
    allStrategies.add(new AutoEditStrategyForTabs());
    return (IAutoEditStrategy[]) allStrategies.toArray(new IAutoEditStrategy[allStrategies.size()]);
}
Also used : IAutoEditStrategy(org.eclipse.jface.text.IAutoEditStrategy) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) AutoEditStrategyForTabs(org.eclipse.wst.html.ui.internal.autoedit.AutoEditStrategyForTabs)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 IAutoEditStrategy (org.eclipse.jface.text.IAutoEditStrategy)1 AutoEditStrategyForTabs (org.eclipse.wst.html.ui.internal.autoedit.AutoEditStrategyForTabs)1