Package com._1c.g5.v8.dt.bsl.ui.event
Class BslModuleEventsLookup
- java.lang.Object
-
- com._1c.g5.v8.dt.bsl.ui.event.BslModuleEventsLookup
-
- All Implemented Interfaces:
IBslModuleEventsLookup
,IBslModuleExtensionEventsLookup
public class BslModuleEventsLookup extends Object implements IBslModuleExtensionEventsLookup
Implementation ofIBslModuleEventsLookup
.
-
-
Constructor Summary
Constructors Constructor Description BslModuleEventsLookup()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EventHandlerInformation
createHandlerInForm(org.eclipse.xtext.ui.editor.model.IXtextDocument doc, org.eclipse.jface.text.ITextViewer viewer, String currentHandlerName, Event event, boolean isMainItem, boolean isCommandHandler, String procedureDerictive)
Creates handler for event from Form (called from property sheet).String
createInsertContentProposals(Event event, ParamSet set, String eventName, boolean isMainItem, boolean isCommandHandler, Module actualBslModule, String procedureDerictive, int offset, org.eclipse.jface.text.IDocument document, boolean isRussian)
Creates insert content assist proposals.String
createInsertContentProposals(Event event, ParamSet set, String eventName, boolean isMainItem, boolean isCommandHandler, Module actualBslModule, String procedureDerictive, String procedureAnnotation, String extensionPrefix, int offset, org.eclipse.jface.text.IDocument document, boolean isRussian)
Creates insert content assist proposals of event handler for extension moduleorg.eclipse.xtext.util.Triple<org.eclipse.jface.text.ITextSelection,Boolean,Object>
findHandlerInForm(org.eclipse.xtext.ui.editor.model.IXtextDocument doc, String currentHandlerName)
Finds method by name in form bsl module by handler name from property sheet.int
getPositionOfInsertionEvent(Module module, int offset, org.eclipse.jface.text.ITextViewer viewer)
Defines offset of the insertingEvent
.String
getValidName(org.eclipse.xtext.ui.editor.model.IXtextDocument doc, String methodNamePrefix)
Returns unique method name for Bsl module.
-
-
-
Method Detail
-
findHandlerInForm
public org.eclipse.xtext.util.Triple<org.eclipse.jface.text.ITextSelection,Boolean,Object> findHandlerInForm(org.eclipse.xtext.ui.editor.model.IXtextDocument doc, String currentHandlerName)
Description copied from interface:IBslModuleEventsLookup
Finds method by name in form bsl module by handler name from property sheet.- Specified by:
findHandlerInForm
in interfaceIBslModuleEventsLookup
- Parameters:
doc
- actualIXtextDocument
, can't benull
currentHandlerName
- searching handler's name, can't benull
- Returns:
- triple, never
null
, which contains- actual selection of the found handler, or empty selection if handler wasn't found
true
if actual script variant is Russian,false
otherwise- resource lock of document, can be
null
-
createHandlerInForm
public EventHandlerInformation createHandlerInForm(org.eclipse.xtext.ui.editor.model.IXtextDocument doc, org.eclipse.jface.text.ITextViewer viewer, String currentHandlerName, Event event, boolean isMainItem, boolean isCommandHandler, String procedureDerictive)
Description copied from interface:IBslModuleEventsLookup
Creates handler for event from Form (called from property sheet).- Specified by:
createHandlerInForm
in interfaceIBslModuleEventsLookup
- Parameters:
doc
- actualIXtextDocument
, can't benull
viewer
- actualITextViewer
, can't benull
currentHandlerName
- searching handler's name, can't benull
event
- handle events, can't benull
isMainItem
-true
if event from main item of form,false
otherwiseisCommandHandler
-true
if event from command of form,false
otherwiseprocedureDerictive
- directive for chosen event, or empty string if there is no procedure for chosen event- Returns:
EventHandlerInformation
, can't benull
-
getPositionOfInsertionEvent
public int getPositionOfInsertionEvent(Module module, int offset, org.eclipse.jface.text.ITextViewer viewer)
Description copied from interface:IBslModuleEventsLookup
Defines offset of the insertingEvent
.- Specified by:
getPositionOfInsertionEvent
in interfaceIBslModuleEventsLookup
- Parameters:
module
- current Bsl moduleoffset
- current cursor offsetviewer
- currentITextViewer
- Returns:
- offset of the inserting
Event
-
getValidName
public String getValidName(org.eclipse.xtext.ui.editor.model.IXtextDocument doc, String methodNamePrefix)
Description copied from interface:IBslModuleEventsLookup
Returns unique method name for Bsl module.- Specified by:
getValidName
in interfaceIBslModuleEventsLookup
- Parameters:
doc
- actualIXtextDocument
, can't benull
methodNamePrefix
- prefix of method name, can't benull
- Returns:
- unique method name for Bsl module, never
null
-
createInsertContentProposals
public String createInsertContentProposals(Event event, ParamSet set, String eventName, boolean isMainItem, boolean isCommandHandler, Module actualBslModule, String procedureDerictive, int offset, org.eclipse.jface.text.IDocument document, boolean isRussian)
Description copied from interface:IBslModuleEventsLookup
Creates insert content assist proposals.- Specified by:
createInsertContentProposals
in interfaceIBslModuleEventsLookup
- Parameters:
event
- handle events, can't benull
set
- param set, can't benull
eventName
- event name, can't benull
isMainItem
-true
if event from main item of form,false
otherwiseisCommandHandler
-true
if event from command of form,false
otherwiseactualBslModule
- actual BSL module, cannot benull
procedureDerictive
- procedure derictive, can't benull
offset
- current cursor offsetdocument
- actualIDocument
, can't benull
isRussian
- whether current script variant is russian- Returns:
- insert content assist proposals, never
null
-
createInsertContentProposals
public String createInsertContentProposals(Event event, ParamSet set, String eventName, boolean isMainItem, boolean isCommandHandler, Module actualBslModule, String procedureDerictive, String procedureAnnotation, String extensionPrefix, int offset, org.eclipse.jface.text.IDocument document, boolean isRussian)
Description copied from interface:IBslModuleExtensionEventsLookup
Creates insert content assist proposals of event handler for extension module- Specified by:
createInsertContentProposals
in interfaceIBslModuleExtensionEventsLookup
- Parameters:
event
- handle events, can't benull
set
- param set, can't benull
eventName
- event name, can't benull
isMainItem
-true
if event from main item of form,false
otherwiseisCommandHandler
-true
if event from command of form,false
otherwiseactualBslModule
- actual BSL module, cannot benull
procedureDerictive
- procedure directive, can't benull
procedureAnnotation
- annotation directive, can't benull
extensionPrefix
- prefix of extension project, can't benull
offset
- current cursor offsetdocument
- actualIDocument
, can't benull
isRussian
- whether current script variant is russian- Returns:
- insert content assist proposals, never
null
-
-