# Class SurroundWithBracketsStrategy

java.lang.Object
org.eclipse.jface.text.SurroundWithBracketsStrategy

All Implemented Interfaces:
  `IAutoEditStrategy`

public class SurroundWithBracketsStrategy extends Object implements IAutoEditStrategy

Since:
  3.27 This strategy supports surrounding the selected text with similar opening and closing brackets when the text is selected and an opening bracket is inserted.

## Constructor Summary

Constructors
Constructor
Description
`SurroundWithBracketsStrategy(ISourceViewer sourceViewer)`

## Method Summary

Modifier and Type
Method
Description
`void`
`customizeDocumentCommand(IDocument document, DocumentCommand command)`
Allows the strategy to manipulate the document command.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### SurroundWithBracketsStrategy

public SurroundWithBracketsStrategy(ISourceViewer sourceViewer)

## Method Details

### customizeDocumentCommand

public void customizeDocumentCommand(IDocument document, DocumentCommand command)
Description copied from interface: `IAutoEditStrategy`
Allows the strategy to manipulate the document command.

Specified by:
  `customizeDocumentCommand` in interface `IAutoEditStrategy`
Parameters:
  `document` - the document that will be changed
  `command` - the document command describing the change