Interface IBslModuleEventsLookup

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      EventHandlerInformation createHandlerInForm​(org.eclipse.xtext.ui.editor.model.IXtextDocument document, 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.
      org.eclipse.xtext.util.Triple<org.eclipse.jface.text.ITextSelection,​Boolean,​Object> findHandlerInForm​(org.eclipse.xtext.ui.editor.model.IXtextDocument document, 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 inserting Event.
      String getValidName​(org.eclipse.xtext.ui.editor.model.IXtextDocument doc, String methodNamePrefix)
      Returns unique method name for Bsl module.
    • Method Detail

      • findHandlerInForm

        org.eclipse.xtext.util.Triple<org.eclipse.jface.text.ITextSelection,​Boolean,​Object> findHandlerInForm​(org.eclipse.xtext.ui.editor.model.IXtextDocument document,
                                                                                                                          String currentHandlerName)
        Finds method by name in form bsl module by handler name from property sheet.
        Parameters:
        document - actual IXtextDocument, can't be null
        currentHandlerName - searching handler's name, can't be null
        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
      • getPositionOfInsertionEvent

        int getPositionOfInsertionEvent​(Module module,
                                        int offset,
                                        org.eclipse.jface.text.ITextViewer viewer)
        Defines offset of the inserting Event.
        Parameters:
        module - current Bsl module
        offset - current cursor offset
        viewer - current ITextViewer
        Returns:
        offset of the inserting Event
      • getValidName

        String getValidName​(org.eclipse.xtext.ui.editor.model.IXtextDocument doc,
                            String methodNamePrefix)
        Returns unique method name for Bsl module.
        Parameters:
        doc - actual IXtextDocument, can't be null
        methodNamePrefix - prefix of method name, can't be null
        Returns:
        unique method name for Bsl module, never null
      • createHandlerInForm

        EventHandlerInformation createHandlerInForm​(org.eclipse.xtext.ui.editor.model.IXtextDocument document,
                                                    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).
        Parameters:
        document - actual IXtextDocument, can't be null
        viewer - actual ITextViewer, can't be null
        currentHandlerName - searching handler's name, can't be null
        event - handle events, can't be null
        isMainItem - true if event from main item of form, false otherwise
        isCommandHandler - true if event from command of form, false otherwise
        procedureDerictive - directive for chosen event, or empty string if there is no procedure for chosen event
        Returns:
        EventHandlerInformation, can't be null
      • createInsertContentProposals

        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.
        Parameters:
        event - handle events, can't be null
        set - param set, can't be null
        eventName - event name, can't be null
        isMainItem - true if event from main item of form, false otherwise
        isCommandHandler - true if event from command of form, false otherwise
        actualBslModule - actual BSL module, cannot be null
        procedureDerictive - procedure derictive, can't be null
        offset - current cursor offset
        document - actual IDocument, can't be null
        isRussian - whether current script variant is russian
        Returns:
        insert content assist proposals, never null