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 Classes Modifier and Type Class Description protected static class
AbstractDiagramHandler.DiagramBuilder
Instance of this class builds new diagram.protected static class
AbstractDiagramHandler.DiagramRefresher
Instance of this class refreshes diagram on given tab.protected static class
AbstractDiagramHandler.NotUndoableEvent
Instance of this class sendsNotUndoableOperation
to given in constructor editor operation manager.
-
Field Summary
Fields Modifier and Type Field Description protected IBmModelManager
bmModelManager
Bm model manager.protected com._1c.g5.v8.dt.diagram.framework.core.IConvertersService<MdObject>
convertersService
Converters service that converts md objects.protected DiagramConfigurationExtractor
extractor
Configuration extractor.protected IV8ProjectManager
projectManager
V8 project manager.protected IResourceLookup
resourceLookup
Resource lookup.
-
Constructor Summary
Constructors Constructor Description AbstractDiagramHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected 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.Object
execute(org.eclipse.core.commands.ExecutionEvent event)
protected void
fillLiterals()
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.protected List<MdObject>
lookForMdObjects(IStructuredSelection selection)
Looks for MdObjects in given selection.protected abstract void
processMdObjects(Collection<MdObject> mdObjects, ErdEditor editor)
Processes given md objects.protected void
showNoSelectedObjectsMessage()
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
-
-
-
-
Field Detail
-
convertersService
@Inject protected com._1c.g5.v8.dt.diagram.framework.core.IConvertersService<MdObject> convertersService
Converters service that converts md objects. Notnull
.
-
projectManager
@Inject protected IV8ProjectManager projectManager
V8 project manager. Notnull
.
-
extractor
@Inject protected DiagramConfigurationExtractor extractor
Configuration extractor. Notnull
.
-
resourceLookup
@Inject protected IResourceLookup resourceLookup
Resource lookup. Notnull
.
-
bmModelManager
@Inject protected IBmModelManager bmModelManager
Bm model manager. Notnull
.
-
-
Method Detail
-
execute
public Object execute(org.eclipse.core.commands.ExecutionEvent event) throws org.eclipse.core.commands.ExecutionException
- Throws:
org.eclipse.core.commands.ExecutionException
-
processMdObjects
protected abstract void processMdObjects(Collection<MdObject> mdObjects, ErdEditor editor)
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
protected boolean isProjectSelected(IStructuredSelection selection)
Returnstrue
if selection contains project.- Parameters:
selection
- - selection. Can't benull
.- Returns:
true
if selection contains project.
-
askForNewTab
protected void askForNewTab(ErdEditor editor)
Asks user if new tab should be opened. If user accepts opens new tab.- Parameters:
editor
- - editor to get tabs. Can't benull
.
-
lookForMdObjects
protected List<MdObject> lookForMdObjects(IStructuredSelection selection)
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
protected Collection<MdObject> convertToMdObjects(Collection<? extends IErdEntity> entities)
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
protected Collection<MdObject> getConfigurationObjects(Configuration configuration)
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
protected Collection<MdObject> getConfigurationSubsystems(Configuration configuration)
Returns subsystems from givenconfiguration
.- Parameters:
configuration
- - configuration. Can't benull
.- Returns:
- subsystems from given configuration. Can't return
null
.
-
-