Search in sources :

Example 1 with SmartIndentAfterNewLineAutoEditStrategy

use of org.eclipse.titan.designer.editors.ttcn3editor.SmartIndentAfterNewLineAutoEditStrategy 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 };
}
Also used : ClosingBracketIndentationAutoEditStrategy(org.eclipse.titan.designer.editors.ClosingBracketIndentationAutoEditStrategy) IAutoEditStrategy(org.eclipse.jface.text.IAutoEditStrategy) BracketCompletionAutoEditStrategy(org.eclipse.titan.designer.editors.BracketCompletionAutoEditStrategy) SmartIndentAfterNewLineAutoEditStrategy(org.eclipse.titan.designer.editors.ttcn3editor.SmartIndentAfterNewLineAutoEditStrategy) GeneralTITANAutoEditStrategy(org.eclipse.titan.designer.editors.GeneralTITANAutoEditStrategy) HeuristicalIntervalDetector(org.eclipse.titan.designer.editors.HeuristicalIntervalDetector)

Example 2 with SmartIndentAfterNewLineAutoEditStrategy

use of org.eclipse.titan.designer.editors.ttcn3editor.SmartIndentAfterNewLineAutoEditStrategy in project titan.EclipsePlug-ins by eclipse.

the class Configuration method getAutoEditStrategies.

/**
 * Returns the auto indentation strategy ready to be used with the given
 * source viewer when manipulating text of the given content type..
 *
 * @param sourceViewer
 *                the source viewer to be configured by this
 *                configuration
 * @param contentType
 *                the content type for which the strategy is applicable
 * @return the auto indent strategy or <code>null</code> if automatic
 *         indentation is not to be enabled
 */
@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 };
}
Also used : ClosingBracketIndentationAutoEditStrategy(org.eclipse.titan.designer.editors.ClosingBracketIndentationAutoEditStrategy) IAutoEditStrategy(org.eclipse.jface.text.IAutoEditStrategy) BracketCompletionAutoEditStrategy(org.eclipse.titan.designer.editors.BracketCompletionAutoEditStrategy) SmartIndentAfterNewLineAutoEditStrategy(org.eclipse.titan.designer.editors.ttcn3editor.SmartIndentAfterNewLineAutoEditStrategy) GeneralTITANAutoEditStrategy(org.eclipse.titan.designer.editors.GeneralTITANAutoEditStrategy) HeuristicalIntervalDetector(org.eclipse.titan.designer.editors.HeuristicalIntervalDetector)

Aggregations

IAutoEditStrategy (org.eclipse.jface.text.IAutoEditStrategy)2 BracketCompletionAutoEditStrategy (org.eclipse.titan.designer.editors.BracketCompletionAutoEditStrategy)2 ClosingBracketIndentationAutoEditStrategy (org.eclipse.titan.designer.editors.ClosingBracketIndentationAutoEditStrategy)2 GeneralTITANAutoEditStrategy (org.eclipse.titan.designer.editors.GeneralTITANAutoEditStrategy)2 HeuristicalIntervalDetector (org.eclipse.titan.designer.editors.HeuristicalIntervalDetector)2 SmartIndentAfterNewLineAutoEditStrategy (org.eclipse.titan.designer.editors.ttcn3editor.SmartIndentAfterNewLineAutoEditStrategy)2