Package com._1c.g5.v8.dt.bsl.ui.quickfix
Class BslQuickFixUtil
- java.lang.Object
- 
- com._1c.g5.v8.dt.bsl.ui.quickfix.BslQuickFixUtil
 
- 
 public final class BslQuickFixUtil extends Object Bsl quick fix utility/helper methods
- 
- 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static StringBuildercomputeFormatLine(org.eclipse.jface.text.IDocument doc, org.eclipse.jface.text.IRegion lineInformation)Computes format line for theIDocumentandIRegionstatic voidcreateLinkedModeModelForMethod(org.eclipse.xtext.ui.editor.model.IXtextDocument doc, org.eclipse.jface.text.ITextViewer viewer, int posDec, int posUse, int length, org.eclipse.jface.text.link.LinkedPosition[] params)Creates linked mode model forMethodstatic voidcreateLinkedModeModelForVariable(org.eclipse.xtext.ui.editor.model.IXtextDocument doc, org.eclipse.jface.text.ITextViewer viewer, int posDec, int posUse, int length)Creates linked mode model forVariablestatic StringcreateVariable(String declarationKeyword, String varName, String indent, String lineSeparator)Creates the variablestatic StringgetFormatString(org.eclipse.xtext.ui.editor.model.edit.IModificationContext context, Method method)Provides the format string for the givenIXtextDocumentandMethodstatic org.eclipse.jface.text.ITextViewergetTextViewer(org.eclipse.xtext.ui.editor.model.edit.IModificationContext context)Provides theITextViewerfor givenIModificationContextstatic org.eclipse.xtext.ui.editor.model.IXtextDocumentgetXtextDocument(org.eclipse.emf.common.util.URI uri, org.eclipse.xtext.ui.editor.IURIEditorOpener editorOpener)Tries to open xtext document by URI.static voidselectAndRevealForLinkedModeModel(org.eclipse.jface.text.ITextViewer viewer, int posStart, int length)Processes selection changed event within theITextViewerstatic voidwriteToDoc(org.eclipse.xtext.ui.editor.model.IXtextDocument doc, int offset, String method)Writes the content into the document
 
- 
- 
- 
Method Detail- 
getXtextDocumentpublic static org.eclipse.xtext.ui.editor.model.IXtextDocument getXtextDocument(org.eclipse.emf.common.util.URI uri, org.eclipse.xtext.ui.editor.IURIEditorOpener editorOpener)Tries to open xtext document by URI. It does two trials to open the right document since e.g. for form modules the first opened document is form editor- Parameters:
- uri- the URI, cannot be- null
- editorOpener- the editor opener service, cannot be- null
- Returns:
- the document, can be null
 
 - 
getFormatStringpublic static String getFormatString(org.eclipse.xtext.ui.editor.model.edit.IModificationContext context, Method method) throws org.eclipse.jface.text.BadLocationException Provides the format string for the givenIXtextDocumentandMethod- Parameters:
- context- the modification context, cannot be- null
- method- the method, cannot be- null
- Returns:
- format string, never null
- Throws:
- org.eclipse.jface.text.BadLocationException
 
 - 
createVariablepublic static String createVariable(String declarationKeyword, String varName, String indent, String lineSeparator) Creates the variable- Parameters:
- declarationKeyword- the declaration keyword, cannot be- null
- varName- the variable name, cannot be- null
- indent- the indentation string, cannot be- null
- lineSeparator- the line separator, cannot be- null
- Returns:
- created variable name, nevr null
 
 - 
writeToDocpublic static void writeToDoc(org.eclipse.xtext.ui.editor.model.IXtextDocument doc, int offset, String method)Writes the content into the document- Parameters:
- doc- the document, cannot be- null
- offset- the offset
- method- the method name, cannot be- null
 
 - 
createLinkedModeModelForVariablepublic static void createLinkedModeModelForVariable(org.eclipse.xtext.ui.editor.model.IXtextDocument doc, org.eclipse.jface.text.ITextViewer viewer, int posDec, int posUse, int length)Creates linked mode model forVariable- Parameters:
- doc- the document, cannot be- null
- viewer- the viewer, cannot be- null
- posDec- the declaration position
- posUse- the use position
- length- the variable length
 
 - 
createLinkedModeModelForMethodpublic static void createLinkedModeModelForMethod(org.eclipse.xtext.ui.editor.model.IXtextDocument doc, org.eclipse.jface.text.ITextViewer viewer, int posDec, int posUse, int length, org.eclipse.jface.text.link.LinkedPosition[] params)Creates linked mode model forMethod- Parameters:
- doc- the document, cannot be- null
- viewer- the viewer, cannot be- null
- posDec- the declaration position
- posUse- the use position
- length- the variable length
- params- the parameters, cannot be- null
 
 - 
getTextViewerpublic static org.eclipse.jface.text.ITextViewer getTextViewer(org.eclipse.xtext.ui.editor.model.edit.IModificationContext context) Provides theITextViewerfor givenIModificationContext- Parameters:
- context- the modification context, cannot be- null
- Returns:
- the ITextViewer, can benull
 
 - 
computeFormatLinepublic static StringBuilder computeFormatLine(org.eclipse.jface.text.IDocument doc, org.eclipse.jface.text.IRegion lineInformation) throws org.eclipse.jface.text.BadLocationException Computes format line for theIDocumentandIRegion- Parameters:
- doc- the document, cannot be- null
- lineInformation- the line info region, cannot be- null
- Returns:
- StringBuilderwith contents of format line, never- null, can be empty
- Throws:
- org.eclipse.jface.text.BadLocationException
 
 - 
selectAndRevealForLinkedModeModelpublic static void selectAndRevealForLinkedModeModel(org.eclipse.jface.text.ITextViewer viewer, int posStart, int length)Processes selection changed event within theITextViewer- Parameters:
- viewer- the viewer, cannot be- null
- posStart- the start position of the selection
- length- the length of the selection
 
 
- 
 
-