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.AbstractHandlerMain class for diagram handlers. Contains basic methods.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractDiagramHandler.DiagramBuilderInstance of this class builds new diagram.protected static classAbstractDiagramHandler.DiagramRefresherInstance of this class refreshes diagram on given tab.protected static classAbstractDiagramHandler.NotUndoableEventInstance of this class sendsNotUndoableOperationto given in constructor editor operation manager.
-
Field Summary
Fields Modifier and Type Field Description protected IBmModelManagerbmModelManagerBm model manager.protected com._1c.g5.v8.dt.diagram.framework.core.IConvertersService<MdObject>convertersServiceConverters service that converts md objects.protected DiagramConfigurationExtractorextractorConfiguration extractor.protected IV8ProjectManagerprojectManagerV8 project manager.protected IResourceLookupresourceLookupResource lookup.
-
Constructor Summary
Constructors Constructor Description AbstractDiagramHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaskForNewTab(ErdEditor editor)Asks user if new tab should be opened.protected Collection<MdObject>convertToMdObjects(Collection<? extends IErdEntity> entities)Converts given entities to mdObjects.Objectexecute(org.eclipse.core.commands.ExecutionEvent event)protected voidfillLiterals()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 ErdDiagramControllergetController(DiagramTabItem tab, org.eclipse.core.runtime.IProgressMonitor progressMonitor)Returns diagram controller from given tab.protected booleanisProjectSelected(IStructuredSelection selection)Returnstrueif selection contains project.protected List<MdObject>lookForMdObjects(IStructuredSelection selection)Looks for MdObjects in given selection.protected abstract voidprocessMdObjects(Collection<MdObject> mdObjects, ErdEditor editor)Processes given md objects.protected voidshowNoSelectedObjectsMessage()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)
Returnstrueif selection contains project.- Parameters:
selection- - selection. Can't benull.- Returns:
trueif 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.
-
-