Class GotoEventHandlerHandler
- java.lang.Object
-
- org.eclipse.core.commands.common.EventManager
-
- org.eclipse.core.commands.AbstractHandler
-
- com._1c.g5.v8.dt.form.ui.commands.AbstractGotoEventHandlerHandler<EventHandlerContainer>
-
- com._1c.g5.v8.dt.form.ui.commands.GotoEventHandlerHandler
-
- All Implemented Interfaces:
org.eclipse.core.commands.IHandler
,org.eclipse.core.commands.IHandler2
public class GotoEventHandlerHandler extends AbstractGotoEventHandlerHandler<EventHandlerContainer>
Checks selected form element event handler existence and then selects and reveals it.Command must be executed with event name command parameter and optionally with handler name command parameter if handler is not created yet and custom handler name is preferred.
-
-
Field Summary
Fields Modifier and Type Field Description protected FormItemInformationService
formItemInformationService
protected IRuntimeVersionSupport
runtimeVersionSupport
protected IV8ProjectManager
v8projectManager
-
Fields inherited from class com._1c.g5.v8.dt.form.ui.commands.AbstractGotoEventHandlerHandler
bmModelManager, moduleEventsLookup
-
-
Constructor Summary
Constructors Constructor Description GotoEventHandlerHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected EventHandlerContainer
extractEventOwner(org.eclipse.emf.ecore.EObject element, Form form, org.eclipse.core.commands.ExecutionEvent executionEvent)
Extracts event owner from given form element.protected String
generateEventHandlerName(EventHandlerContainer eventOwner, org.eclipse.emf.ecore.EObject element, org.eclipse.core.commands.ExecutionEvent executionEvent)
GenerateseventOwner
event handler name.protected Event
getCreatingEvent(org.eclipse.emf.ecore.EObject eventOwner, org.eclipse.core.commands.ExecutionEvent executionEvent, String handlerName)
Gets event for handler creation.protected Event
getEvent(org.eclipse.emf.ecore.EObject eventOwner, org.eclipse.core.commands.ExecutionEvent executionEvent)
Extracts event for the provided form event owner and command execution event.protected String
getEventHandlerName(EventHandlerContainer eventOwner, org.eclipse.emf.ecore.EObject element, org.eclipse.core.commands.ExecutionEvent executionEvent)
ReturnseventOwner
event handler name.protected String
getEventName(org.eclipse.core.commands.ExecutionEvent executionEvent)
Returns the handler event english name provided by the execution event.protected String
getHandlerName(org.eclipse.core.commands.ExecutionEvent executionEvent)
Returns the handler name provided by the execution event.protected String
getProcedureDirective(org.eclipse.swt.widgets.Shell shell, boolean isRussian, EventHandlerContainer eventOwner, org.eclipse.emf.ecore.EObject element, org.eclipse.core.commands.ExecutionEvent executionEvent)
Returns procedure directive for chosen event, or empty string if there is no procedure for creating event handler.protected boolean
isAllowedServerCall(EventHandlerContainer eventOwner, org.eclipse.emf.ecore.EObject element, org.eclipse.core.commands.ExecutionEvent executionEvent)
Returns whether creating event handler server call is allowed.protected void
setEventHandler(EventHandlerContainer eventOwner, String eventHandlerName, org.eclipse.core.commands.ExecutionEvent executionEvent)
SetseventOwner
event handler.-
Methods inherited from class com._1c.g5.v8.dt.form.ui.commands.AbstractGotoEventHandlerHandler
execute, getEditingContext, getForm, isCommandHandler, isMainItem, openOrCreateEventHandler, selectAndReveal, shouldCreateEvent
-
Methods inherited from class org.eclipse.core.commands.AbstractHandler
addHandlerListener, dispose, fireHandlerChanged, hasListeners, isEnabled, isHandled, removeHandlerListener, setBaseEnabled, setEnabled
-
-
-
-
Field Detail
-
formItemInformationService
@Inject protected FormItemInformationService formItemInformationService
-
v8projectManager
@Inject protected IV8ProjectManager v8projectManager
-
runtimeVersionSupport
@Inject protected IRuntimeVersionSupport runtimeVersionSupport
-
-
Method Detail
-
extractEventOwner
protected EventHandlerContainer extractEventOwner(org.eclipse.emf.ecore.EObject element, Form form, org.eclipse.core.commands.ExecutionEvent executionEvent)
Description copied from class:AbstractGotoEventHandlerHandler
Extracts event owner from given form element.- Specified by:
extractEventOwner
in classAbstractGotoEventHandlerHandler<EventHandlerContainer>
- Parameters:
element
- the form element to extract event owner from, cannot benull
form
- the owner form, cannot benull
executionEvent
- the current execution event, cannot benull
- Returns:
- the event owner, never
null
-
getEventHandlerName
protected String getEventHandlerName(EventHandlerContainer eventOwner, org.eclipse.emf.ecore.EObject element, org.eclipse.core.commands.ExecutionEvent executionEvent)
Description copied from class:AbstractGotoEventHandlerHandler
ReturnseventOwner
event handler name. Can returnnull
if not provided.- Specified by:
getEventHandlerName
in classAbstractGotoEventHandlerHandler<EventHandlerContainer>
- Parameters:
eventOwner
- the owner of event, cannot benull
element
- the currently selected form element, cannot benull
executionEvent
- the current execution event, cannot benull
- Returns:
- the existing event handler name or
null
if none
-
generateEventHandlerName
protected String generateEventHandlerName(EventHandlerContainer eventOwner, org.eclipse.emf.ecore.EObject element, org.eclipse.core.commands.ExecutionEvent executionEvent)
Description copied from class:AbstractGotoEventHandlerHandler
GenerateseventOwner
event handler name.- Specified by:
generateEventHandlerName
in classAbstractGotoEventHandlerHandler<EventHandlerContainer>
- Parameters:
eventOwner
- the owner of event, cannot benull
element
- the currently selected form element, cannot benull
executionEvent
- the current execution event, cannot benull
- Returns:
- generated event handler name, never
null
-
setEventHandler
protected void setEventHandler(EventHandlerContainer eventOwner, String eventHandlerName, org.eclipse.core.commands.ExecutionEvent executionEvent)
Description copied from class:AbstractGotoEventHandlerHandler
SetseventOwner
event handler.- Specified by:
setEventHandler
in classAbstractGotoEventHandlerHandler<EventHandlerContainer>
- Parameters:
eventOwner
- the owner of event, cannot benull
eventHandlerName
- the event handler name to set, cannot benull
executionEvent
- the current execution event, cannot benull
-
isAllowedServerCall
protected boolean isAllowedServerCall(EventHandlerContainer eventOwner, org.eclipse.emf.ecore.EObject element, org.eclipse.core.commands.ExecutionEvent executionEvent)
Description copied from class:AbstractGotoEventHandlerHandler
Returns whether creating event handler server call is allowed.- Overrides:
isAllowedServerCall
in classAbstractGotoEventHandlerHandler<EventHandlerContainer>
- Parameters:
eventOwner
- the owner of event, cannot benull
element
- the currently selected form element, cannot benull
executionEvent
- the current execution event, cannot benull
- Returns:
- whether creating event handler server call is allowed
-
getProcedureDirective
protected String getProcedureDirective(org.eclipse.swt.widgets.Shell shell, boolean isRussian, EventHandlerContainer eventOwner, org.eclipse.emf.ecore.EObject element, org.eclipse.core.commands.ExecutionEvent executionEvent)
Description copied from class:AbstractGotoEventHandlerHandler
Returns procedure directive for chosen event, or empty string if there is no procedure for creating event handler.Can return
null
if user cancelled event handler creation.- Overrides:
getProcedureDirective
in classAbstractGotoEventHandlerHandler<EventHandlerContainer>
- Parameters:
shell
- the parent shell to open question dialog on, cannot benull
isRussian
-true
if actual script variant is russian,false
otherwiseeventOwner
- the owner of event, cannot benull
element
- the currently selected form element, cannot benull
executionEvent
- the current execution event, cannot benull
- Returns:
- the procedure directive for chosen event, or empty string if there is no procedure for chosen event,
or
null
if user cancelled event handler creation
-
getCreatingEvent
protected Event getCreatingEvent(org.eclipse.emf.ecore.EObject eventOwner, org.eclipse.core.commands.ExecutionEvent executionEvent, String handlerName)
Description copied from class:AbstractGotoEventHandlerHandler
Gets event for handler creation.- Specified by:
getCreatingEvent
in classAbstractGotoEventHandlerHandler<EventHandlerContainer>
- Parameters:
eventOwner
- the owner of event, cannot benull
executionEvent
- the current execution event, cannot benull
handlerName
- the event handler name to create event with, cannot benull
- Returns:
- creating event, never
null
-
getEvent
protected Event getEvent(org.eclipse.emf.ecore.EObject eventOwner, org.eclipse.core.commands.ExecutionEvent executionEvent)
Extracts event for the provided form event owner and command execution event.- Parameters:
eventOwner
- the form event owner, cannot benull
executionEvent
- the command execution event, cannot benull
- Returns:
- event for the provided form event owner and command execution event, never
null
-
getHandlerName
protected String getHandlerName(org.eclipse.core.commands.ExecutionEvent executionEvent)
Returns the handler name provided by the execution event. Can returnnull
.- Parameters:
executionEvent
- the command execution event, cannot benull
- Returns:
- the handler name provided by the execution event or
null
if not provided
-
getEventName
protected String getEventName(org.eclipse.core.commands.ExecutionEvent executionEvent)
Returns the handler event english name provided by the execution event. Can returnnull
.- Parameters:
executionEvent
- the command execution event, cannot benull
- Returns:
- the handler event english name provided by the execution event or
null
if not provided
-
-