Search in sources :

Example 6 with HeuristicalIntervalDetector

use of org.eclipse.titan.designer.editors.HeuristicalIntervalDetector 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) GeneralTITANAutoEditStrategy(org.eclipse.titan.designer.editors.GeneralTITANAutoEditStrategy) HeuristicalIntervalDetector(org.eclipse.titan.designer.editors.HeuristicalIntervalDetector)

Example 7 with HeuristicalIntervalDetector

use of org.eclipse.titan.designer.editors.HeuristicalIntervalDetector 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

HeuristicalIntervalDetector (org.eclipse.titan.designer.editors.HeuristicalIntervalDetector)7 Interval (org.eclipse.titan.common.parsers.Interval)4 IAutoEditStrategy (org.eclipse.jface.text.IAutoEditStrategy)3 BracketCompletionAutoEditStrategy (org.eclipse.titan.designer.editors.BracketCompletionAutoEditStrategy)3 ClosingBracketIndentationAutoEditStrategy (org.eclipse.titan.designer.editors.ClosingBracketIndentationAutoEditStrategy)3 GeneralTITANAutoEditStrategy (org.eclipse.titan.designer.editors.GeneralTITANAutoEditStrategy)3 IRegion (org.eclipse.jface.text.IRegion)2 SmartIndentAfterNewLineAutoEditStrategy (org.eclipse.titan.designer.editors.ttcn3editor.SmartIndentAfterNewLineAutoEditStrategy)2 BadLocationException (org.eclipse.jface.text.BadLocationException)1 IDocument (org.eclipse.jface.text.IDocument)1 RewriteSessionEditProcessor (org.eclipse.jface.text.RewriteSessionEditProcessor)1 TextSelection (org.eclipse.jface.text.TextSelection)1 MultiTextEdit (org.eclipse.text.edits.MultiTextEdit)1