Package com._1c.g5.v8.dt.erd.ui.handlers
Class AbstractDiagramHandler
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.core.commands.AbstractHandler
com._1c.g5.v8.dt.erd.ui.handlers.AbstractDiagramHandler
- All Implemented Interfaces:
org.eclipse.core.commands.IHandler
,org.eclipse.core.commands.IHandler2
- Direct Known Subclasses:
AddEntitiesHandler
,AddToGroupHandler
,BuildConnectedHandler
,BuildDiagramHandler
,DeleteEntitiesHandler
,DropEntitiesHandler
,FindOnDiagramHandler
,GroupEntitiesHandler
,ShowConnectedHandler
,UngroupEntitiesHandler
public abstract class AbstractDiagramHandler
extends org.eclipse.core.commands.AbstractHandler
Main class for diagram handlers. Contains basic methods.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
Instance of this class builds new diagram.protected static class
Instance of this class refreshes diagram on given tab.protected static class
Instance of this class sendsNotUndoableOperation
to given in constructor editor operation manager. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IBmModelManager
Bm model manager.protected com._1c.g5.v8.dt.diagram.framework.core.IConvertersService<MdObject>
Converters service that converts md objects.protected DiagramConfigurationExtractor
Configuration extractor.protected IV8ProjectManager
V8 project manager.protected IResourceLookup
Resource lookup. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
askForNewTab
(ErdEditor editor) Asks user if new tab should be opened.protected Collection<MdObject>
convertToMdObjects
(Collection<? extends IErdEntity> entities) Converts given entities to mdObjects.execute
(org.eclipse.core.commands.ExecutionEvent event) protected void
Fills extractor literals.protected Collection<MdObject>
getConfigurationObjects
(Configuration configuration) Returns configuration subsystems if there any.protected Collection<MdObject>
getConfigurationSubsystems
(Configuration configuration) Returns subsystems from givenconfiguration
.protected ErdDiagramController
getController
(DiagramTabItem tab, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Returns diagram controller from given tab.protected boolean
isProjectSelected
(IStructuredSelection selection) Returnstrue
if selection contains project.lookForMdObjects
(IStructuredSelection selection) Looks for MdObjects in given selection.protected abstract void
processMdObjects
(Collection<MdObject> mdObjects, ErdEditor editor) Processes given md objects.protected void
Shows message about no MdObjects selected to user.Methods inherited from class org.eclipse.core.commands.AbstractHandler
addHandlerListener, dispose, fireHandlerChanged, hasListeners, isEnabled, isHandled, removeHandlerListener, setBaseEnabled, setEnabled
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
Field Details
-
convertersService
@Inject protected com._1c.g5.v8.dt.diagram.framework.core.IConvertersService<MdObject> convertersServiceConverters service that converts md objects. Notnull
. -
projectManager
V8 project manager. Notnull
. -
extractor
Configuration extractor. Notnull
. -
resourceLookup
Resource lookup. Notnull
. -
bmModelManager
Bm model manager. Notnull
.
-
-
Constructor Details
-
AbstractDiagramHandler
public AbstractDiagramHandler()
-
-
Method Details
-
execute
public Object execute(org.eclipse.core.commands.ExecutionEvent event) throws org.eclipse.core.commands.ExecutionException - Throws:
org.eclipse.core.commands.ExecutionException
-
processMdObjects
Processes given md objects. Realization varies.- Parameters:
mdObjects
- - objects to process. Can't benull
.editor
- - context editor. Can't benull
.
-
showNoSelectedObjectsMessage
protected void showNoSelectedObjectsMessage()Shows message about no MdObjects selected to user. -
isProjectSelected
Returnstrue
if selection contains project.- Parameters:
selection
- - selection. Can't benull
.- Returns:
true
if selection contains project.
-
askForNewTab
Asks user if new tab should be opened. If user accepts opens new tab.- Parameters:
editor
- - editor to get tabs. Can't benull
.
-
lookForMdObjects
Looks for MdObjects in given selection.- Parameters:
selection
- - selection. Can't benull
.- Returns:
- found MdObjects. Can't return
null
.
-
getController
protected ErdDiagramController getController(DiagramTabItem tab, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Returns diagram controller from given tab.- Parameters:
tab
- - tab to get controller from. Can't benull
.progressMonitor
- - monitor to report progress. Can benull
.- Returns:
- diagram controller from given tab. Can't return
null
.
-
convertToMdObjects
Converts given entities to mdObjects.- Parameters:
entities
- - entities to convert. Can't benull
.- Returns:
- converted entities. Can't return
null
.
-
fillLiterals
protected void fillLiterals()Fills extractor literals. -
getConfigurationObjects
Returns configuration subsystems if there any. Else returns all configuration objects.- Parameters:
configuration
- - configuration. Can't benull
.- Returns:
- objects from given configuration. Can't return
null
.
-
getConfigurationSubsystems
Returns subsystems from givenconfiguration
.- Parameters:
configuration
- - configuration. Can't benull
.- Returns:
- subsystems from given configuration. Can't return
null
.
-