Package com._1c.g5.v8.dt.bsl.ui
Class BslDocumentationProvider
- java.lang.Object
-
- com._1c.g5.v8.dt.bsl.ui.BslDocumentationProvider
-
public class BslDocumentationProvider extends Object
Contains special methods for getting different type of context help for BSL
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BslDocumentationProvider.DocumentContent
Structured content template commentstatic class
BslDocumentationProvider.ShortFullDoc
Class contains documentation for the element in bsl language
-
Field Summary
Fields Modifier and Type Field Description static String
HTML_EXT
static String
HTML_PATH
static String
PARAMETERIZED_HTML_PATH
static String
PLUGINS_ROOT
static String
RESOURCE_FOLDER
static String
START_HTML_PATH
static String
VERSION_PREFIX
-
Constructor Summary
Constructors Constructor Description BslDocumentationProvider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
addDecorToDoc(String doc)
Add special css todoc
BslDocumentationProvider.DocumentContent
createMethodTemplateWithoutComments(Method method)
CreatesBslDocumentationProvider.DocumentContent
byMethod
static String
createSyntax(Method method)
Gets syntax of Bsl methodString
getDocByContext(org.eclipse.help.IContext context)
Gets full documentation byIContext
BslDocumentationProvider.ShortFullDoc
getDocByEObject(org.eclipse.emf.ecore.EObject object)
Gets documentation for element from model of BSLBslDocumentationProvider.ShortFullDoc
getDocByEObjectAndOffset(org.eclipse.emf.ecore.EObject object, Integer offset)
Gets documentation for element from model of BSLString
getDocContentByEObject(org.eclipse.emf.ecore.EObject object)
Gets raw documentation content for element from model of BSLString
getDocContentByEObjectAndOffset(org.eclipse.emf.ecore.EObject object, Integer offset)
Gets raw documentation content for element from model of BSLString
getDocForProducingTypes(URL url, Version version, Map<String,String> typeSetNames)
String
getDocFromUrl(URL url)
Gets content fromurl
String
getDocumentationForGroupingMethod(Collection<org.eclipse.xtext.util.Pair<Method,TypeItem>> methods, int paramSetIndex, Version version)
Gets documentation for grouping method in syntax-context listString
getDocumentationForGroupingMethod(Collection<org.eclipse.xtext.util.Pair<Method,TypeItem>> methods, int paramSetIndex, Version version, boolean needTemplate)
Gets documentation for grouping method in syntax-context listString
getDocumentationForGroupingProperty(Collection<org.eclipse.xtext.util.Pair<Property,TypeItem>> properties, Version version)
Gets documentation for grouping properties in syntax-context listString
getDocumentationForGroupingProperty(Collection<org.eclipse.xtext.util.Pair<Property,TypeItem>> properties, Version version, boolean needTemplate)
Gets documentation for grouping properties in syntax-context listString
getEnTypeName(String name, org.eclipse.emf.ecore.resource.Resource context)
Gets English name by name in different language forType
String
getEObjectHoverDarkStyle()
Returns dark theme css styles for Eobject hover.String
getFullDoc(org.eclipse.xtext.ui.editor.model.IXtextDocument doc, int offset)
Get full documentation for the element from document in positionoffset
String
getFullDocWithDecor(org.eclipse.xtext.ui.editor.model.IXtextDocument doc, int offset)
Gets full documentation with decoration textString
getMethodicalLink(String fullDocumentation)
Gets url to methodical information by full documentation contentstatic String
getParameterizedHtmlPath(Version version)
Gets parameterized html path to help context informationString
getShortDoc(org.eclipse.xtext.ui.editor.model.IXtextDocument doc, int offset)
Gets short documentationMap<String,String>
getTypeSetNames(org.eclipse.emf.ecore.resource.Resource resource)
Gets actualTypeSet
names and their including types.Map<String,String>
getTypeSetNames(org.eclipse.xtext.ui.editor.model.IXtextDocument document)
Gets actualTypeSet
names and their including types.Version
getVersion(org.eclipse.emf.ecore.EObject object)
Gets corresponding project version byobject
Version
getVersion(org.eclipse.xtext.ui.editor.model.IXtextDocument document)
Gets actualVersion
for project byIXtextDocument
IRuntimeVersionSupport
getVersionSupport()
static List<BslDocumentationProvider.DocumentContent.Reference>
typeResolve(List<TypeItem> retValTypes, org.eclipse.emf.ecore.resource.Resource res)
Create reference toTypeItem
for documentation
-
-
-
Field Detail
-
START_HTML_PATH
public static final String START_HTML_PATH
- See Also:
- Constant Field Values
-
HTML_PATH
public static final String HTML_PATH
- See Also:
- Constant Field Values
-
PARAMETERIZED_HTML_PATH
public static final String PARAMETERIZED_HTML_PATH
- See Also:
- Constant Field Values
-
VERSION_PREFIX
public static final String VERSION_PREFIX
- See Also:
- Constant Field Values
-
PLUGINS_ROOT
public static final String PLUGINS_ROOT
- See Also:
- Constant Field Values
-
RESOURCE_FOLDER
public static final String RESOURCE_FOLDER
- See Also:
- Constant Field Values
-
HTML_EXT
public static final String HTML_EXT
- See Also:
- Constant Field Values
-
-
Method Detail
-
createSyntax
public static String createSyntax(Method method)
Gets syntax of Bsl method- Parameters:
method
-Method
- Returns:
- syntax string
-
typeResolve
public static List<BslDocumentationProvider.DocumentContent.Reference> typeResolve(List<TypeItem> retValTypes, org.eclipse.emf.ecore.resource.Resource res)
Create reference toTypeItem
for documentation- Parameters:
retValTypes
- list ofTypeItem
res
- currentResource
- Returns:
- list of
BslDocumentationProvider.DocumentContent.Reference
or empty list, can't returnnull
-
getParameterizedHtmlPath
public static String getParameterizedHtmlPath(Version version)
Gets parameterized html path to help context information- Parameters:
version
- actual project version is the parameter of the path, can't benull
- Returns:
- parameterized html path to help context information, never
null
-
getVersionSupport
public IRuntimeVersionSupport getVersionSupport()
- Returns:
IRuntimeVersionSupport
, nevernull
-
getEnTypeName
public String getEnTypeName(String name, org.eclipse.emf.ecore.resource.Resource context)
Gets English name by name in different language forType
- Parameters:
name
- current namecontext
- current context- Returns:
- English name of
Type
-
addDecorToDoc
public String addDecorToDoc(String doc)
Add special css todoc
- Parameters:
doc
- source text- Returns:
- decorated text
-
getDocContentByEObject
public String getDocContentByEObject(org.eclipse.emf.ecore.EObject object)
Gets raw documentation content for element from model of BSL- Parameters:
object
- model element- Returns:
- raw documentation content for given element
-
getDocContentByEObjectAndOffset
public String getDocContentByEObjectAndOffset(org.eclipse.emf.ecore.EObject object, Integer offset)
Gets raw documentation content for element from model of BSL- Parameters:
object
- model elementoffset
- actual offset- Returns:
- raw documentation content for given element
-
getDocByEObject
public BslDocumentationProvider.ShortFullDoc getDocByEObject(org.eclipse.emf.ecore.EObject object)
Gets documentation for element from model of BSL- Parameters:
object
- model element- Returns:
- documentation for given element
-
getDocByEObjectAndOffset
public BslDocumentationProvider.ShortFullDoc getDocByEObjectAndOffset(org.eclipse.emf.ecore.EObject object, Integer offset)
Gets documentation for element from model of BSL- Parameters:
object
- model elementoffset
- actual offset- Returns:
- documentation for given element
-
getVersion
public Version getVersion(org.eclipse.emf.ecore.EObject object)
Gets corresponding project version byobject
- Parameters:
object
- object for getting project version, can't benull
- Returns:
- corresponding project version by
object
, nevernull
-
getShortDoc
public String getShortDoc(org.eclipse.xtext.ui.editor.model.IXtextDocument doc, int offset)
Gets short documentation- Returns:
- documentation
-
getFullDoc
public String getFullDoc(org.eclipse.xtext.ui.editor.model.IXtextDocument doc, int offset)
Get full documentation for the element from document in positionoffset
- Parameters:
doc
- document which contains interest elementoffset
- position of element indoc
- Returns:
- full documentation
-
getDocByContext
public String getDocByContext(org.eclipse.help.IContext context)
Gets full documentation byIContext
- Parameters:
context
- actual help context, can benull
- Returns:
- text of documentation from
context
, or empty string if documentation wasn't found orcontext
isnull
, nevernull
-
getFullDocWithDecor
public String getFullDocWithDecor(org.eclipse.xtext.ui.editor.model.IXtextDocument doc, int offset)
Gets full documentation with decoration text- Parameters:
doc
- document which contains interest elementoffset
- position of element indoc
- Returns:
- full documentation
-
createMethodTemplateWithoutComments
public BslDocumentationProvider.DocumentContent createMethodTemplateWithoutComments(Method method)
CreatesBslDocumentationProvider.DocumentContent
byMethod
- Parameters:
method
- method for creatingBslDocumentationProvider.DocumentContent
- Returns:
- created
BslDocumentationProvider.DocumentContent
, nevernull
-
getVersion
public Version getVersion(org.eclipse.xtext.ui.editor.model.IXtextDocument document)
Gets actualVersion
for project byIXtextDocument
- Parameters:
document
- actualIXtextDocument
, can't benull
- Returns:
- actual
Version
for project byIXtextDocument
, nevernull
. SeeIRuntimeVersionSupport.getRuntimeVersion(Resource)
-
getTypeSetNames
public Map<String,String> getTypeSetNames(org.eclipse.xtext.ui.editor.model.IXtextDocument document)
Gets actualTypeSet
names and their including types.- Parameters:
document
- actualIXtextDocument
for gettingResource
and call methodgetTypeSetNames(Resource)
, can't benull
- Returns:
- the map, where key - name of the type category name (
TypeSet
name equals to category type name), value - names of the object which has type corresponding to the category type name in key of the map through the comma. At the end of the value you can find special symbol '#' and name of the base type after it.
Attention for category "AnyRef" - the value is names of the type corresponding to the it through the comma. Also there is no special symbol '#' at the end.
Nevernull
-
getTypeSetNames
public Map<String,String> getTypeSetNames(org.eclipse.emf.ecore.resource.Resource resource)
Gets actualTypeSet
names and their including types.- Parameters:
resource
- actualResource
for gettingIScope
of all producing types in project, can't benull
- Returns:
- the map, where key - name of the type category name (
TypeSet
name equals to category type name), value - names of the object which has type corresponding to the category type name in key of the map through the comma. At the end of the value you can find special symbol '#' and name of the base type after it.
Attention for category "AnyRef" - the value is names of the type corresponding to the it through the comma. Also there is no special symbol '#' at the end.
Nevernull
-
getDocFromUrl
public String getDocFromUrl(URL url)
Gets content fromurl
- Parameters:
url
- address of documentation, can benull
- Returns:
- text of documentation was read from
url
or empty string if documentation wasn't read orurl
isnull
, nevernull
-
getDocForProducingTypes
public String getDocForProducingTypes(URL url, Version version, Map<String,String> typeSetNames)
- Parameters:
url
- actualURL
for getting documentation, can't benull
version
- actual version of the project, can't benull
typeSetNames
- the map, where key - name of the type category name (TypeSet
name equals to category type name), value - names of the object which has type corresponding to the category type name in key of the map through the comma. At the end of the value you can find special symbol '#' and name of the base type after it.
Attention for category "AnyRef" - the value is names of the type corresponding to the it through the comma. Also there is no special symbol '#' at the end.
Can't benull
- Returns:
- documentation for
TypeSet
and producingType
or empty string if documentation wasn't found, nevernull
-
getDocumentationForGroupingMethod
public String getDocumentationForGroupingMethod(Collection<org.eclipse.xtext.util.Pair<Method,TypeItem>> methods, int paramSetIndex, Version version)
Gets documentation for grouping method in syntax-context list- Parameters:
methods
- grouping methods from syntax-context list, can't benull
paramSetIndex
- index of theParamSet
for creating documentationversion
- actual project version, can't benull
- Returns:
- documentation for grouping method in syntax-context list, never
null
-
getDocumentationForGroupingMethod
public String getDocumentationForGroupingMethod(Collection<org.eclipse.xtext.util.Pair<Method,TypeItem>> methods, int paramSetIndex, Version version, boolean needTemplate)
Gets documentation for grouping method in syntax-context list- Parameters:
methods
- grouping methods from syntax-context list, can't benull
paramSetIndex
- index of theParamSet
for creating documentationversion
- actual project version, can't benull
needTemplate
-true
if documentation should contain help context id instead real help url,false
it real hepl url in documentation- Returns:
- documentation for grouping method in syntax-context list, never
null
-
getDocumentationForGroupingProperty
public String getDocumentationForGroupingProperty(Collection<org.eclipse.xtext.util.Pair<Property,TypeItem>> properties, Version version)
Gets documentation for grouping properties in syntax-context list- Parameters:
methods
- grouping properties from syntax-context list, can't benull
version
- actual project version, can't benull
- Returns:
- documentation for grouping properties in syntax-context list, never
null
-
getDocumentationForGroupingProperty
public String getDocumentationForGroupingProperty(Collection<org.eclipse.xtext.util.Pair<Property,TypeItem>> properties, Version version, boolean needTemplate)
Gets documentation for grouping properties in syntax-context list- Parameters:
methods
- grouping properties from syntax-context list, can't benull
version
- actual project version, can't benull
needTemplate
-true
if documentation should contain help context id instead real help url,false
it real hepl url in documentation- Returns:
- documentation for grouping properties in syntax-context list, never
null
-
getMethodicalLink
public String getMethodicalLink(String fullDocumentation)
Gets url to methodical information by full documentation content- Parameters:
fullDocumentation
- full documentation content, can't benull
- Returns:
- url to methodical information by full documentation content, never
null
. Can be empty string if there is no link to methodical information
-
getEObjectHoverDarkStyle
public String getEObjectHoverDarkStyle()
Returns dark theme css styles for Eobject hover.- Returns:
- dark theme css styles for Eobject hover. Can't return
null
.
-
-