Search in sources :

Example 1 with AutoEditStrategyForJs

use of org.eclipse.wst.jsdt.web.ui.internal.autoedit.AutoEditStrategyForJs in project webtools.sourceediting by eclipse.

the class StructuredTextViewerConfigurationJSDT method getAutoEditStrategies.

/**
 * @see org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML#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);
    }
}
Also used : IAutoEditStrategy(org.eclipse.jface.text.IAutoEditStrategy) AutoEditStrategyForJs(org.eclipse.wst.jsdt.web.ui.internal.autoedit.AutoEditStrategyForJs)

Example 2 with AutoEditStrategyForJs

use of org.eclipse.wst.jsdt.web.ui.internal.autoedit.AutoEditStrategyForJs 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);
    }
}
Also used : IAutoEditStrategy(org.eclipse.jface.text.IAutoEditStrategy) AutoEditStrategyForJs(org.eclipse.wst.jsdt.web.ui.internal.autoedit.AutoEditStrategyForJs)

Aggregations

IAutoEditStrategy (org.eclipse.jface.text.IAutoEditStrategy)2 AutoEditStrategyForJs (org.eclipse.wst.jsdt.web.ui.internal.autoedit.AutoEditStrategyForJs)2